diff --git a/doc/html/boost_typetraits/background.html b/doc/html/boost_typetraits/background.html index b18d244..1f0eb6e 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?

@@ -280,7 +280,7 @@

-

Table 1.1. Time taken to copy 1000 elements using `copy<const +

Table 1.1. Time taken to copy 1000 elements using `copy<const T*, T*>` (times in micro-seconds)

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

- + Pair of References

@@ -416,7 +416,7 @@ to hold non-reference types, references, and constant references:

-

Table 1.2. Required Constructor Argument Types

+

Table 1.2. Required Constructor Argument Types

@@ -481,7 +481,7 @@ adds a reference to its type, unless it is already a reference.

-

Table 1.3. Using add_reference to synthesize the correct constructor +

Table 1.3. Using add_reference to synthesize the correct constructor type

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

- + Conclusion

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

- + Acknowledgements

@@ -619,7 +619,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 9da2050..a9a7c1e 100644 --- a/doc/html/boost_typetraits/category/transform.html +++ b/doc/html/boost_typetraits/category/transform.html @@ -91,7 +91,7 @@ struct remove_volatile;
    - + Broken Compiler Workarounds:
    diff --git a/doc/html/boost_typetraits/intrinsics.html b/doc/html/boost_typetraits/intrinsics.html index ccbf12e..98a73a6 100644 --- a/doc/html/boost_typetraits/intrinsics.html +++ b/doc/html/boost_typetraits/intrinsics.html @@ -71,7 +71,7 @@ of the following macros:

    -

    Table 1.4. Macros for Compiler Intrinsics

    +

    Table 1.4. Macros for Compiler Intrinsics

diff --git a/doc/html/boost_typetraits/reference/add_const.html b/doc/html/boost_typetraits/reference/add_const.html index c14f17f..22324bd 100644 --- a/doc/html/boost_typetraits/reference/add_const.html +++ b/doc/html/boost_typetraits/reference/add_const.html @@ -53,7 +53,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.5. Examples

+

Table 1.5. Examples

diff --git a/doc/html/boost_typetraits/reference/add_cv.html b/doc/html/boost_typetraits/reference/add_cv.html index e9312c7..3d36153 100644 --- a/doc/html/boost_typetraits/reference/add_cv.html +++ b/doc/html/boost_typetraits/reference/add_cv.html @@ -54,7 +54,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.6. Examples

+

Table 1.6. Examples

diff --git a/doc/html/boost_typetraits/reference/add_pointer.html b/doc/html/boost_typetraits/reference/add_pointer.html index c8e7569..b698519 100644 --- a/doc/html/boost_typetraits/reference/add_pointer.html +++ b/doc/html/boost_typetraits/reference/add_pointer.html @@ -56,7 +56,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.7. Examples

+

Table 1.7. Examples

diff --git a/doc/html/boost_typetraits/reference/add_reference.html b/doc/html/boost_typetraits/reference/add_reference.html index 39e4c2c..d874196 100644 --- a/doc/html/boost_typetraits/reference/add_reference.html +++ b/doc/html/boost_typetraits/reference/add_reference.html @@ -53,7 +53,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.8. Examples

+

Table 1.8. Examples

diff --git a/doc/html/boost_typetraits/reference/add_volatile.html b/doc/html/boost_typetraits/reference/add_volatile.html index 20062c0..1aadef8 100644 --- a/doc/html/boost_typetraits/reference/add_volatile.html +++ b/doc/html/boost_typetraits/reference/add_volatile.html @@ -53,7 +53,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.9. Examples

+

Table 1.9. Examples

diff --git a/doc/html/boost_typetraits/reference/decay.html b/doc/html/boost_typetraits/reference/decay.html index 6e4af7b..f9903a3 100644 --- a/doc/html/boost_typetraits/reference/decay.html +++ b/doc/html/boost_typetraits/reference/decay.html @@ -48,7 +48,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.10. Examples

+

Table 1.10. Examples

diff --git a/doc/html/boost_typetraits/reference/floating_point_promotion.html b/doc/html/boost_typetraits/reference/floating_point_promotion.html index d63eadd..801049b 100644 --- a/doc/html/boost_typetraits/reference/floating_point_promotion.html +++ b/doc/html/boost_typetraits/reference/floating_point_promotion.html @@ -49,7 +49,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.11. Examples

+

Table 1.11. Examples

diff --git a/doc/html/boost_typetraits/reference/function_traits.html b/doc/html/boost_typetraits/reference/function_traits.html index 9bf4a8a..b757c15 100644 --- a/doc/html/boost_typetraits/reference/function_traits.html +++ b/doc/html/boost_typetraits/reference/function_traits.html @@ -59,7 +59,7 @@

-

Table 1.12. Function Traits Members

+

Table 1.12. Function Traits Members

@@ -122,7 +122,7 @@

-

Table 1.13. Examples

+

Table 1.13. Examples

diff --git a/doc/html/boost_typetraits/reference/integral_promotion.html b/doc/html/boost_typetraits/reference/integral_promotion.html index 79b92c1..d833cb3 100644 --- a/doc/html/boost_typetraits/reference/integral_promotion.html +++ b/doc/html/boost_typetraits/reference/integral_promotion.html @@ -49,7 +49,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.14. Examples

+

Table 1.14. Examples

diff --git a/doc/html/boost_typetraits/reference/is_base_of.html b/doc/html/boost_typetraits/reference/is_base_of.html index 04365c1..bfc9b36 100644 --- a/doc/html/boost_typetraits/reference/is_base_of.html +++ b/doc/html/boost_typetraits/reference/is_base_of.html @@ -132,7 +132,7 @@

- is_base_of<T>::value_type is the type bool. + is_base_of<T, T>::value_type is the type bool.

diff --git a/doc/html/boost_typetraits/reference/is_convertible.html b/doc/html/boost_typetraits/reference/is_convertible.html index a338426..20e1af7 100644 --- a/doc/html/boost_typetraits/reference/is_convertible.html +++ b/doc/html/boost_typetraits/reference/is_convertible.html @@ -139,7 +139,7 @@

- is_convertible<int>::value is an integral constant expression + is_convertible<int, int>::value is an integral constant expression that evaluates to false.

@@ -149,7 +149,7 @@

- is_convertible<T>::value_type is the type bool. + is_convertible<T, T>::value_type is the type bool.

diff --git a/doc/html/boost_typetraits/reference/is_same.html b/doc/html/boost_typetraits/reference/is_same.html index db5f67c..f9a07ab 100644 --- a/doc/html/boost_typetraits/reference/is_same.html +++ b/doc/html/boost_typetraits/reference/is_same.html @@ -100,7 +100,7 @@

- is_same<T>::value_type is the type bool. + is_same<T, T>::value_type is the type bool.

diff --git a/doc/html/boost_typetraits/reference/make_signed.html b/doc/html/boost_typetraits/reference/make_signed.html index c4ef33f..0e68aec 100644 --- a/doc/html/boost_typetraits/reference/make_signed.html +++ b/doc/html/boost_typetraits/reference/make_signed.html @@ -54,7 +54,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.15. Examples

+

Table 1.15. Examples

diff --git a/doc/html/boost_typetraits/reference/make_unsigned.html b/doc/html/boost_typetraits/reference/make_unsigned.html index 452ad8f..084d2d2 100644 --- a/doc/html/boost_typetraits/reference/make_unsigned.html +++ b/doc/html/boost_typetraits/reference/make_unsigned.html @@ -54,7 +54,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.16. Examples

+

Table 1.16. Examples

diff --git a/doc/html/boost_typetraits/reference/promote.html b/doc/html/boost_typetraits/reference/promote.html index 7498f31..68e4296 100644 --- a/doc/html/boost_typetraits/reference/promote.html +++ b/doc/html/boost_typetraits/reference/promote.html @@ -51,7 +51,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.17. Examples

+

Table 1.17. Examples

diff --git a/doc/html/boost_typetraits/reference/remove_all_extents.html b/doc/html/boost_typetraits/reference/remove_all_extents.html index 4e67ce9..4019639 100644 --- a/doc/html/boost_typetraits/reference/remove_all_extents.html +++ b/doc/html/boost_typetraits/reference/remove_all_extents.html @@ -54,7 +54,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.18. Examples

+

Table 1.18. Examples

diff --git a/doc/html/boost_typetraits/reference/remove_const.html b/doc/html/boost_typetraits/reference/remove_const.html index b10ae71..d08dd61 100644 --- a/doc/html/boost_typetraits/reference/remove_const.html +++ b/doc/html/boost_typetraits/reference/remove_const.html @@ -53,7 +53,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.19. Examples

+

Table 1.19. Examples

diff --git a/doc/html/boost_typetraits/reference/remove_cv.html b/doc/html/boost_typetraits/reference/remove_cv.html index 7aad042..cb409f5 100644 --- a/doc/html/boost_typetraits/reference/remove_cv.html +++ b/doc/html/boost_typetraits/reference/remove_cv.html @@ -53,7 +53,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.20. Examples

+

Table 1.20. Examples

diff --git a/doc/html/boost_typetraits/reference/remove_extent.html b/doc/html/boost_typetraits/reference/remove_extent.html index c7262c1..a0b8868 100644 --- a/doc/html/boost_typetraits/reference/remove_extent.html +++ b/doc/html/boost_typetraits/reference/remove_extent.html @@ -54,7 +54,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.21. Examples

+

Table 1.21. Examples

diff --git a/doc/html/boost_typetraits/reference/remove_pointer.html b/doc/html/boost_typetraits/reference/remove_pointer.html index c761454..2284b2d 100644 --- a/doc/html/boost_typetraits/reference/remove_pointer.html +++ b/doc/html/boost_typetraits/reference/remove_pointer.html @@ -53,7 +53,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.22. Examples

+

Table 1.22. Examples

diff --git a/doc/html/boost_typetraits/reference/remove_reference.html b/doc/html/boost_typetraits/reference/remove_reference.html index 9da586a..d46ee67 100644 --- a/doc/html/boost_typetraits/reference/remove_reference.html +++ b/doc/html/boost_typetraits/reference/remove_reference.html @@ -53,7 +53,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.23. Examples

+

Table 1.23. Examples

diff --git a/doc/html/boost_typetraits/reference/remove_volatile.html b/doc/html/boost_typetraits/reference/remove_volatile.html index b154050..7bfc1f5 100644 --- a/doc/html/boost_typetraits/reference/remove_volatile.html +++ b/doc/html/boost_typetraits/reference/remove_volatile.html @@ -53,7 +53,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.24. Examples

+

Table 1.24. Examples

diff --git a/doc/html/index.html b/doc/html/index.html index 41a96b4..073bb83 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)

@@ -163,7 +163,7 @@

- +

Last revised: February 21, 2008 at 13:51:18 +0000

Last revised: March 30, 2009 at 18:02:46 +0100


diff --git a/doc/is_base_of.qbk b/doc/is_base_of.qbk index a5a4283..7347182 100644 --- a/doc/is_base_of.qbk +++ b/doc/is_base_of.qbk @@ -48,7 +48,8 @@ expression that evaluates to /true/.] [:`is_base_of::value` is an integral constant expression that evaluates to /true/: a class is regarded as it's own base.] -[:`is_base_of::value_type` is the type `bool`.] +[:`is_base_of::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_convertible.qbk b/doc/is_convertible.qbk index dc94573..d87fccc 100644 --- a/doc/is_convertible.qbk +++ b/doc/is_convertible.qbk @@ -57,10 +57,11 @@ expression that evaluates to /false/: the conversion would require a `const_cast [:`is_convertible::value` is an integral constant expression that evaluates to /true/.] -[:`is_convertible::value` is an integral constant +[:`is_convertible::value` is an integral constant expression that evaluates to /false/.] -[:`is_convertible::value_type` is the type `bool`.] +[:`is_convertible::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_same.qbk b/doc/is_same.qbk index 2ed48b2..d054988 100644 --- a/doc/is_same.qbk +++ b/doc/is_same.qbk @@ -32,7 +32,8 @@ expression that evaluates to /false/.] [:`is_same::value` is an integral constant expression that evaluates to /false/.] -[:`is_same::value_type` is the type `bool`.] +[:`is_same::value_type` is the type `bool`.] [endsect] + diff --git a/test/aligned_storage_empy_test.cpp b/test/aligned_storage_empy_test.cpp new file mode 100644 index 0000000..6772cc0 --- /dev/null +++ b/test/aligned_storage_empy_test.cpp @@ -0,0 +1,125 @@ + +// (C) Copyright Thorsten Ottosen 2009. +// Use, modification and distribution are subject to 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) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +# include // max_align and long_long_type +#else +# include +# include +# include +#endif + + +namespace +{ + template< unsigned N, unsigned Alignment > + struct alignment_implementation1 + { + boost::detail::aligned_storage::aligned_storage_imp type; + const void* address() const { return this; } + }; + + template< unsigned N, unsigned Alignment > + struct alignment_implementation2 : +#ifndef __BORLANDC__ + private +#else + public +#endif + boost::detail::aligned_storage::aligned_storage_imp + { + typedef boost::detail::aligned_storage::aligned_storage_imp type; + const void* address() const { return static_cast(this)->address(); } + }; + + template< unsigned N, class T > + const void* get_address1() + { + alignment_implementation1::value> imp1; + return imp1.address(); + } + + template< unsigned N, class T > + const void* get_address2() + { + alignment_implementation2::value> imp2; + return imp2.address(); + } + + template< class T > + void check() + { + const void* addr1 = get_address1<0,T>(); + const void* addr2 = get_address2<0,T>(); + // + // @remark: only the empty case differs + // + BOOST_CHECK( addr1 != addr2 ); + + addr1 = get_address1<1,T>(); + addr2 = get_address2<1,T>(); + BOOST_CHECK( addr1 == addr2 ); + + addr1 = get_address1<2,T>(); + addr2 = get_address2<2,T>(); + BOOST_CHECK( addr1 == addr2 ); + + addr1 = get_address1<3,T>(); + addr2 = get_address2<3,T>(); + BOOST_CHECK( addr1 == addr2 ); + + addr1 = get_address1<4,T>(); + addr2 = get_address2<4,T>(); + BOOST_CHECK( addr1 == addr2 ); + + addr1 = get_address1<17,T>(); + addr2 = get_address2<17,T>(); + BOOST_CHECK( addr1 == addr2 ); + + addr1 = get_address1<32,T>(); + addr2 = get_address2<32,T>(); + BOOST_CHECK( addr1 == addr2 ); + } +} + +TT_TEST_BEGIN(type_with_empty_alignment_buffer) + +check(); +check(); +check(); +check(); +check(); +check(); +check(); + +#ifdef BOOST_HAS_MS_INT64 +check<__int64>(); +#endif + +check(); +check(); +check(); +check(); +check(); +check(); +check(); +check(); +check(); +check(); + +TT_TEST_END + + + + + + + + + diff --git a/test/aligned_storage_test.cpp b/test/aligned_storage_test.cpp index e15cf9f..9f531ee 100644 --- a/test/aligned_storage_test.cpp +++ b/test/aligned_storage_test.cpp @@ -66,6 +66,9 @@ void check(const T&) #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION BOOST_CHECK(::tt::is_pod::value == true); #endif + BOOST_CHECK(as3.address() == &as3); + const t3 as4 = { 0, }; + BOOST_CHECK(as4.address() == static_cast(&as4)); #endif } diff --git a/test/promote_enum_msvc_bug_test.cpp b/test/promote_enum_msvc_bug_test.cpp new file mode 100644 index 0000000..4d34bc0 --- /dev/null +++ b/test/promote_enum_msvc_bug_test.cpp @@ -0,0 +1,39 @@ +// Copyright 2009 Alexander Nasonov. +// 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) + +// Test bug 99776 'enum UIntEnum { value = UINT_MAX } is promoted to int' +// http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=22b0a6b7-120f-4ca0-9136-fa1b25b26efe +// +// Intel 9.0.028 for Windows has a similar problem: +// https://premier.intel.com/IssueDetail.aspx?IssueID=365073 + +#include + +#include +#include +#include + +#include "promote_util.hpp" + + +enum UIntEnum { UIntEnum_max = UINT_MAX }; + +template +void assert_is_uint(T) +{ + BOOST_STATIC_ASSERT((boost::is_same::value)); +} + +void test_promote_to_uint() +{ + assert_is_uint(+UIntEnum_max); + test_cv< UIntEnum, unsigned int >(); +} + +int main() +{ + return 0; +} +