Is there a preprocessor definition which I could use in #ifdef checks to discern the different versions of C++ language?
Is there a preprocessor definition which I could use in #ifdef checks to discern
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The value of the
__cplusplusmacro is supposed to serve this purpose. Unfortunately, GCC has (before 4.7) always set this to1, making it unusable for this purpose.(The values are
199711Lfor C++98/03, and201103Lfor C++11.)