It is possible to write a function, which, when compiled with a C compiler will return 0, and when compiled with a C++ compiler, will return 1 (the trivial sulution with
#include template void test(T t) { t.first = false; } bool isCpp0x() { bool b = true; test( std::make_pair(b, 0) ); return b; }