Maxpm Maxpm - 24 days ago 19
C++ Question

How do I check for C++11 support?

Is there a way to detect at compile-time if the compiler supports certain features of C++11? For example, something like this:

#ifndef VARIADIC_TEMPLATES_SUPPORTED

#error "Your compiler doesn't support variadic templates. :("

#else

template <typename... DatatypeList>
class Tuple
{
// ...
}

#endif

Answer

Boost.Config has a plethora of macros that can be used to test for support for specific C++11 features.

Comments