Theoretical question only – why i can’t write such code:
auto auto foo = 0;
First auto keyword – storage class specifier (yeah, i know that it’s useless and deprecated in C++11), second auto keyword – auto type-specifier.
So what’s wrong?
And again – i don’t really want to use this in real code.
The
autostorage class specifier is not “useless and deprecated in C++11,” it has been removed entirely. Theautokeyword is no longer a storage class specifier and cannot be used as one.In C++11,
autois a simple type specifier.