
The C++ committee has been working on the upcoming revision of the ISO C ++ standard, C++0x, which will include several new features that are likely to be of interest to Boost developers and users. As C++0x draws nearer, we are starting to see preliminary implementations of C++0x features. We need more experience with the use of these new language features to better understand how well they work. Boost can help the C++ community gain valuable experience with these features by upgrading and extending existing Boost libraries with these new language features. To support this goal, I have committed a set of changes to the Boost config library (on CVS HEAD), which add several new macros to indicate the availability of C++0x features. The list involves only features that I know have been implemented; see below for the compilers that support various features. The new configuration macros are: BOOST_CXX0X_LONG_LONG: long long support (aliases BOOST_HAS_LONG_LONG) BOOST_CXX0X_PREPROCESSOR: C99 preprocessor extensions BOOST_CXX0X_RVALUE_REFERENCES: rvalue references BOOST_CXX0X_STATIC_ASSERT: static assertions BOOST_CXX0X_CONCEPTS: concepts (not yet accepted) BOOST_CXX0X_VARIADIC_TEMPLATES: variadic templates (not yet accepted) This list will grow as more C++0x features become available in compilers. Still, we can now use these macros within Boost libraries however we want. For example, I added the following to boost/static_assert.hpp: #ifdef BOOST_CXX0X_STATIC_ASSERT # define BOOST_STATIC_ASSERT( B ) static_assert(B, #B) #else // today's library-defined BOOST_STATIC_ASSERT #endif The error messages when using a compiler supporting static_assert are much more useful. I know of support for the following C++0x features in publicly available compilers: Rvalue references: - Metrowerks CodeWarrior 10: no link; the compiler was discontinued :( Static assertions: - GCC 4.3.0: http://gcc.gnu.org/gcc-4.3/changes.html (in active development) Concepts: - ConceptGCC: http://www.generic-programming.org/software/ConceptGCC/ Variadic templates: - Patch against GCC: http://www.generic-programming.org/~dgregor/cpp/variadic-templates.html I plan to start nightly Boost regression tests for some of these compilers, so we can track our progress on C++0x support. We get to play with cool new language features *and* help the C++ community at large. What could be better than that? Cheers, Doug