diff --git a/doc/html/boost_config/acknowledgements.html b/doc/html/boost_config/acknowledgements.html index 8286d72d..f8143ae3 100644 --- a/doc/html/boost_config/acknowledgements.html +++ b/doc/html/boost_config/acknowledgements.html @@ -3,7 +3,7 @@ Acknowledgements - + diff --git a/doc/html/boost_config/boost_macro_reference.html b/doc/html/boost_config/boost_macro_reference.html index e1fc36f2..bcf14049 100644 --- a/doc/html/boost_config/boost_macro_reference.html +++ b/doc/html/boost_config/boost_macro_reference.html @@ -3,7 +3,7 @@ Boost Macro Reference - + @@ -27,14 +27,16 @@ Boost Macro Reference
-
Macros - that describe defects
+
Macros + that describe C++03 defects
Macros that describe optional features
-
Macros - that describe possible C++0x features
-
Macros - that describe C++0x features not supported
+
Macros + that describe possible C++ future features
+
Macros + that describe C++11 features not supported
+
Macros + that allow use of C++11 features with C++03 compilers
Boost Helper Macros
Boost @@ -44,13 +46,13 @@

-Macros - that describe defects +Macros + that describe C++03 defects

- The following macros all describe features that are required by the C++ standard, - if one of the following macros is defined, then it represents a defect in - the compiler's conformance with the standard. + The following macros all describe features that are required by the C++03 + standard, if one of the following macros is defined, then it represents a + defect in the compiler's conformance with the 2003 standard.

@@ -313,7 +315,7 @@ - - - - - - - - - - - -

The compiler fails to compile a nested class that has a dependent - base class: + base class:

template<typename T>
 struct foo : {
@@ -339,9 +341,8 @@
 

Template value parameters cannot have a dependent type, for example: -

-
template<class T, typename T::type value> 
+
template<class T, typename T::type value>
 class X { ... };
 

@@ -420,7 +421,7 @@

The compiler does not perform function template ordering or its - function template ordering is incorrect. + function template ordering is incorrect.

// #1
 template<class T> void f(T);
@@ -1312,7 +1313,7 @@
 

The compiler does not allow a void function to return the result - of calling another void function. + of calling another void function.

void f() {}
 void g() { return f(); }
@@ -2235,13 +2236,12 @@
 
 

- The following macros describe features that are likely to be included in - the upcoming ISO C++ standard, C++0x, but have not yet been approved for - inclusion in the language. + The following macros describe features that may be included in some future + ISO C++ standard, but have not yet been approved for inclusion in the language.

@@ -2276,12 +2276,12 @@

- The following macros describe features in the upcoming ISO C++ standard, - C++0x, that are not yet supported by a particular compiler or library. + The following macros describe features in the 2011 ISO C++ standard, formerly + known as C++0x, that are not yet supported by a particular compiler or library.

@@ -2877,6 +2877,155 @@
+

+ The following macros allow use of C++11 features even with compilers that + do not yet provide compliant C++11 support. +

+
++++ + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Macro +

+
+

+ Section +

+
+

+ Description +

+
+

+ BOOST_CONSTEXPR +

+
+

+ Some compilers don't support the use of constexpr. + This macro expands to nothing on those compilers, and constexpr elsewhere. For example, + when defining a constexpr function or constructor replace: +

+
constexpr tuple();
+
+

+ with: +

+
BOOST_CONSTEXPR tuple();
+
+

+

+
+

+ BOOST_CONSTEXPR_OR_CONST +

+
+

+ Some compilers don't support the use of constexpr. + This macro expands to const + on those compilers, and constexpr + elsewhere. For example, when defining const expr variables replace: +

+
static constexpr UIntType xor_mask = a;
+
+

+ with: +

+
static BOOST_CONSTEXPR_OR_CONST UIntType xor_mask = a;
+
+

+

+
+

+ BOOST_STATIC_CONSTEXPR +

+
+

+ This is a shortcut for static + BOOST_CONSTEXPR_OR_CONSTFor + example, when defining const expr variables replace: +

+
static constexpr UIntType xor_mask = a;
+
+

+ with: +

+
BOOST_STATIC_CONSTEXPR UIntType xor_mask = a;
+
+

+

+
+

+

+
BOOST_NOEXCEPT
+BOOST_NOEXCEPT_IF(Predicate)
+BOOST_NOEXCEPT_EXPR(Expression)
+
+

+

+
+

+ If BOOST_NO_NOEXCEPT + is defined (i.e. C++03 compliant compilers) these macros are defined + as: +

+
+

+

+
#define BOOST_NOEXCEPT
+#define BOOST_NOEXCEPT_IF(Predicate)
+#define BOOST_NOEXCEPT_EXPR(Expression) false
+
+

+

+
+

+ If BOOST_NO_NOEXCEPT + is not defined (i.e. C++11 compliant compilers) they are defined + as: +

+
+

+

+
#define BOOST_NOEXCEPT noexcept
+#define BOOST_NOEXCEPT_IF(Predicate) noexcept((Predicate))
+#define BOOST_NOEXCEPT_EXPR(Expression) noexcept((Expression))
+
+

+

+
+
+
+
+ @@ -2912,12 +3061,12 @@

This macro is used where a compiler specific workaround is required that is not otherwise described by one of the other Boost.Config - macros. To use the macro you must first + macros. To use the macro you must first

#include <boost/detail/workaround.hpp>
 

- usage is then: + usage is then:

#if BOOST_WORKAROUND(MACRONAME, CONDITION)
    // workaround code goes here...
@@ -2960,12 +3109,12 @@
                   Sometimes you have a function name with the same name as a C macro,
                   for example "min" and "max" member functions,
                   in which case one can prevent the function being expanded as a
-                  macro using: 
+                  macro using:
 

someclass.min BOOST_PREVENT_MACRO_SUBSTITUTION(arg1, arg2);
 

- The following also works in most, but not all, contexts: + The following also works in most, but not all, contexts:

(someclass.max)(arg1, arg2);
 
@@ -3060,14 +3209,14 @@ integral constant members, we must use enums as a workaround if we want the constants to be available at compile-time. This macro gives us a convenient way to declare such constants. For example - instead of: + instead of:

struct foo{
    static const int value = 2;
 };
 

- use: + use:

struct foo{
    BOOST_STATIC_CONSTANT(int, value = 2);
@@ -3100,7 +3249,7 @@
                 

Some compilers silently "fold" different function template instantiations if some of the template parameters don't appear - in the function parameter list. For instance: + in the function parameter list. For instance:

#include <iostream>
 #include <ostream>
@@ -3124,7 +3273,7 @@
                   incorrectly outputs 2 2 double double on VC++
                   6. These macros, to be used in the function parameter list, fix
                   the problem without effects on the calling syntax. For instance,
-                  in the case above write: 
+                  in the case above write:
 

template <int n>
 void f(BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int, n)) { ... }
@@ -3234,77 +3383,6 @@
                 

-

- BOOST_CONSTEXPR -

-
-

- Some compilers don't support the use of constexpr. - This macro expands to nothing on those compilers, and constexpr elsewhere. For example, - when defining a constexpr function or constructor replace: -

-
constexpr tuple();
-
-

- with: -

-
BOOST_CONSTEXPR tuple();
-
-

-

-
-

- BOOST_CONSTEXPR_OR_CONST -

-
-

- Some compilers don't support the use of constexpr. - This macro expands to const - on those compilers, and constexpr - elsewhere. For example, when defining const expr variables replace: - -

-
static constexpr UIntType xor_mask = a;
-
-

- with: -

-
static BOOST_CONSTEXPR_OR_CONST UIntType xor_mask = a;
-
-

-

-
-

- BOOST_STATIC_CONSTEXPR -

-
-

- This is a shortcut for static - BOOST_CONSTEXPR_OR_CONSTFor - example, when defining const expr variables replace: -

-
static constexpr UIntType xor_mask = a;
-
-

- with: -

-
BOOST_STATIC_CONSTEXPR UIntType xor_mask = a;
-
-

-

-
@@ -3705,7 +3783,7 @@ RTTI. Examples include class for objects that will be thrown as exceptions or used in dynamic_casts, across shared library boundaries. For example, a header-only exception class might - look like this: + look like this:

class BOOST_SYMBOL_VISIBLE my_exception : public std::runtime_error { ... };
 
@@ -3743,7 +3821,7 @@ #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FOO_DYN_LINK) # if defined(BOOST_FOO_SOURCE) # define BOOST_FOO_DECL BOOST_SYMBOL_EXPORT -# else +# else # define BOOST_FOO_DECL BOOST_SYMBOL_IMPORT # endif #else @@ -3765,7 +3843,7 @@ boost/libs/foo/src/foo.cpp

#define BOOST_FOO_SOURCE
-#include <boost/foo/foo.hpp>    
+#include <boost/foo/foo.hpp>
 ...
 void BOOST_FOO_DECL f()
 {
diff --git a/doc/html/boost_config/guidelines_for_boost_authors.html b/doc/html/boost_config/guidelines_for_boost_authors.html
index cbc7dbce..1079480d 100644
--- a/doc/html/boost_config/guidelines_for_boost_authors.html
+++ b/doc/html/boost_config/guidelines_for_boost_authors.html
@@ -3,7 +3,7 @@
 
 Guidelines for Boost Authors
 
-
+
 
 
 
diff --git a/doc/html/boost_config/rationale.html b/doc/html/boost_config/rationale.html
index d62510c1..f92d7993 100644
--- a/doc/html/boost_config/rationale.html
+++ b/doc/html/boost_config/rationale.html
@@ -3,7 +3,7 @@
 
 Rationale
 
-
+
 
 
 
diff --git a/doc/html/index.html b/doc/html/index.html
index 8ba9dc99..9c7fb0b1 100644
--- a/doc/html/index.html
+++ b/doc/html/index.html
@@ -3,7 +3,7 @@
 
 Boost.Config
 
-
+
 
 
 
@@ -29,7 +29,7 @@
 

@@ -947,7 +949,7 @@ - +

Last revised: July 13, 2011 at 18:00:55 GMT

Last revised: October 10, 2011 at 14:43:27 GMT


diff --git a/doc/macro_reference.qbk b/doc/macro_reference.qbk index 07b13c14..2ed236a2 100644 --- a/doc/macro_reference.qbk +++ b/doc/macro_reference.qbk @@ -16,11 +16,11 @@ [#config_defects] -[section Macros that describe defects] +[section Macros that describe C++03 defects] -The following macros all describe features that are required by the C++ standard, +The following macros all describe features that are required by the C++03 standard, if one of the following macros is defined, then it represents a defect in the -compiler's conformance with the standard. +compiler's conformance with the 2003 standard. [table @@ -514,11 +514,10 @@ standard). [endsect] -[section Macros that describe possible C++0x features] +[section Macros that describe possible C++ future features] -The following macros describe features that are likely to be included in the -upcoming ISO C++ standard, C++0x, but have not yet been approved for inclusion -in the language. +The following macros describe features that may be included in some future +ISO C++ standard, but have not yet been approved for inclusion in the language. [table @@ -531,9 +530,9 @@ The compiler supports concepts. [endsect] -[section Macros that describe C++0x features not supported] +[section Macros that describe C++11 features not supported] -The following macros describe features in the upcoming ISO C++ standard, C++0x, +The following macros describe features in the 2011 ISO C++ standard, formerly known as C++0x, that are not yet supported by a particular compiler or library. [table @@ -641,6 +640,76 @@ variadic macros. [endsect] +[#config_11_for_03] + +[section Macros that allow use of C++11 features with C++03 compilers] + +The following macros allow use of C++11 features even with compilers that do not yet +provide compliant C++11 support. + +[table +[[Macro ][Section ][ Description ]] + +[[`BOOST_CONSTEXPR`][ +Some compilers don't support the use of `constexpr`. This macro expands to nothing on those compilers, and `constexpr` +elsewhere. For example, when defining a constexpr function or constructor replace: +`` + constexpr tuple(); +`` +with: +`` + BOOST_CONSTEXPR tuple(); +`` +]] +[[`BOOST_CONSTEXPR_OR_CONST`][ +Some compilers don't support the use of `constexpr`. This macro expands to `const` on those compilers, and `constexpr` +elsewhere. For example, when defining const expr variables replace: +`` + static constexpr UIntType xor_mask = a; +`` +with: +`` + static BOOST_CONSTEXPR_OR_CONST UIntType xor_mask = a; +`` +]] +[[`BOOST_STATIC_CONSTEXPR`][ +This is a shortcut for `static BOOST_CONSTEXPR_OR_CONST`For example, when defining const expr variables replace: +`` + static constexpr UIntType xor_mask = a; +`` +with: +`` + BOOST_STATIC_CONSTEXPR UIntType xor_mask = a; +`` +]] +[[ +`` + BOOST_NOEXCEPT + BOOST_NOEXCEPT_IF(Predicate) + BOOST_NOEXCEPT_EXPR(Expression) +`` +][ +If `BOOST_NO_NOEXCEPT` is defined (i.e. C++03 compliant compilers) these macros are defined as: +[: +`` + #define BOOST_NOEXCEPT + #define BOOST_NOEXCEPT_IF(Predicate) + #define BOOST_NOEXCEPT_EXPR(Expression) false +`` +] +If `BOOST_NO_NOEXCEPT` is not defined (i.e. C++11 compliant compilers) they are defined as: +[: +`` + #define BOOST_NOEXCEPT noexcept + #define BOOST_NOEXCEPT_IF(Predicate) noexcept((Predicate)) + #define BOOST_NOEXCEPT_EXPR(Expression) noexcept((Expression)) +`` +] +]] +] + +[endsect] + [#config_helpers] [section Boost Helper Macros] @@ -820,38 +889,6 @@ the arguments is itself a macro (see 16.3.1 in C++ standard). This is normally used to create a mangled name in combination with a predefined macro such a \_\_LINE__. ]] -[[`BOOST_CONSTEXPR`][ -Some compilers don't support the use of `constexpr`. This macro expands to nothing on those compilers, and `constexpr` -elsewhere. For example, when defining a constexpr function or constructor replace: -`` - constexpr tuple(); -`` -with: -`` - BOOST_CONSTEXPR tuple(); -`` -]] -[[`BOOST_CONSTEXPR_OR_CONST`][ -Some compilers don't support the use of `constexpr`. This macro expands to `const` on those compilers, and `constexpr` -elsewhere. For example, when defining const expr variables replace: -`` - static constexpr UIntType xor_mask = a; -`` -with: -`` - static BOOST_CONSTEXPR_OR_CONST UIntType xor_mask = a; -`` -]] -[[`BOOST_STATIC_CONSTEXPR`][ -This is a shortcut for `static BOOST_CONSTEXPR_OR_CONST`For example, when defining const expr variables replace: -`` - static constexpr UIntType xor_mask = a; -`` -with: -`` - BOOST_STATIC_CONSTEXPR UIntType xor_mask = a; -`` -]] ] [endsect] diff --git a/include/boost/config/suffix.hpp b/include/boost/config/suffix.hpp index 7e5d4d4d..c2bbcb70 100644 --- a/include/boost/config/suffix.hpp +++ b/include/boost/config/suffix.hpp @@ -635,6 +635,20 @@ namespace std{ using ::type_info; } #define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y) #define BOOST_DO_JOIN2( X, Y ) X##Y +// +// Helper macros BOOST_NOEXCEPT, BOOST_NOEXCEPT_IF, BOOST_NOEXCEPT_EXPR +// These aid the transition to C++11 while still supporting C++03 compilers +// +#ifdef BOOST_NO_NOEXCEPT +# define BOOST_NOEXCEPT +# define BOOST_NOEXCEPT_IF(Predicate) +# define BOOST_NOEXCEPT_EXPR(Expression) false +#else +# define BOOST_NOEXCEPT noexcept +# define BOOST_NOEXCEPT_IF(Predicate) noexcept((Predicate)) +# define BOOST_NOEXCEPT_EXPR(Expression) noexcept((Expression)) +#endif + // // Set some default values for compiler/library/platform names. // These are for debugging config setup only: