Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is #defined if a compiler is Cpp0x compliant?

Tags:

c++

c++11

Is there any official, or inofficial, #defines for when a compiler is Cpp0x compliant? Even better, for specific Cpp0x functionality (~#cpp0xlambda, #cpp0xrvalue etc)?

(Haven't found anything about this on the net)

like image 382
Viktor Sehr Avatar asked Nov 06 '09 09:11

Viktor Sehr


2 Answers

For C++03 according to 16.8/1 (Predefined macro names):

The name __cplusplus is defined to the value 199711L when compiling a C++ translation unit.

For C++0x draft n2857 according to 16.8/1 (Predefined macro names):

The name __cplusplus is defined to the value [tbd] when compiling a C++ translation unit.

like image 114
Kirill V. Lyadvinsky Avatar answered Oct 22 '22 02:10

Kirill V. Lyadvinsky


Bjarne's C++0x FAQ says:

__cplusplus

In C++0x the macro __cplusplus will be set to a value that differs from (is greater than) the current 199711L.

like image 32
Mark Rushakoff Avatar answered Oct 22 '22 03:10

Mark Rushakoff