Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

capture C++0x flag inside the program [duplicate]

Tags:

c++

c++11

Possible Duplicate:
GNU C++ how to check when -std=c++0x is in effect?

What I want to do is:

 #if defined(CPLUSPLUS_OXFLAG)
  //do something
 #else
  //do something else
 #endif

Now how can I capture -std=c++0x argument passed to the compiler(g++) to define my CPLUSPLUS_OXFLAG flag?

like image 842
A. K. Avatar asked Jul 31 '26 05:07

A. K.


1 Answers

The GCC documentation states that the preprocessor symbol __GXX_EXPERIMENTAL_CXX0X__ is defined when compiling with -std=c++0x.

like image 80
Praetorian Avatar answered Aug 01 '26 17:08

Praetorian