
Douglas Gregor wrote:
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)
Should these be positive or negative feature tests? I am imagining that once tests for these features are in place, library maintainers will not want to revisit code once C++0x is published to test for BOOST_NO_VARIADIC_TEMPLATES instead. The latter form is more typical of how we deal with feature-detection today. As library maintainer John Maddoc should get the final call, but my preference would be BOOST_NO_FEATURE forms. It should be fairly easy to create a single header that all compiler configs can use, and then selectively undef features in the compiler config file itself as new features are implemented.
This list will grow as more C++0x features become available in compilers.
Other features I am aware of: I believe MSVC implements delegating constructors, although that may be only in C++/CLI mode. Likewise, I am not sure about nullptr. I believe Borland implement C99 preprocessor extensions in their C++ compiler. Suspect several others do too. and of course, most compilers implement long long now. -- AlisdairM