Reputation: 16906
I think my compiler understands C++11, but maybe not. Instead of trying it on existing messes of source code which are buggy anyway, is there some simple "hello world" level snippet of source code I can try to compile, which if it does compile without error, proves the compiler is reading it as C++11?
Upvotes: 0
Views: 177
Reputation: 21156
The Problem is that compiler usually don't support a new standard completely from the start. Meaning, they may support one c++11 feature, but not another.
However, as far as c++11 is concerned, I think VC++ is the only major compiler that doesn't fully support it, even though you may have to enable the c++11 mode manually. For g++ you e.g. have to supply the compiler flag -std=c++11 (or -std=gnu++11) - the same holds true for newer versions like c++14).
Upvotes: 3
Reputation: 96286
Shortest thing possible:
[]{};
Is's a lambda-expression without argument list.
Upvotes: 3
Reputation: 84
Try this one,
auto f = [](){};
or write some code with rvalue reference.
Upvotes: 4