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
From this question:
struct T { bool flag; T() : flag(false) {} T(const T&) : flag(true) {} }; std::vector test(1); bool is_cpp0x = !test[0].flag;