C ++ 11 modernization methods

I would like to begin the transition to using C ++ 11 in a large cross-platform code base. The main problem is that the level of support for C ++ 11 depends on the compilers used.

Besides clogging macros throughout the code, does anyone have any examples / suggestions on how to make this transition easier? Please provide methods for specific functions. For instance:

// cpp11compat.h

// For compilers that do not have 'nullptr', we will define it as 'NULL'.
// Any misuses of 'nullptr' will be caught by C++11 compliant compilers.
// Obviously, this won't fix anything that depends on the type 'nullptr_t'
//
#ifdef STUPID_SUN_COMPILER
#define nullptr NULL
#endif

Thoughts?

+3
source share
2 answers

, ++ 11 . .: http://wiki.apache.org/stdcxx/C%2B%2B0xCompilerSupport auto, decltype , #define , , (, nullptr).

Boost.Config , . . config/platform/irix.hpp Irix.

: - Boost Feature Feature Language. , Move, Foreach Lambda, ( ) , ++ 11. Boost.

+1

. , , ++ 11 boost, , , , , .

, . , , , ++ 11 .

( , , , .)

0

All Articles