diff --git a/doc/has_nothrow_constructor.qbk b/doc/has_nothrow_constructor.qbk index 05145e8..e8945cf 100644 --- a/doc/has_nothrow_constructor.qbk +++ b/doc/has_nothrow_constructor.qbk @@ -22,11 +22,13 @@ These two traits are synonyms for each other. __compat If the compiler does not support partial-specialization of class templates, then this template can not be used with function types. -Without some (as yet unspecified) help from the compiler, +Without some (unspecified) help from the compiler, `has_nothrow_constructor` will never report that a class or struct has a non-throwing default-constructor; this is always safe, if possibly sub-optimal. -Currently (May 2005) only Visual C++ 8 has the necessary compiler __intrinsics to ensure that this -trait "just works". +Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this +trait "just works". You may also test to see if the necessary __intrinsics are available +by checking to see if the macro `BOOST_HAS_NOTHROW_CONSTRUCTOR` is defined. __header ` #include ` or ` #include ` diff --git a/doc/has_nothrow_copy.qbk b/doc/has_nothrow_copy.qbk index f118c80..c00a5a3 100644 --- a/doc/has_nothrow_copy.qbk +++ b/doc/has_nothrow_copy.qbk @@ -25,8 +25,10 @@ templates, then this template can not be used with function types. Without some (as yet unspecified) help from the compiler, `has_nothrow_copy` will never report that a class or struct has a non-throwing copy-constructor; this is always safe, if possibly sub-optimal. -Currently (May 2005) only Visual C++ 8 has the necessary compiler __intrinsics to ensure that this -trait "just works". +Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this +trait "just works". You may also test to see if the necessary __intrinsics are available +by checking to see if the macro `BOOST_HAS_NOTHROW_COPY` is defined. __header ` #include ` or ` #include ` diff --git a/doc/has_trivial_assign.qbk b/doc/has_trivial_assign.qbk index 8390175..5ecfc0e 100644 --- a/doc/has_trivial_assign.qbk +++ b/doc/has_trivial_assign.qbk @@ -21,9 +21,12 @@ templates, then this template can not be used with function types. Without some (as yet unspecified) help from the compiler, has_trivial_assign will never report that a user-defined class or struct has a -trivial constructor; this is always safe, if possibly sub-optimal. Currently -(May 2005) only MWCW 9 and Visual C++ 8 have the necessary compiler __intrinsics to detect -user-defined classes with trivial constructors. +trivial constructor; this is always safe, if possibly sub-optimal. +Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this +trait "just works". You may also test to see if the necessary __intrinsics are available +by checking to see if the macro `BOOST_HAS_TRIVIAL_ASSIGN` is defined. + __std_ref 12.8p11. diff --git a/doc/has_trivial_constructor.qbk b/doc/has_trivial_constructor.qbk index b2385c2..6bf7529 100644 --- a/doc/has_trivial_constructor.qbk +++ b/doc/has_trivial_constructor.qbk @@ -29,9 +29,12 @@ templates, then this template can not be used with function types. Without some (as yet unspecified) help from the compiler, has_trivial_constructor will never report that a user-defined class or struct has a -trivial constructor; this is always safe, if possibly sub-optimal. Currently -(May 2005) only MWCW 9 and Visual C++ 8 have the necessary compiler __intrinsics to detect -user-defined classes with trivial constructors. +trivial constructor; this is always safe, if possibly sub-optimal. +Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this +trait "just works". You may also test to see if the necessary __intrinsics are available +by checking to see if the macro `BOOST_HAS_TRIVIAL_CONSTRUCTOR` is defined. + __std_ref 12.1p6. diff --git a/doc/has_trivial_copy.qbk b/doc/has_trivial_copy.qbk index 220e79d..42019e4 100644 --- a/doc/has_trivial_copy.qbk +++ b/doc/has_trivial_copy.qbk @@ -27,9 +27,12 @@ templates, then this template can not be used with function types. Without some (as yet unspecified) help from the compiler, has_trivial_copy will never report that a user-defined class or struct has a -trivial constructor; this is always safe, if possibly sub-optimal. Currently -(May 2005) only MWCW 9 and Visual C++ 8 have the necessary compiler __intrinsics to detect -user-defined classes with trivial constructors. +trivial constructor; this is always safe, if possibly sub-optimal. +Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this +trait "just works". You may also test to see if the necessary __intrinsics are available +by checking to see if the macro `BOOST_HAS_TRIVIAL_COPY` is defined. + __std_ref 12.8p6. diff --git a/doc/has_trivial_destructor.qbk b/doc/has_trivial_destructor.qbk index a15093e..166c092 100644 --- a/doc/has_trivial_destructor.qbk +++ b/doc/has_trivial_destructor.qbk @@ -23,9 +23,12 @@ templates, then this template can not be used with function types. Without some (as yet unspecified) help from the compiler, has_trivial_destructor will never report that a user-defined class or struct has a -trivial destructor; this is always safe, if possibly sub-optimal. Currently -(May 2005) only MWCW 9 and Visual C++ 8 have the necessary compiler __intrinsics to detect -user-defined classes with trivial constructors. +trivial destructor; this is always safe, if possibly sub-optimal. +Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this +trait "just works". You may also test to see if the necessary __intrinsics are available +by checking to see if the macro `BOOST_HAS_TRIVIAL_DESTRUCTOR` is defined. + __std_ref 12.4p3. diff --git a/doc/has_virtual_destructor.qbk b/doc/has_virtual_destructor.qbk index 018a5a5..5bc3e65 100644 --- a/doc/has_virtual_destructor.qbk +++ b/doc/has_virtual_destructor.qbk @@ -17,8 +17,12 @@ Technical Report on C++ Library Extensions. However, there is currently no way to portably implement this trait. The default version provided always inherits from __false_type, and has to be explicitly specialized for types with virtual destructors unless the compiler used has compiler __intrinsics -that enable the trait to do the right thing: currently (May 2005) only Visual C++ -8 and GCC-4.3 have the necessary __intrinsics. +that enable the trait to do the right thing: +Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this +trait "just works". You may also test to see if the necessary __intrinsics are available +by checking to see if the macro `BOOST_HAS_VIRTUAL_DESTRUCTOR` is defined. + __std_ref 12.4. diff --git a/doc/html/boost_typetraits/background.html b/doc/html/boost_typetraits/background.html index cad28bc..bbd7870 100644 --- a/doc/html/boost_typetraits/background.html +++ b/doc/html/boost_typetraits/background.html @@ -56,7 +56,7 @@ method available to them.

- + Type Traits

@@ -84,7 +84,7 @@ given.

- + Implementation

@@ -174,7 +174,7 @@ in the default template.

- + Optimized copy

@@ -247,7 +247,7 @@ otherwise it will call the "slow but safe version".

- + Was it worth it?

@@ -379,7 +379,7 @@

- + Pair of References

@@ -597,7 +597,7 @@ easier to maintain and easier to understand.

- + Conclusion

@@ -610,7 +610,7 @@ can be optimal as well as generic.

- + Acknowledgements

@@ -618,7 +618,7 @@ comments when preparing this article.

- + References
    diff --git a/doc/html/boost_typetraits/category/transform.html b/doc/html/boost_typetraits/category/transform.html index 9c15b07..abb39ac 100644 --- a/doc/html/boost_typetraits/category/transform.html +++ b/doc/html/boost_typetraits/category/transform.html @@ -103,7 +103,7 @@ struct remove_volatile;
    - + Broken Compiler Workarounds:
    diff --git a/doc/html/boost_typetraits/history.html b/doc/html/boost_typetraits/history.html index 5d9ff96..96b3a3c 100644 --- a/doc/html/boost_typetraits/history.html +++ b/doc/html/boost_typetraits/history.html @@ -27,7 +27,7 @@ History
- + Boost 1.47.0
    @@ -41,7 +41,7 @@
- + Boost 1.45.0
    @@ -57,7 +57,7 @@
- + Boost 1.44.0
    @@ -73,7 +73,7 @@
- + Boost 1.42.0
  • diff --git a/doc/html/boost_typetraits/reference/common_type.html b/doc/html/boost_typetraits/reference/common_type.html index 4d321e4..4af6fd2 100644 --- a/doc/html/boost_typetraits/reference/common_type.html +++ b/doc/html/boost_typetraits/reference/common_type.html @@ -73,7 +73,7 @@ template arguments is 3.

    - + Configuration macros
    @@ -103,7 +103,7 @@ Otherwise when BOOST_COMMON_TYPE_DONT_USE_TYPEOF is not defined it uses Boost.TypeOf.

    - + Tutorial

    @@ -138,7 +138,7 @@ This is a very useful and broadly applicable utility.

    - + How to get the common type of types with explicit conversions?
    @@ -160,7 +160,7 @@ };
    - + How important is the order of the common_type<> template arguments?
    @@ -240,7 +240,7 @@ A>.

    - + Can the common_type of two types be a third type?
    @@ -267,7 +267,7 @@ B>.

    - + How common_type behaves with pointers?
    @@ -303,7 +303,7 @@ Of course the user can always make this specialization.

    - + Can you explain the pros/cons of common_type against Boost.Typeof?
    diff --git a/doc/html/boost_typetraits/reference/has_nothrow_constructor.html b/doc/html/boost_typetraits/reference/has_nothrow_constructor.html index ab1fc2d..85f0b1c 100644 --- a/doc/html/boost_typetraits/reference/has_nothrow_constructor.html +++ b/doc/html/boost_typetraits/reference/has_nothrow_constructor.html @@ -48,11 +48,15 @@ can not be used with function types.

    - Without some (as yet unspecified) help from the compiler, has_nothrow_constructor + Without some (unspecified) help from the compiler, has_nothrow_constructor will never report that a class or struct has a non-throwing default-constructor; - this is always safe, if possibly sub-optimal. Currently (May 2005) only Visual - C++ 8 has the necessary compiler intrinsics - to ensure that this trait "just works". + this is always safe, if possibly sub-optimal. Currently (May 2011) compilers + more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear + have the necessary compiler intrinsics + to ensure that this trait "just works". You may also test to see + if the necessary intrinsics + are available by checking to see if the macro BOOST_HAS_NOTHROW_CONSTRUCTOR + is defined.

    Header: #include diff --git a/doc/html/boost_typetraits/reference/has_nothrow_copy.html b/doc/html/boost_typetraits/reference/has_nothrow_copy.html index 116528a..62b3606 100644 --- a/doc/html/boost_typetraits/reference/has_nothrow_copy.html +++ b/doc/html/boost_typetraits/reference/has_nothrow_copy.html @@ -50,9 +50,13 @@

    Without some (as yet unspecified) help from the compiler, has_nothrow_copy will never report that a class or struct has a non-throwing copy-constructor; - this is always safe, if possibly sub-optimal. Currently (May 2005) only Visual - C++ 8 has the necessary compiler intrinsics - to ensure that this trait "just works". + this is always safe, if possibly sub-optimal. Currently (May 2011) compilers + more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear + have the necessary compiler intrinsics + to ensure that this trait "just works". You may also test to see + if the necessary intrinsics + are available by checking to see if the macro BOOST_HAS_NOTHROW_COPY + is defined.

    Header: #include diff --git a/doc/html/boost_typetraits/reference/has_trivial_assign.html b/doc/html/boost_typetraits/reference/has_trivial_assign.html index eac89ef..0094a69 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_assign.html +++ b/doc/html/boost_typetraits/reference/has_trivial_assign.html @@ -47,9 +47,13 @@

    Without some (as yet unspecified) help from the compiler, has_trivial_assign will never report that a user-defined class or struct has a trivial constructor; - this is always safe, if possibly sub-optimal. Currently (May 2005) only MWCW - 9 and Visual C++ 8 have the necessary compiler intrinsics - to detect user-defined classes with trivial constructors. + this is always safe, if possibly sub-optimal. Currently (May 2011) compilers + more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear + have the necessary compiler intrinsics + to ensure that this trait "just works". You may also test to see + if the necessary intrinsics + are available by checking to see if the macro BOOST_HAS_TRIVIAL_ASSIGN + is defined.

    C++ Standard Reference: 12.8p11. diff --git a/doc/html/boost_typetraits/reference/has_trivial_constructor.html b/doc/html/boost_typetraits/reference/has_trivial_constructor.html index 152cbae..8892c44 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_constructor.html +++ b/doc/html/boost_typetraits/reference/has_trivial_constructor.html @@ -55,9 +55,13 @@

    Without some (as yet unspecified) help from the compiler, has_trivial_constructor will never report that a user-defined class or struct has a trivial constructor; - this is always safe, if possibly sub-optimal. Currently (May 2005) only MWCW - 9 and Visual C++ 8 have the necessary compiler intrinsics - to detect user-defined classes with trivial constructors. + this is always safe, if possibly sub-optimal. Currently (May 2011) compilers + more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear + have the necessary compiler intrinsics + to ensure that this trait "just works". You may also test to see + if the necessary intrinsics + are available by checking to see if the macro BOOST_HAS_TRIVIAL_CONSTRUCTOR + is defined.

    C++ Standard Reference: 12.1p6. diff --git a/doc/html/boost_typetraits/reference/has_trivial_copy.html b/doc/html/boost_typetraits/reference/has_trivial_copy.html index 1325a1c..4f37c23 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_copy.html +++ b/doc/html/boost_typetraits/reference/has_trivial_copy.html @@ -53,9 +53,13 @@

    Without some (as yet unspecified) help from the compiler, has_trivial_copy will never report that a user-defined class or struct has a trivial constructor; - this is always safe, if possibly sub-optimal. Currently (May 2005) only MWCW - 9 and Visual C++ 8 have the necessary compiler intrinsics - to detect user-defined classes with trivial constructors. + this is always safe, if possibly sub-optimal. Currently (May 2011) compilers + more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear + have the necessary compiler intrinsics + to ensure that this trait "just works". You may also test to see + if the necessary intrinsics + are available by checking to see if the macro BOOST_HAS_TRIVIAL_COPY + is defined.

    C++ Standard Reference: 12.8p6. diff --git a/doc/html/boost_typetraits/reference/has_trivial_destructor.html b/doc/html/boost_typetraits/reference/has_trivial_destructor.html index 8419cec..1e92116 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_destructor.html +++ b/doc/html/boost_typetraits/reference/has_trivial_destructor.html @@ -49,9 +49,13 @@

    Without some (as yet unspecified) help from the compiler, has_trivial_destructor will never report that a user-defined class or struct has a trivial destructor; - this is always safe, if possibly sub-optimal. Currently (May 2005) only MWCW - 9 and Visual C++ 8 have the necessary compiler intrinsics - to detect user-defined classes with trivial constructors. + this is always safe, if possibly sub-optimal. Currently (May 2011) compilers + more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear + have the necessary compiler intrinsics + to ensure that this trait "just works". You may also test to see + if the necessary intrinsics + are available by checking to see if the macro BOOST_HAS_TRIVIAL_DESTRUCTOR + is defined.

    C++ Standard Reference: 12.4p3. diff --git a/doc/html/boost_typetraits/reference/has_virtual_destructor.html b/doc/html/boost_typetraits/reference/has_virtual_destructor.html index b80bf98..c93d4b0 100644 --- a/doc/html/boost_typetraits/reference/has_virtual_destructor.html +++ b/doc/html/boost_typetraits/reference/has_virtual_destructor.html @@ -41,8 +41,13 @@ trait. The default version provided always inherits from false_type, and has to be explicitly specialized for types with virtual destructors unless the compiler used has compiler intrinsics - that enable the trait to do the right thing: currently (May 2005) only Visual - C++ 8 and GCC-4.3 have the necessary intrinsics. + that enable the trait to do the right thing: Currently (May 2011) compilers + more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear + have the necessary compiler intrinsics + to ensure that this trait "just works". You may also test to see + if the necessary intrinsics + are available by checking to see if the macro BOOST_HAS_VIRTUAL_DESTRUCTOR + is defined.

    C++ Standard Reference: 12.4. diff --git a/doc/html/boost_typetraits/reference/is_class.html b/doc/html/boost_typetraits/reference/is_class.html index 3a76a48..25fdf92 100644 --- a/doc/html/boost_typetraits/reference/is_class.html +++ b/doc/html/boost_typetraits/reference/is_class.html @@ -47,8 +47,12 @@ yet unspecified) help from the compiler, we cannot distinguish between union and class types, as a result this type will erroneously inherit from true_type for union types. See also is_union. - Currently (May 2005) only Visual C++ 8 has the necessary compiler intrinsics - to correctly identify union types, and therefore make is_class function correctly. + Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills + 6.0, Intel-11.0, and Codegear have the necessary compiler intrinsics + to ensure that this trait "just works". You may also test to see + if the necessary intrinsics + are available by checking to see if the macro BOOST_IS_CLASS + is defined.

    Examples: diff --git a/doc/html/boost_typetraits/reference/is_empty.html b/doc/html/boost_typetraits/reference/is_empty.html index f79e5d6..1aefaff 100644 --- a/doc/html/boost_typetraits/reference/is_empty.html +++ b/doc/html/boost_typetraits/reference/is_empty.html @@ -52,7 +52,8 @@

  • the compiler providing intrinsics - to detect empty classes. + to detect empty classes - this latter case can be tested for by checking + to see if the macro BOOST_IS_EMPTY is defined.

diff --git a/doc/html/boost_typetraits/reference/is_pod.html b/doc/html/boost_typetraits/reference/is_pod.html index 59a698c..a7001b1 100644 --- a/doc/html/boost_typetraits/reference/is_pod.html +++ b/doc/html/boost_typetraits/reference/is_pod.html @@ -53,10 +53,15 @@ can not be used with function types.

- Without some (as yet unspecified) help from the compiler, ispod - will never report that a class or struct is a POD; this is always safe, if - possibly sub-optimal. Currently (May 2005) only MWCW 9 and Visual C++ 8 have - the necessary compiler-_intrinsics. + Without some (as yet unspecified) help from the compiler, is_pod will never + report that a class or struct is a POD; this is always safe, if possibly + sub-optimal. Currently (May 2011) compilers more recent than Visual C++ 8, + GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear have the necessary compiler + intrinsics to ensure that + this trait "just works". You may also test to see if the necessary + intrinsics are available + by checking to see if the macro BOOST_IS_POD + is defined.

Header: #include diff --git a/doc/html/boost_typetraits/reference/is_stateless.html b/doc/html/boost_typetraits/reference/is_stateless.html index fbd994d..0786250 100644 --- a/doc/html/boost_typetraits/reference/is_stateless.html +++ b/doc/html/boost_typetraits/reference/is_stateless.html @@ -65,9 +65,10 @@

Without some (as yet unspecified) help from the compiler, is_stateless will never report that a class or struct is stateless; this is always safe, if - possibly sub-optimal. Currently (May 2005) only MWCW 9 and Visual C++ 8 have - the necessary compiler intrinsics - to make this template work automatically. + possibly sub-optimal. Currently (May 2011) compilers more recent than Visual + C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear have the necessary + compiler intrinsics to + ensure that this trait "just works".

diff --git a/doc/html/boost_typetraits/reference/is_union.html b/doc/html/boost_typetraits/reference/is_union.html index 6906b97..37d2a8e 100644 --- a/doc/html/boost_typetraits/reference/is_union.html +++ b/doc/html/boost_typetraits/reference/is_union.html @@ -46,9 +46,13 @@ inherit from true_type, unless the user explicitly specializes the template for their user-defined union types, or unless the compiler supplies some unspecified intrinsic that - implements this functionality. Currently (May 2005) only Visual C++ 8 has + implements this functionality. Currently (May 2011) compilers more recent + than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear have the necessary compiler intrinsics - to make this trait "just work" without user intervention. + to ensure that this trait "just works". You may also test to see + if the necessary intrinsics + are available by checking to see if the macro BOOST_IS_UNION + is defined.

Header: #include diff --git a/doc/html/index.html b/doc/html/index.html index 321cc9c..8c91095 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -30,7 +30,7 @@ Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert Ramey and Jeremy Siek

-

+

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

diff --git a/doc/html/index/s11.html b/doc/html/index/s11.html index 29b619f..28ed747 100644 --- a/doc/html/index/s11.html +++ b/doc/html/index/s11.html @@ -24,7 +24,7 @@

-Class Index

+Class Index

A C D E F H I M P R T

diff --git a/doc/html/index/s12.html b/doc/html/index/s12.html index 371ee9a..3ca1275 100644 --- a/doc/html/index/s12.html +++ b/doc/html/index/s12.html @@ -24,7 +24,7 @@

-Typedef Index

+Typedef Index

F R T

diff --git a/doc/html/index/s13.html b/doc/html/index/s13.html index b415ea9..758c23e 100644 --- a/doc/html/index/s13.html +++ b/doc/html/index/s13.html @@ -24,7 +24,7 @@

-Macro Index

+Macro Index

B

@@ -40,37 +40,70 @@
BOOST_HAS_NOTHROW_ASSIGN

Support for Compiler Intrinsics

BOOST_HAS_NOTHROW_CONSTRUCTOR
-

Support for Compiler Intrinsics

+
+ + +

has_nothrow_constructor

Support for Compiler Intrinsics

BOOST_HAS_NOTHROW_COPY
-

Support for Compiler Intrinsics

+
+ + +

has_nothrow_copy

Support for Compiler Intrinsics

BOOST_HAS_TRIVIAL_ASSIGN
-

Support for Compiler Intrinsics

+
+ + +

has_trivial_assign

Support for Compiler Intrinsics

BOOST_HAS_TRIVIAL_CONSTRUCTOR
-

Support for Compiler Intrinsics

+
+ + +

has_trivial_constructor

Support for Compiler Intrinsics

BOOST_HAS_TRIVIAL_COPY
-

Support for Compiler Intrinsics

+
+ + +

has_trivial_copy

Support for Compiler Intrinsics

BOOST_HAS_TRIVIAL_DESTRUCTOR
-

Support for Compiler Intrinsics

+
+ + +

has_trivial_destructor

Support for Compiler Intrinsics

BOOST_HAS_VIRTUAL_DESTRUCTOR
-

Support for Compiler Intrinsics

+
+ + +

has_virtual_destructor

Support for Compiler Intrinsics

BOOST_IS_ABSTRACT

Support for Compiler Intrinsics

BOOST_IS_BASE_OF

Support for Compiler Intrinsics

BOOST_IS_CLASS
-

Support for Compiler Intrinsics

+
+ + +

is_class

Support for Compiler Intrinsics

BOOST_IS_CONVERTIBLE

Support for Compiler Intrinsics

BOOST_IS_EMPTY
-

Support for Compiler Intrinsics

+
+ + +

is_empty

Support for Compiler Intrinsics

BOOST_IS_ENUM

Support for Compiler Intrinsics

BOOST_IS_POD
-

Support for Compiler Intrinsics

+
+ + +

is_pod

Support for Compiler Intrinsics

BOOST_IS_POLYMORPHIC

Support for Compiler Intrinsics

BOOST_IS_UNION
-

Support for Compiler Intrinsics

+
+ + +

is_union

Support for Compiler Intrinsics

diff --git a/doc/html/index/s14.html b/doc/html/index/s14.html index 9bbd960..27f7280 100644 --- a/doc/html/index/s14.html +++ b/doc/html/index/s14.html @@ -23,7 +23,7 @@

-Index

+Index

A B C D E F H I M P R S T U

@@ -71,37 +71,70 @@
BOOST_HAS_NOTHROW_ASSIGN

Support for Compiler Intrinsics

BOOST_HAS_NOTHROW_CONSTRUCTOR
-

Support for Compiler Intrinsics

+
+ + +

has_nothrow_constructor

Support for Compiler Intrinsics

BOOST_HAS_NOTHROW_COPY
-

Support for Compiler Intrinsics

+
+ + +

has_nothrow_copy

Support for Compiler Intrinsics

BOOST_HAS_TRIVIAL_ASSIGN
-

Support for Compiler Intrinsics

+
+ + +

has_trivial_assign

Support for Compiler Intrinsics

BOOST_HAS_TRIVIAL_CONSTRUCTOR
-

Support for Compiler Intrinsics

+
+ + +

has_trivial_constructor

Support for Compiler Intrinsics

BOOST_HAS_TRIVIAL_COPY
-

Support for Compiler Intrinsics

+
+ + +

has_trivial_copy

Support for Compiler Intrinsics

BOOST_HAS_TRIVIAL_DESTRUCTOR
-

Support for Compiler Intrinsics

+
+ + +

has_trivial_destructor

Support for Compiler Intrinsics

BOOST_HAS_VIRTUAL_DESTRUCTOR
-

Support for Compiler Intrinsics

+
+ + +

has_virtual_destructor

Support for Compiler Intrinsics

BOOST_IS_ABSTRACT

Support for Compiler Intrinsics

BOOST_IS_BASE_OF

Support for Compiler Intrinsics

BOOST_IS_CLASS
-

Support for Compiler Intrinsics

+
+ + +

is_class

Support for Compiler Intrinsics

BOOST_IS_CONVERTIBLE

Support for Compiler Intrinsics

BOOST_IS_EMPTY
-

Support for Compiler Intrinsics

+
+ + +

is_empty

Support for Compiler Intrinsics

BOOST_IS_ENUM

Support for Compiler Intrinsics

BOOST_IS_POD
-

Support for Compiler Intrinsics

+
+ + +

is_pod

Support for Compiler Intrinsics

BOOST_IS_POLYMORPHIC

Support for Compiler Intrinsics

BOOST_IS_UNION
-

Support for Compiler Intrinsics

+
+ + +

is_union

Support for Compiler Intrinsics

C @@ -155,11 +188,13 @@

has_nothrow_assign

has_nothrow_constructor
+

BOOST_HAS_NOTHROW_CONSTRUCTOR

has_nothrow_constructor

has_nothrow_default_constructor

has_nothrow_copy
+

BOOST_HAS_NOTHROW_COPY

has_nothrow_copy

has_nothrow_copy_constructor

@@ -168,14 +203,19 @@
has_nothrow_default_constructor

has_nothrow_constructor

has_trivial_assign
-

has_trivial_assign

+
+ + +

BOOST_HAS_TRIVIAL_ASSIGN

has_trivial_assign

has_trivial_constructor
+

BOOST_HAS_TRIVIAL_CONSTRUCTOR

has_trivial_constructor

has_trivial_default_constructor

has_trivial_copy
+

BOOST_HAS_TRIVIAL_COPY

has_trivial_copy

has_trivial_copy_constructor

@@ -184,9 +224,15 @@
has_trivial_default_constructor

has_trivial_constructor

has_trivial_destructor
-

has_trivial_destructor

+
+ + +

BOOST_HAS_TRIVIAL_DESTRUCTOR

has_trivial_destructor

has_virtual_destructor
-

has_virtual_destructor

+
+ + +

BOOST_HAS_VIRTUAL_DESTRUCTOR

has_virtual_destructor

I @@ -217,6 +263,7 @@

is_base_of

is_class
+

BOOST_IS_CLASS

is_class

User Defined Specializations

@@ -229,7 +276,10 @@
is_convertible

is_convertible

is_empty
-

is_empty

+
+ + +

BOOST_IS_EMPTY

is_empty

is_enum

is_enum

is_floating_point
@@ -255,6 +305,7 @@

is_object

is_pod
+

BOOST_IS_POD

is_pod

User Defined Specializations

@@ -279,6 +330,7 @@

is_stateless

is_union
+

BOOST_IS_UNION

is_union

User Defined Specializations

diff --git a/doc/is_class.qbk b/doc/is_class.qbk index bf058c9..a1fa984 100644 --- a/doc/is_class.qbk +++ b/doc/is_class.qbk @@ -19,8 +19,10 @@ __header ` #include ` or ` #include ` or ` #include ` or ` #include ` diff --git a/doc/is_stateless.qbk b/doc/is_stateless.qbk index 22f9648..79db8b1 100644 --- a/doc/is_stateless.qbk +++ b/doc/is_stateless.qbk @@ -33,8 +33,10 @@ then this template can not be used with function types. Without some (as yet unspecified) help from the compiler, is_stateless will never report that a class or struct is stateless; this is always safe, -if possibly sub-optimal. Currently (May 2005) only MWCW 9 and Visual C++ 8 have the necessary -compiler __intrinsics to make this template work automatically. +if possibly sub-optimal. +Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this +trait "just works". [endsect] diff --git a/doc/is_union.qbk b/doc/is_union.qbk index 0227fe8..9d8cd8f 100644 --- a/doc/is_union.qbk +++ b/doc/is_union.qbk @@ -19,9 +19,12 @@ __compat Without (some as yet unspecified) help from the compiler, we cannot distinguish between union and class types using only standard C++, as a result this type will never inherit from __true_type, unless the user explicitly specializes the template for their user-defined union types, or unless the compiler -supplies some unspecified intrinsic that implements this functionality. Currently -(May 2005) only Visual C++ 8 has the necessary compiler __intrinsics to make this -trait "just work" without user intervention. +supplies some unspecified intrinsic that implements this functionality. +Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this +trait "just works". You may also test to see if the necessary __intrinsics are available +by checking to see if the macro `BOOST_IS_UNION` is defined. + __header ` #include ` or ` #include ` diff --git a/include/boost/type_traits/has_nothrow_assign.hpp b/include/boost/type_traits/has_nothrow_assign.hpp index 3cef735..83e5968 100644 --- a/include/boost/type_traits/has_nothrow_assign.hpp +++ b/include/boost/type_traits/has_nothrow_assign.hpp @@ -20,16 +20,22 @@ namespace detail{ template struct has_nothrow_assign_imp{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::has_trivial_assign::value, - BOOST_HAS_NOTHROW_ASSIGN(T) - >::value)); +#ifndef BOOST_HAS_NOTHROW_ASSIGN + BOOST_STATIC_CONSTANT(bool, value = ::boost::has_trivial_assign::value); +#else + BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_NOTHROW_ASSIGN(T)); +#endif }; } BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_assign,T,::boost::detail::has_nothrow_assign_imp::value) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void const volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void volatile,false) +#endif } // namespace boost diff --git a/include/boost/type_traits/has_nothrow_constructor.hpp b/include/boost/type_traits/has_nothrow_constructor.hpp index e807fd4..3bc4f80 100644 --- a/include/boost/type_traits/has_nothrow_constructor.hpp +++ b/include/boost/type_traits/has_nothrow_constructor.hpp @@ -20,11 +20,11 @@ namespace detail{ template struct has_nothrow_constructor_imp{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::has_trivial_constructor::value, - BOOST_HAS_NOTHROW_CONSTRUCTOR(T) - >::value)); +#ifdef BOOST_HAS_NOTHROW_CONSTRUCTOR + BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_NOTHROW_CONSTRUCTOR(T)); +#else + BOOST_STATIC_CONSTANT(bool, value = ::boost::has_trivial_constructor::value); +#endif }; } @@ -32,6 +32,20 @@ struct has_nothrow_constructor_imp{ BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_constructor,T,::boost::detail::has_nothrow_constructor_imp::value) BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_default_constructor,T,::boost::detail::has_nothrow_constructor_imp::value) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void const volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void volatile,false) +#endif + +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void const volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void volatile,false) +#endif + } // namespace boost #include diff --git a/include/boost/type_traits/has_nothrow_copy.hpp b/include/boost/type_traits/has_nothrow_copy.hpp index c06b4a3..9c3c903 100644 --- a/include/boost/type_traits/has_nothrow_copy.hpp +++ b/include/boost/type_traits/has_nothrow_copy.hpp @@ -20,11 +20,11 @@ namespace detail{ template struct has_nothrow_copy_imp{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::has_trivial_copy::value, - BOOST_HAS_NOTHROW_COPY(T) - >::value)); +#ifdef BOOST_HAS_NOTHROW_COPY + BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_NOTHROW_COPY(T)); +#else + BOOST_STATIC_CONSTANT(bool, value = ::boost::has_trivial_copy::value); +#endif }; } @@ -32,6 +32,20 @@ struct has_nothrow_copy_imp{ BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_copy,T,::boost::detail::has_nothrow_copy_imp::value) BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_copy_constructor,T,::boost::detail::has_nothrow_copy_imp::value) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void const volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void volatile,false) +#endif + +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void const volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void volatile,false) +#endif + } // namespace boost #include diff --git a/include/boost/type_traits/has_trivial_assign.hpp b/include/boost/type_traits/has_trivial_assign.hpp index 4179e8d..404b62c 100644 --- a/include/boost/type_traits/has_trivial_assign.hpp +++ b/include/boost/type_traits/has_trivial_assign.hpp @@ -28,20 +28,27 @@ namespace detail { template struct has_trivial_assign_impl { +#ifdef BOOST_HAS_TRIVIAL_ASSIGN + BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_TRIVIAL_ASSIGN(T)); +#else BOOST_STATIC_CONSTANT(bool, value = (::boost::type_traits::ice_and< - ::boost::type_traits::ice_or< - ::boost::is_pod::value, - BOOST_HAS_TRIVIAL_ASSIGN(T) - >::value, - ::boost::type_traits::ice_not< ::boost::is_const::value >::value, + ::boost::is_pod::value, + ::boost::type_traits::ice_not< ::boost::is_const::value >::value, ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value >::value)); +#endif }; } // namespace detail BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_assign,T,::boost::detail::has_trivial_assign_impl::value) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void const volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void volatile,false) +#endif } // namespace boost diff --git a/include/boost/type_traits/has_trivial_constructor.hpp b/include/boost/type_traits/has_trivial_constructor.hpp index f9ade5d..30dbdd8 100644 --- a/include/boost/type_traits/has_trivial_constructor.hpp +++ b/include/boost/type_traits/has_trivial_constructor.hpp @@ -24,11 +24,19 @@ namespace detail { template struct has_trivial_ctor_impl { +#ifdef BOOST_HAS_TRIVIAL_CONSTRUCTOR BOOST_STATIC_CONSTANT(bool, value = (::boost::type_traits::ice_or< ::boost::is_pod::value, BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) >::value)); +#else + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_or< + ::boost::is_pod::value, + false + >::value)); +#endif }; } // namespace detail diff --git a/include/boost/type_traits/has_trivial_copy.hpp b/include/boost/type_traits/has_trivial_copy.hpp index 8c75361..ba4d884 100644 --- a/include/boost/type_traits/has_trivial_copy.hpp +++ b/include/boost/type_traits/has_trivial_copy.hpp @@ -27,14 +27,15 @@ namespace detail { template struct has_trivial_copy_impl { +#ifdef BOOST_HAS_TRIVIAL_COPY + BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_TRIVIAL_COPY(T)); +#else BOOST_STATIC_CONSTANT(bool, value = (::boost::type_traits::ice_and< - ::boost::type_traits::ice_or< - ::boost::is_pod::value, - BOOST_HAS_TRIVIAL_COPY(T) - >::value, - ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value + ::boost::is_pod::value, + ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value >::value)); +#endif }; } // namespace detail @@ -42,6 +43,20 @@ struct has_trivial_copy_impl BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_copy,T,::boost::detail::has_trivial_copy_impl::value) BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_copy_constructor,T,::boost::detail::has_trivial_copy_impl::value) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void const volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void volatile,false) +#endif + +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void const volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void volatile,false) +#endif + } // namespace boost #include diff --git a/include/boost/type_traits/has_trivial_destructor.hpp b/include/boost/type_traits/has_trivial_destructor.hpp index f2a8ce6..79d7522 100644 --- a/include/boost/type_traits/has_trivial_destructor.hpp +++ b/include/boost/type_traits/has_trivial_destructor.hpp @@ -24,17 +24,24 @@ namespace detail { template struct has_trivial_dtor_impl { - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::is_pod::value, - BOOST_HAS_TRIVIAL_DESTRUCTOR(T) - >::value)); +#ifdef BOOST_HAS_TRIVIAL_DESTRUCTOR + BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_TRIVIAL_DESTRUCTOR(T)); +#else + BOOST_STATIC_CONSTANT(bool, value = ::boost::is_pod::value); +#endif }; } // namespace detail BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_destructor,T,::boost::detail::has_trivial_dtor_impl::value) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void const volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void volatile,false) +#endif + } // namespace boost #include diff --git a/include/boost/type_traits/has_virtual_destructor.hpp b/include/boost/type_traits/has_virtual_destructor.hpp old mode 100755 new mode 100644 index 8f99ff4..b741197 --- a/include/boost/type_traits/has_virtual_destructor.hpp +++ b/include/boost/type_traits/has_virtual_destructor.hpp @@ -16,7 +16,11 @@ namespace boost { +#ifdef BOOST_HAS_VIRTUAL_DESTRUCTOR BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_virtual_destructor,T,BOOST_HAS_VIRTUAL_DESTRUCTOR(T)) +#else +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_virtual_destructor,T,false) +#endif } // namespace boost diff --git a/include/boost/type_traits/intrinsics.hpp b/include/boost/type_traits/intrinsics.hpp index 00bffda..dcf5e43 100644 --- a/include/boost/type_traits/intrinsics.hpp +++ b/include/boost/type_traits/intrinsics.hpp @@ -33,8 +33,6 @@ // BOOST_HAS_VIRTUAL_DESTRUCTOR(T) should evaluate to true T has a virtual destructor // // The following can also be defined: when detected our implementation is greatly simplified. -// Note that unlike the macros above these do not have default definitions, so we can use -// #ifdef MACRONAME to detect when these are available. // // BOOST_IS_ABSTRACT(T) true if T is an abstract type // BOOST_IS_BASE_OF(T,U) true if T is a base class of U @@ -89,12 +87,12 @@ # define BOOST_IS_POD(T) (__is_pod(T) && __has_trivial_constructor(T)) # define BOOST_IS_EMPTY(T) __is_empty(T) # define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T) -# define BOOST_HAS_TRIVIAL_COPY(T) __has_trivial_copy(T) -# define BOOST_HAS_TRIVIAL_ASSIGN(T) __has_trivial_assign(T) -# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T) -# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T) -# define BOOST_HAS_NOTHROW_COPY(T) __has_nothrow_copy(T) -# define BOOST_HAS_NOTHROW_ASSIGN(T) __has_nothrow_assign(T) +# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T)|| ( ::boost::is_pod::value && !::boost::is_volatile::value)) +# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) || ( ::boost::is_pod::value && ! ::boost::is_const::value && !::boost::is_volatile::value)) +# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) || ::boost::is_pod::value) +# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) || ::boost::has_trivial_constructor::value) +# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) || ::boost::has_trivial_copy::value) +# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) || ::boost::has_trivial_assign::value) # define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T) # define BOOST_IS_ABSTRACT(T) __is_abstract(T) @@ -134,9 +132,9 @@ # define BOOST_IS_UNION(T) __is_union(T) # define BOOST_IS_POD(T) __is_pod(T) # define BOOST_IS_EMPTY(T) __is_empty(T) -# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T) -# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference::value) -# define BOOST_HAS_TRIVIAL_ASSIGN(T) __has_trivial_assign(T) +# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__has_trivial_constructor(T) && ! ::boost::is_volatile::value) +# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference::value && ! ::boost::is_volatile::value) +# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && ! ::boost::is_volatile::value) # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T) # define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T) # define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile::value && !is_reference::value) @@ -167,8 +165,8 @@ # define BOOST_IS_POD(T) __is_pod(T) # define BOOST_IS_EMPTY(T) __is_empty(T) # define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T) -# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference::value) -# define BOOST_HAS_TRIVIAL_ASSIGN(T) __has_trivial_assign(T) +# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference::value && && !is_volatile::value) +# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile::value) # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T) # define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T) # define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile::value && !is_reference::value) @@ -194,13 +192,13 @@ # define BOOST_IS_UNION(T) __is_union(T) # define BOOST_IS_POD(T) __is_pod(T) # define BOOST_IS_EMPTY(T) __is_empty(T) -# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__has_trivial_default_constructor(T) || is_void::value) -# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy_constructor(T) && !is_volatile::value && !is_reference::value || is_void::value) -# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile::value || is_void::value) -# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) || is_void::value) -# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_default_constructor(T) || is_void::value) -# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy_constructor(T) && !is_volatile::value && !is_reference::value || is_void::value) -# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile::value || is_void::value) +# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__has_trivial_default_constructor(T)) +# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy_constructor(T) && !is_volatile::value && !is_reference::value) +# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile::value) +# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T)) +# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_default_constructor(T)) +# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy_constructor(T) && !is_volatile::value && !is_reference::value) +# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile::value) # define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T) # define BOOST_IS_ABSTRACT(T) __is_abstract(T) @@ -214,50 +212,6 @@ # define BOOST_HAS_TYPE_TRAITS_INTRINSICS #endif -#ifndef BOOST_IS_UNION -# define BOOST_IS_UNION(T) false -#endif - -#ifndef BOOST_IS_POD -# define BOOST_IS_POD(T) false -#endif - -#ifndef BOOST_IS_EMPTY -# define BOOST_IS_EMPTY(T) false -#endif - -#ifndef BOOST_HAS_TRIVIAL_CONSTRUCTOR -# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) false -#endif - -#ifndef BOOST_HAS_TRIVIAL_COPY -# define BOOST_HAS_TRIVIAL_COPY(T) false -#endif - -#ifndef BOOST_HAS_TRIVIAL_ASSIGN -# define BOOST_HAS_TRIVIAL_ASSIGN(T) false -#endif - -#ifndef BOOST_HAS_TRIVIAL_DESTRUCTOR -# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) false -#endif - -#ifndef BOOST_HAS_NOTHROW_CONSTRUCTOR -# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) false -#endif - -#ifndef BOOST_HAS_NOTHROW_COPY -# define BOOST_HAS_NOTHROW_COPY(T) false -#endif - -#ifndef BOOST_HAS_NOTHROW_ASSIGN -# define BOOST_HAS_NOTHROW_ASSIGN(T) false -#endif - -#ifndef BOOST_HAS_VIRTUAL_DESTRUCTOR -# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) false -#endif - #endif // BOOST_TT_INTRINSICS_HPP_INCLUDED diff --git a/include/boost/type_traits/is_empty.hpp b/include/boost/type_traits/is_empty.hpp index 45c4e9e..8a2c5b8 100644 --- a/include/boost/type_traits/is_empty.hpp +++ b/include/boost/type_traits/is_empty.hpp @@ -31,6 +31,12 @@ // should be always the last #include directive #include +#ifndef BOOST_INTERNAL_IS_EMPTY +#define BOOST_INTERNAL_IS_EMPTY(T) false +#else +#define BOOST_INTERNAL_IS_EMPTY(T) BOOST_IS_EMPTY(T) +#endif + namespace boost { namespace detail { @@ -83,7 +89,7 @@ struct is_empty_impl bool, value = ( ::boost::type_traits::ice_or< ::boost::detail::empty_helper::value>::value - , BOOST_IS_EMPTY(cvt) + , BOOST_INTERNAL_IS_EMPTY(cvt) >::value )); }; @@ -118,7 +124,7 @@ struct is_empty_impl , ::boost::is_class::value , ::boost::is_convertible< r_type,int>::value >::value - , BOOST_IS_EMPTY(cvt) + , BOOST_INTERNAL_IS_EMPTY(cvt) >::value)); }; @@ -187,14 +193,14 @@ struct is_empty_impl typedef typename result::type eh_type; BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or::value)); + (::boost::type_traits::ice_or::value)); }; #else template struct is_empty_impl { - BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_EMPTY(T)); + BOOST_STATIC_CONSTANT(bool, value = BOOST_INTERNAL_IS_EMPTY(T)); }; #endif // BOOST_MSVC6_MEMBER_TEMPLATES @@ -217,5 +223,7 @@ BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_empty,T,::boost::detail::is_empty_impl::value #include +#undef BOOST_INTERNAL_IS_EMPTY + #endif // BOOST_TT_IS_EMPTY_HPP_INCLUDED diff --git a/include/boost/type_traits/is_pod.hpp b/include/boost/type_traits/is_pod.hpp index af2c3c4..355218f 100644 --- a/include/boost/type_traits/is_pod.hpp +++ b/include/boost/type_traits/is_pod.hpp @@ -20,6 +20,12 @@ // should be the last #include #include +#ifndef BOOST_IS_POD +#define BOOST_INTERNAL_IS_POD(T) false +#else +#define BOOST_INTERNAL_IS_POD(T) BOOST_IS_POD(T) +#endif + namespace boost { // forward declaration, needed by 'is_pod_array_helper' template below @@ -36,7 +42,7 @@ template struct is_pod_impl (::boost::type_traits::ice_or< ::boost::is_scalar::value, ::boost::is_void::value, - BOOST_IS_POD(T) + BOOST_INTERNAL_IS_POD(T) >::value)); }; @@ -60,7 +66,7 @@ struct is_pod_helper (::boost::type_traits::ice_or< ::boost::is_scalar::value, ::boost::is_void::value, - BOOST_IS_POD(T) + BOOST_INTERNAL_IS_POD(T) >::value)); }; }; @@ -132,4 +138,6 @@ BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pod,T,::boost::detail::is_pod_impl::value) #include +#undef BOOST_INTERNAL_IS_POD + #endif // BOOST_TT_IS_POD_HPP_INCLUDED diff --git a/include/boost/type_traits/is_union.hpp b/include/boost/type_traits/is_union.hpp index 25bddcc..610f162 100644 --- a/include/boost/type_traits/is_union.hpp +++ b/include/boost/type_traits/is_union.hpp @@ -25,7 +25,11 @@ namespace detail { template struct is_union_impl { typedef typename remove_cv::type cvt; +#ifdef BOOST_IS_UNION BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(cvt)); +#else + BOOST_STATIC_CONSTANT(bool, value = false); +#endif }; #else // @@ -35,7 +39,11 @@ template struct is_union_impl // template struct is_union_impl { +#ifdef BOOST_IS_UNION BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(T)); +#else + BOOST_STATIC_CONSTANT(bool, value = false); +#endif }; #endif } // namespace detail diff --git a/test/has_nothrow_assign_test.cpp b/test/has_nothrow_assign_test.cpp index a007396..1bcf3ac 100644 --- a/test/has_nothrow_assign_test.cpp +++ b/test/has_nothrow_assign_test.cpp @@ -193,7 +193,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); // cases we would like to succeed but can't implement in the language: BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true, false); diff --git a/test/has_nothrow_constr_test.cpp b/test/has_nothrow_constr_test.cpp index ad60226..94bce1e 100644 --- a/test/has_nothrow_constr_test.cpp +++ b/test/has_nothrow_constr_test.cpp @@ -151,7 +151,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, t BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); // cases we would like to succeed but can't implement in the language: BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true, false); diff --git a/test/has_nothrow_copy_test.cpp b/test/has_nothrow_copy_test.cpp index 216168a..8b993f9 100644 --- a/test/has_nothrow_copy_test.cpp +++ b/test/has_nothrow_copy_test.cpp @@ -189,7 +189,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); // cases we would like to succeed but can't implement in the language: BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true, false); diff --git a/test/has_trivial_assign_test.cpp b/test/has_trivial_assign_test.cpp index 44254c5..39b1716 100644 --- a/test/has_trivial_assign_test.cpp +++ b/test/has_trivial_assign_test.cpp @@ -185,7 +185,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); // cases we would like to succeed but can't implement in the language: BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true, false); diff --git a/test/has_trivial_copy_test.cpp b/test/has_trivial_copy_test.cpp index 43e3fad..85e9d0d 100644 --- a/test/has_trivial_copy_test.cpp +++ b/test/has_trivial_copy_test.cpp @@ -185,7 +185,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); // cases we would like to succeed but can't implement in the language: BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true, false); diff --git a/test/has_trivial_destructor_test.cpp b/test/has_trivial_destructor_test.cpp index 98db25d..a2f1632 100644 --- a/test/has_trivial_destructor_test.cpp +++ b/test/has_trivial_destructor_test.cpp @@ -154,7 +154,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, tr BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); // cases we would like to succeed but can't implement in the language: BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true, false); diff --git a/test/is_convertible_test.cpp b/test/is_convertible_test.cpp index e3c2a2d..4a82267 100644 --- a/test/is_convertible_test.cpp +++ b/test/is_convertible_test.cpp @@ -24,7 +24,7 @@ struct base2 { }; struct middle2 : public virtual base2 { }; struct derived2 : public middle2 { }; -#ifndef BOOST_NO_RVALUE_REFERENCES +#if !defined(BOOST_NO_RVALUE_REFERENCES) template struct test_bug_4530