From aba9d9e93dcc9009b5e6399f0320a73396859558 Mon Sep 17 00:00:00 2001 From: Peder Holt Date: Sun, 26 Mar 2006 10:15:27 +0000 Subject: [PATCH 01/56] Implemented full support for remove_xxx on VC6.5 and VC7.0. Based on the typeof hack also used by the boost::typeof library. [SVN r33476] --- .../type_traits/msvc/remove_all_extents.hpp | 47 +++++ .../boost/type_traits/msvc/remove_bounds.hpp | 43 ++++ .../boost/type_traits/msvc/remove_const.hpp | 143 +++++++++++++ include/boost/type_traits/msvc/remove_cv.hpp | 190 ++++++++++++++++++ .../boost/type_traits/msvc/remove_extent.hpp | 43 ++++ .../boost/type_traits/msvc/remove_pointer.hpp | 42 ++++ .../type_traits/msvc/remove_reference.hpp | 42 ++++ .../type_traits/msvc/remove_volatile.hpp | 143 +++++++++++++ include/boost/type_traits/msvc/typeof.hpp | 50 +++++ .../boost/type_traits/remove_all_extents.hpp | 9 + include/boost/type_traits/remove_bounds.hpp | 9 + include/boost/type_traits/remove_const.hpp | 7 +- include/boost/type_traits/remove_cv.hpp | 7 +- include/boost/type_traits/remove_extent.hpp | 9 + include/boost/type_traits/remove_pointer.hpp | 7 +- .../boost/type_traits/remove_reference.hpp | 7 +- include/boost/type_traits/remove_volatile.hpp | 7 +- 17 files changed, 800 insertions(+), 5 deletions(-) create mode 100644 include/boost/type_traits/msvc/remove_all_extents.hpp create mode 100644 include/boost/type_traits/msvc/remove_bounds.hpp create mode 100644 include/boost/type_traits/msvc/remove_const.hpp create mode 100644 include/boost/type_traits/msvc/remove_cv.hpp create mode 100644 include/boost/type_traits/msvc/remove_extent.hpp create mode 100644 include/boost/type_traits/msvc/remove_pointer.hpp create mode 100644 include/boost/type_traits/msvc/remove_reference.hpp create mode 100644 include/boost/type_traits/msvc/remove_volatile.hpp create mode 100644 include/boost/type_traits/msvc/typeof.hpp diff --git a/include/boost/type_traits/msvc/remove_all_extents.hpp b/include/boost/type_traits/msvc/remove_all_extents.hpp new file mode 100644 index 0000000..b5424a6 --- /dev/null +++ b/include/boost/type_traits/msvc/remove_all_extents.hpp @@ -0,0 +1,47 @@ +// Copyright (C) 2004 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPE_TRAITS_MSVC_REMOVE_EXTENT_HOLT_2004_0827 +#define BOOST_TYPE_TRAITS_MSVC_REMOVE_EXTENT_HOLT_2004_0827 + +#include +#include + +namespace boost { + template + struct remove_all_extents; + + namespace detail { + template + struct remove_all_extents_impl_typeof { + template + struct inner { + typedef T type; + }; + }; + template<> + struct remove_all_extents_impl_typeof { + template + struct inner { + template + static msvc_register_type test(U[]); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( *((T*)NULL) ) )); + typedef typename msvc_extract_type::id2type::type reduced_type; + typedef typename remove_all_extents::type type; + }; + }; + } //namespace detail + + template + struct remove_all_extents { + typedef typename detail::remove_all_extents_impl_typeof< + boost::is_array::value + >::template inner >::type type; + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_all_extents,T) + }; +} //namespace boost + +#endif //BOOST_TYPE_TRAITS_MSVC_REMOVE_BOUNDS_HOLT_2004_0827 + diff --git a/include/boost/type_traits/msvc/remove_bounds.hpp b/include/boost/type_traits/msvc/remove_bounds.hpp new file mode 100644 index 0000000..12a9b05 --- /dev/null +++ b/include/boost/type_traits/msvc/remove_bounds.hpp @@ -0,0 +1,43 @@ +// Copyright (C) 2004 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPE_TRAITS_MSVC_REMOVE_BOUNDS_HOLT_2004_0827 +#define BOOST_TYPE_TRAITS_MSVC_REMOVE_BOUNDS_HOLT_2004_0827 + +#include +#include + +namespace boost { + namespace detail { + template + struct remove_bounds_impl_typeof { + template + struct inner { + typedef T type; + }; + }; + template<> + struct remove_bounds_impl_typeof { + template + struct inner { + template + static msvc_register_type test(U[]); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( *((T*)NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + }; + } //namespace detail + + template + struct remove_bounds { + typedef typename detail::remove_bounds_impl_typeof< + boost::is_array::value + >::template inner >::type type; + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_bounds,T) + }; +} //namespace boost + +#endif //BOOST_TYPE_TRAITS_MSVC_REMOVE_BOUNDS_HOLT_2004_0827 + diff --git a/include/boost/type_traits/msvc/remove_const.hpp b/include/boost/type_traits/msvc/remove_const.hpp new file mode 100644 index 0000000..5395e80 --- /dev/null +++ b/include/boost/type_traits/msvc/remove_const.hpp @@ -0,0 +1,143 @@ +// Copyright (C) 2004 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPE_TRAITS_MSVC_REMOVE_CONST_HOLT_2004_0828 +#define BOOST_TYPE_TRAITS_MSVC_REMOVE_CONST_HOLT_2004_0828 + +#include +#include +#include +#include +#include + +namespace boost { + namespace detail { + template + struct remove_const_impl_typeof { + template + struct inner { + typedef T type; + }; + template + struct transform_type { + typedef T type; + }; + }; + template<> //Const + struct remove_const_impl_typeof { + template + struct inner { + template + static msvc_register_type test(U const&(*)()); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (T(*)())(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T& type; + }; + }; + template<> //CV + struct remove_const_impl_typeof { + template + struct inner { + template + static msvc_register_type test(U const volatile&(*)()); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (T(*)())(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T& type; + }; + }; + template<> //Const Pointer + struct remove_const_impl_typeof { + template + struct inner { + template + static msvc_register_type test(void(*)(U const[])); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T type[]; + }; + }; + template<> //CV Pointer + struct remove_const_impl_typeof { + template + struct inner { + template + static msvc_register_type test(void(*)(U const volatile[])); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T type[]; + }; + }; + template<> //Const Array + struct remove_const_impl_typeof { + template + struct inner { + BOOST_STATIC_CONSTANT(unsigned,value=(sizeof(T)/sizeof((*((T*)NULL))[0]))); + + template + static msvc_register_type test(void(*)(U const[])); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T type; + }; + }; + + template<> //CV Array + struct remove_const_impl_typeof { + template + struct inner { + BOOST_STATIC_CONSTANT(unsigned,value=(sizeof(T)/sizeof((*((T*)NULL))[0]))); + + template + static msvc_register_type test(void(*)(U const volatile[])); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T type; + }; + }; + + } //namespace detail + + template + struct remove_const { + typedef detail::remove_const_impl_typeof< + boost::is_pointer::value, + boost::is_array::value, + boost::is_const::value, + boost::is_volatile::value + > remove_const_type; + typedef typename + remove_const_type::template inner< + typename remove_const_type::template transform_type::type, + remove_const + >::type + type; + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_const,T) + }; +}//namespace boost + +#endif //BOOST_TYPE_TRAITS_MSVC_REMOVE_CONST_HOLT_2004_0828 diff --git a/include/boost/type_traits/msvc/remove_cv.hpp b/include/boost/type_traits/msvc/remove_cv.hpp new file mode 100644 index 0000000..c7b0379 --- /dev/null +++ b/include/boost/type_traits/msvc/remove_cv.hpp @@ -0,0 +1,190 @@ +// Copyright (C) 2004 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPE_TRAITS_MSVC_REMOVE_CV_HOLT_2004_0901 +#define BOOST_TYPE_TRAITS_MSVC_REMOVE_CV_HOLT_2004_0901 + +#include +#include +#include +#include +#include + +namespace boost { + namespace detail { + template + struct remove_cv_impl_typeof { + template + struct inner { + typedef T type; + }; + template + struct transform_type { + typedef T type; + }; + }; + template<> //Volatile + struct remove_cv_impl_typeof { + template + struct inner { + template + static msvc_register_type test(U volatile&(*)()); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (T(*)())(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T& type; + }; + }; + template<> //Const + struct remove_cv_impl_typeof { + template + struct inner { + template + static msvc_register_type test(U const&(*)()); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (T(*)())(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T& type; + }; + }; + template<> //CV + struct remove_cv_impl_typeof { + template + struct inner { + template + static msvc_register_type test(U const volatile&(*)()); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (T(*)())(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T& type; + }; + }; + template<> //Volatile Pointer + struct remove_cv_impl_typeof { + template + struct inner { + template + static msvc_register_type test(void(*)(U volatile[])); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T type[]; + }; + }; + template<> //Const Pointer + struct remove_cv_impl_typeof { + template + struct inner { + template + static msvc_register_type test(void(*)(U const[])); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T type[]; + }; + }; + template<> //CV Pointer + struct remove_cv_impl_typeof { + template + struct inner { + template + static msvc_register_type test(void(*)(U const volatile[])); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T type[]; + }; + }; + template<> //Volatile Array + struct remove_cv_impl_typeof { + template + struct inner { + BOOST_STATIC_CONSTANT(unsigned,value=(sizeof(T)/sizeof((*((T*)NULL))[0]))); + + template + static msvc_register_type test(void(*)(U volatile[])); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T type; + }; + }; + template<> //Const Array + struct remove_cv_impl_typeof { + template + struct inner { + BOOST_STATIC_CONSTANT(unsigned,value=(sizeof(T)/sizeof((*((T*)NULL))[0]))); + + template + static msvc_register_type test(void(*)(U const[])); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T type; + }; + }; + + template<> //CV Array + struct remove_cv_impl_typeof { + template + struct inner { + BOOST_STATIC_CONSTANT(unsigned,value=(sizeof(T)/sizeof((*((T*)NULL))[0]))); + + template + static msvc_register_type test(void(*)(U const volatile[])); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T type; + }; + }; + + } //namespace detail + + template + struct remove_cv { + typedef detail::remove_cv_impl_typeof< + boost::is_pointer::value, + boost::is_array::value, + boost::is_const::value, + boost::is_volatile::value + > remove_cv_type; + typedef typename + remove_cv_type::template inner< + typename remove_cv_type::template transform_type::type, + remove_cv + >::type + type; + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_cv,T) + }; +}//namespace boost + +#endif //BOOST_TYPE_TRAITS_MSVC_REMOVE_CV_HOLT_2004_0901 diff --git a/include/boost/type_traits/msvc/remove_extent.hpp b/include/boost/type_traits/msvc/remove_extent.hpp new file mode 100644 index 0000000..f87ec41 --- /dev/null +++ b/include/boost/type_traits/msvc/remove_extent.hpp @@ -0,0 +1,43 @@ +// Copyright (C) 2004 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPE_TRAITS_MSVC_REMOVE_EXTENT_HOLT_2004_0827 +#define BOOST_TYPE_TRAITS_MSVC_REMOVE_EXTENT_HOLT_2004_0827 + +#include +#include + +namespace boost { + namespace detail { + template + struct remove_extent_impl_typeof { + template + struct inner { + typedef T type; + }; + }; + template<> + struct remove_extent_impl_typeof { + template + struct inner { + template + static msvc_register_type test(U[]); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( *((T*)NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + }; + } //namespace detail + + template + struct remove_extent { + typedef typename detail::remove_extent_impl_typeof< + boost::is_array::value + >::template inner >::type type; + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_extent,T) + }; +} //namespace boost + +#endif //BOOST_TYPE_TRAITS_MSVC_REMOVE_BOUNDS_HOLT_2004_0827 + diff --git a/include/boost/type_traits/msvc/remove_pointer.hpp b/include/boost/type_traits/msvc/remove_pointer.hpp new file mode 100644 index 0000000..8b9b0d4 --- /dev/null +++ b/include/boost/type_traits/msvc/remove_pointer.hpp @@ -0,0 +1,42 @@ +// Copyright (C) 2004 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPE_TRAITS_MSVC_REMOVE_POINTER_HOLT_2004_0827 +#define BOOST_TYPE_TRAITS_MSVC_REMOVE_POINTER_HOLT_2004_0827 + +#include +#include + +namespace boost { + namespace detail { + template + struct remove_pointer_impl_typeof { + template + struct inner { + typedef T type; + }; + }; + template<> + struct remove_pointer_impl_typeof { + template + struct inner { + template + static msvc_register_type test(U*); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( *((T*)NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + }; + } //namespace detail + + template + struct remove_pointer { + typedef typename detail::remove_pointer_impl_typeof< + boost::is_pointer::value + >::template inner >::type type; + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_pointer,T) + }; +} //namespace boost + +#endif //BOOST_TYPE_TRAITS_REMOVE_POINTER_HOLT_2004_0827 diff --git a/include/boost/type_traits/msvc/remove_reference.hpp b/include/boost/type_traits/msvc/remove_reference.hpp new file mode 100644 index 0000000..367d352 --- /dev/null +++ b/include/boost/type_traits/msvc/remove_reference.hpp @@ -0,0 +1,42 @@ +// Copyright (C) 2004 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPE_TRAITS_MSVC_REMOVE_REFERENCE_HOLT_2004_0827 +#define BOOST_TYPE_TRAITS_MSVC_REMOVE_REFERENCE_HOLT_2004_0827 + +#include +#include + +namespace boost { + namespace detail { + template + struct remove_reference_impl_typeof { + template + struct inner { + typedef T type; + }; + }; + template<> + struct remove_reference_impl_typeof { + template + struct inner { + template + static msvc_register_type test(U&(*)()); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (T(*)())(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + }; + } //namespace detail + + template + struct remove_reference { + typedef typename detail::remove_reference_impl_typeof< + boost::is_reference::value + >::template inner >::type type; + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_reference,T) + }; +} //namespace boost + +#endif //BOOST_TYPE_TRAITS_MSVC_REMOVE_REFERENCE_HOLT_2004_0827 diff --git a/include/boost/type_traits/msvc/remove_volatile.hpp b/include/boost/type_traits/msvc/remove_volatile.hpp new file mode 100644 index 0000000..3759f2a --- /dev/null +++ b/include/boost/type_traits/msvc/remove_volatile.hpp @@ -0,0 +1,143 @@ +// Copyright (C) 2004 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPE_TRAITS_MSVC_REMOVE_VOLATILE_HOLT_2004_0828 +#define BOOST_TYPE_TRAITS_MSVC_REMOVE_VOLATILE_HOLT_2004_0828 + +#include +#include +#include +#include +#include + +namespace boost { + namespace detail { + template + struct remove_volatile_impl_typeof { + template + struct inner { + typedef T type; + }; + template + struct transform_type { + typedef T type; + }; + }; + template<> //Volatile + struct remove_volatile_impl_typeof { + template + struct inner { + template + static msvc_register_type test(U volatile&(*)()); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (T(*)())(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T& type; + }; + }; + template<> //CV + struct remove_volatile_impl_typeof { + template + struct inner { + template + static msvc_register_type test(U const volatile&(*)()); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (T(*)())(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T& type; + }; + }; + template<> //Volatile Pointer + struct remove_volatile_impl_typeof { + template + struct inner { + template + static msvc_register_type test(void(*)(U volatile[])); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T type[]; + }; + }; + template<> //CV Pointer + struct remove_volatile_impl_typeof { + template + struct inner { + template + static msvc_register_type test(void(*)(U const volatile[])); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T type[]; + }; + }; + template<> //Volatile Array + struct remove_volatile_impl_typeof { + template + struct inner { + BOOST_STATIC_CONSTANT(unsigned,value=(sizeof(T)/sizeof((*((T*)NULL))[0]))); + + template + static msvc_register_type test(void(*)(U volatile[])); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T type; + }; + }; + + template<> //CV Array + struct remove_volatile_impl_typeof { + template + struct inner { + BOOST_STATIC_CONSTANT(unsigned,value=(sizeof(T)/sizeof((*((T*)NULL))[0]))); + + template + static msvc_register_type test(void(*)(U const volatile[])); + static msvc_register_type test(...); + BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) )); + typedef typename msvc_extract_type::id2type::type type; + }; + template + struct transform_type { + typedef T type; + }; + }; + + } //namespace detail + + template + struct remove_volatile { + typedef detail::remove_volatile_impl_typeof< + boost::is_pointer::value, + boost::is_array::value, + boost::is_const::value, + boost::is_volatile::value + > remove_volatile_type; + typedef typename + remove_volatile_type::template inner< + typename remove_volatile_type::template transform_type::type, + remove_volatile + >::type + type; + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_volatile,T) + }; +}//namespace boost + +#endif //BOOST_TYPE_TRAITS_MSVC_REMOVE_VOLATILE_HOLT_2004_0828 diff --git a/include/boost/type_traits/msvc/typeof.hpp b/include/boost/type_traits/msvc/typeof.hpp new file mode 100644 index 0000000..ebb0e80 --- /dev/null +++ b/include/boost/type_traits/msvc/typeof.hpp @@ -0,0 +1,50 @@ +// Copyright (C) 2004 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPETRAITS_MSVC_TYPEOF_HPP +#define BOOST_TYPETRAITS_MSVC_TYPEOF_HPP + +#include +#include + +namespace boost { namespace detail { +# if BOOST_WORKAROUND(BOOST_MSVC,==1300) + template + struct msvc_extract_type + { + template + struct id2type_impl; + + typedef id2type_impl id2type; + }; + + template + struct msvc_register_type : msvc_extract_type + { + template<> + struct id2type_impl //VC7.0 specific bugfeature + { + typedef T type; + }; + }; +# else + template + struct msvc_extract_type + { + struct id2type; + }; + + template + struct msvc_register_type : msvc_extract_type + { + typedef msvc_extract_type base_type; + struct base_type::id2type // This uses nice VC6.5 and VC7.1 bugfeature + { + typedef T type; + }; + }; +# endif +}} + +#endif //BOOST_TYPETRAITS_MSVC_TYPEOF_IMPL_HPP diff --git a/include/boost/type_traits/remove_all_extents.hpp b/include/boost/type_traits/remove_all_extents.hpp index 16abdee..8ae18ee 100755 --- a/include/boost/type_traits/remove_all_extents.hpp +++ b/include/boost/type_traits/remove_all_extents.hpp @@ -11,10 +11,17 @@ #include #include +#include + +#if BOOST_WORKAROUND(BOOST_MSVC,<=1300) +#include +#endif // should be the last #include #include +#if !BOOST_WORKAROUND(BOOST_MSVC,<=1300) + namespace boost { BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_all_extents,T,T) @@ -34,6 +41,8 @@ BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_all_extents,T const vo } // namespace boost +#endif + #include #endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_bounds.hpp b/include/boost/type_traits/remove_bounds.hpp index 45ff02a..1d7b436 100644 --- a/include/boost/type_traits/remove_bounds.hpp +++ b/include/boost/type_traits/remove_bounds.hpp @@ -11,10 +11,17 @@ #include #include +#include + +#if BOOST_WORKAROUND(BOOST_MSVC,<=1300) +#include +#endif // should be the last #include #include +#if !BOOST_WORKAROUND(BOOST_MSVC,<=1300) + namespace boost { BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_bounds,T,T) @@ -34,6 +41,8 @@ BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_bounds,T const volatil } // namespace boost +#endif + #include #endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_const.hpp b/include/boost/type_traits/remove_const.hpp index 7637b42..45f8d6e 100644 --- a/include/boost/type_traits/remove_const.hpp +++ b/include/boost/type_traits/remove_const.hpp @@ -15,9 +15,14 @@ #include #include #include +#include #include +#if BOOST_WORKAROUND(BOOST_MSVC,<=1300) +#include +#endif + // should be the last #include #include @@ -60,7 +65,7 @@ BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_const,T BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_const,T const volatile[N],T volatile type[N]) #endif -#else +#elif !BOOST_WORKAROUND(BOOST_MSVC,<=1300) BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_const,T,typename detail::remove_const_impl::type) diff --git a/include/boost/type_traits/remove_cv.hpp b/include/boost/type_traits/remove_cv.hpp index 689b1f1..09f8ff1 100644 --- a/include/boost/type_traits/remove_cv.hpp +++ b/include/boost/type_traits/remove_cv.hpp @@ -14,9 +14,14 @@ #include #include #include +#include #include +#if BOOST_WORKAROUND(BOOST_MSVC,<=1300) +#include +#endif + // should be the last #include #include @@ -33,7 +38,7 @@ BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_cv,T vol BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_cv,T const volatile[N],T type[N]) #endif -#else +#elif !BOOST_WORKAROUND(BOOST_MSVC,<=1300) namespace detail { template diff --git a/include/boost/type_traits/remove_extent.hpp b/include/boost/type_traits/remove_extent.hpp index 979edb6..32dee6f 100755 --- a/include/boost/type_traits/remove_extent.hpp +++ b/include/boost/type_traits/remove_extent.hpp @@ -10,11 +10,18 @@ #define BOOST_TT_REMOVE_EXTENT_HPP_INCLUDED #include +#include #include +#if BOOST_WORKAROUND(BOOST_MSVC,<=1300) +#include +#endif + // should be the last #include #include +#if !BOOST_WORKAROUND(BOOST_MSVC,<=1300) + namespace boost { BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_extent,T,T) @@ -34,6 +41,8 @@ BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_extent,T const volatil } // namespace boost +#endif + #include #endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_pointer.hpp b/include/boost/type_traits/remove_pointer.hpp index 69937e5..893be09 100644 --- a/include/boost/type_traits/remove_pointer.hpp +++ b/include/boost/type_traits/remove_pointer.hpp @@ -11,6 +11,11 @@ #include #include +#include + +#if BOOST_WORKAROUND(BOOST_MSVC,<=1300) +#include +#endif // should be the last #include #include @@ -25,7 +30,7 @@ BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_pointer,T* const,T) BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_pointer,T* volatile,T) BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_pointer,T* const volatile,T) -#else +#elif !BOOST_WORKAROUND(BOOST_MSVC,<=1300) BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_pointer,T,typename detail::remove_pointer_impl::type) diff --git a/include/boost/type_traits/remove_reference.hpp b/include/boost/type_traits/remove_reference.hpp index 43c0f81..27e9002 100644 --- a/include/boost/type_traits/remove_reference.hpp +++ b/include/boost/type_traits/remove_reference.hpp @@ -11,6 +11,11 @@ #include #include +#include + +#if BOOST_WORKAROUND(BOOST_MSVC,<=1300) +#include +#endif // should be the last #include #include @@ -32,7 +37,7 @@ BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T& volatile, BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T& const volatile,T) #endif -#else +#elif !BOOST_WORKAROUND(BOOST_MSVC,<=1300) BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_reference,T,typename detail::remove_reference_impl::type) diff --git a/include/boost/type_traits/remove_volatile.hpp b/include/boost/type_traits/remove_volatile.hpp index 71b6cc3..ec6b6c5 100644 --- a/include/boost/type_traits/remove_volatile.hpp +++ b/include/boost/type_traits/remove_volatile.hpp @@ -15,9 +15,14 @@ #include #include #include +#include #include +#if BOOST_WORKAROUND(BOOST_MSVC,<=1300) +#include +#endif + // should be the last #include #include @@ -59,7 +64,7 @@ BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_volatile BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_volatile,T const volatile[N],T const type[N]) #endif -#else +#elif !BOOST_WORKAROUND(BOOST_MSVC,<=1300) BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_volatile,T,typename detail::remove_volatile_impl::type) From d77497ffec7339ddd9f0d04e3534761fe3fc45b5 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 5 Apr 2006 12:24:17 +0000 Subject: [PATCH 02/56] Added checks for managed code and __fastcall. [SVN r33558] --- .../detail/is_function_ptr_tester.hpp | 54 +++++++++++++++ .../detail/is_mem_fun_pointer_tester.hpp | 65 +++++++++++++++++-- 2 files changed, 114 insertions(+), 5 deletions(-) diff --git a/include/boost/type_traits/detail/is_function_ptr_tester.hpp b/include/boost/type_traits/detail/is_function_ptr_tester.hpp index 80c0eb4..c1a3c6a 100644 --- a/include/boost/type_traits/detail/is_function_ptr_tester.hpp +++ b/include/boost/type_traits/detail/is_function_ptr_tester.hpp @@ -45,10 +45,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)()); template yes_type is_function_ptr_tester(R (__stdcall*)( ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)()); template yes_type is_function_ptr_tester(R (__fastcall*)( ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)()); template @@ -65,10 +67,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0)); template yes_type is_function_ptr_tester(R (__stdcall*)( T0 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0)); template @@ -85,10 +89,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1)); template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1)); template @@ -105,10 +111,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2)); template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2)); template @@ -125,10 +133,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3)); template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3)); template @@ -145,10 +155,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4)); template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4)); template @@ -165,10 +177,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 , T5 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4 , T5)); template @@ -185,10 +199,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4 , T5 , T6)); template @@ -205,10 +221,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7)); template @@ -225,10 +243,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8)); template @@ -245,10 +265,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9)); template @@ -265,10 +287,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10)); template @@ -285,10 +309,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11)); template @@ -305,10 +331,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12)); template @@ -325,10 +353,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13)); template @@ -345,10 +375,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14)); template @@ -365,10 +397,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15)); template @@ -385,10 +419,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16)); template @@ -405,10 +441,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17)); template @@ -425,10 +463,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18)); template @@ -445,10 +485,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19)); template @@ -465,10 +507,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20)); template @@ -485,10 +529,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21)); template @@ -505,10 +551,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22)); template @@ -525,10 +573,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23)); template @@ -545,10 +595,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 ...)); +#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24)); template yes_type is_function_ptr_tester(R (__fastcall*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 ...)); +#endif template yes_type is_function_ptr_tester(R (__cdecl*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24)); template @@ -586,10 +638,12 @@ template yes_type is_function_ptr_tester(R (__stdcall*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_COUNTER,T) ...)); +@#ifndef _MANAGED template yes_type is_function_ptr_tester(R (__fastcall*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_COUNTER,T))); template yes_type is_function_ptr_tester(R (__fastcall*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_COUNTER,T) ...)); +@#endif template yes_type is_function_ptr_tester(R (__cdecl*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_COUNTER,T))); template diff --git a/include/boost/type_traits/detail/is_mem_fun_pointer_tester.hpp b/include/boost/type_traits/detail/is_mem_fun_pointer_tester.hpp index 5f720bb..e6532d3 100644 --- a/include/boost/type_traits/detail/is_mem_fun_pointer_tester.hpp +++ b/include/boost/type_traits/detail/is_mem_fun_pointer_tester.hpp @@ -29,7 +29,8 @@ namespace type_traits { no_type BOOST_TT_DECL is_mem_fun_pointer_tester(...); #if !defined(BOOST_TT_PREPROCESSING_MODE) -// preprocessor-generated part, don't edit by hand! +// pre-processed code, don't edit, try GNU cpp with +// cpp -I../../../ -DBOOST_TT_PREPROCESSING_MODE -x c++ -P filename template yes_type is_mem_fun_pointer_tester(R (T::*const volatile*)()); @@ -81,6 +82,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( ...) volat template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)()); @@ -104,6 +106,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( ...) vola template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)()); @@ -179,6 +182,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 ...) vo template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0)); @@ -202,6 +206,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 ...) v template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0)); @@ -277,6 +282,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 .. template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1)); @@ -300,6 +306,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 . template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1)); @@ -375,6 +382,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2)); @@ -398,6 +406,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2)); @@ -473,6 +482,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3)); @@ -496,6 +506,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3)); @@ -571,6 +582,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4)); @@ -594,6 +606,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4)); @@ -669,6 +682,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5)); @@ -692,6 +706,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5)); @@ -767,6 +782,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6)); @@ -790,6 +806,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6)); @@ -865,6 +882,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7)); @@ -888,6 +906,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7)); @@ -963,6 +982,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8)); @@ -986,6 +1006,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8)); @@ -1061,6 +1082,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9)); @@ -1084,6 +1106,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9)); @@ -1159,6 +1182,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10)); @@ -1182,6 +1206,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10)); @@ -1257,6 +1282,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11)); @@ -1280,6 +1306,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11)); @@ -1355,6 +1382,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12)); @@ -1378,6 +1406,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12)); @@ -1453,6 +1482,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13)); @@ -1476,6 +1506,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13)); @@ -1551,6 +1582,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14)); @@ -1574,6 +1606,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14)); @@ -1649,6 +1682,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15)); @@ -1672,6 +1706,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15)); @@ -1747,6 +1782,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16)); @@ -1770,6 +1806,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16)); @@ -1845,6 +1882,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17)); @@ -1868,6 +1906,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17)); @@ -1943,6 +1982,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18)); @@ -1966,6 +2006,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18)); @@ -2041,6 +2082,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19)); @@ -2064,6 +2106,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19)); @@ -2139,6 +2182,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20)); @@ -2162,6 +2206,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20)); @@ -2237,6 +2282,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21)); @@ -2260,6 +2306,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21)); @@ -2335,6 +2382,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22)); @@ -2358,6 +2406,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22)); @@ -2433,6 +2482,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23)); @@ -2456,6 +2506,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23)); @@ -2531,6 +2582,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 ...) const volatile); +#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24)); @@ -2554,6 +2606,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 ...) const volatile); +#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)( T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24)); @@ -2613,7 +2666,7 @@ yes_type is_mem_fun_pointer_tester(R (T::*const volatile*)(BOOST_PP_ENUM_PARAMS( template yes_type is_mem_fun_pointer_tester(R (T::*const volatile*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_COUNTER,T)) const volatile); -#ifndef BOOST_TT_NO_ELLIPSIS_IN_FUNC_TESTING +@#ifndef BOOST_TT_NO_ELLIPSIS_IN_FUNC_TESTING template yes_type is_mem_fun_pointer_tester(R (T::*const volatile*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_COUNTER,T) ...)); @@ -2625,8 +2678,8 @@ yes_type is_mem_fun_pointer_tester(R (T::*const volatile*)(BOOST_PP_ENUM_PARAMS( template yes_type is_mem_fun_pointer_tester(R (T::*const volatile*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_COUNTER,T) ...) const volatile); -#endif -#ifdef BOOST_TT_TEST_MS_FUNC_SIGS // Other calling conventions used by MS compatible compilers: +@#endif +@#ifdef BOOST_TT_TEST_MS_FUNC_SIGS // Other calling conventions used by MS compatible compilers: template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_COUNTER,T))); @@ -2651,6 +2704,7 @@ yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)(BOOST_PP_EN template yes_type is_mem_fun_pointer_tester(R (__stdcall T::*const volatile*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_COUNTER,T) ...) const volatile); +@#ifndef _MANAGED template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_COUNTER,T))); @@ -2674,6 +2728,7 @@ yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)(BOOST_PP_E template yes_type is_mem_fun_pointer_tester(R (__fastcall T::*const volatile*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_COUNTER,T) ...) const volatile); +@#endif template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_COUNTER,T))); @@ -2698,7 +2753,7 @@ yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)(BOOST_PP_ENUM template yes_type is_mem_fun_pointer_tester(R (__cdecl T::*const volatile*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_COUNTER,T) ...) const volatile); -#endif +@#endif #undef BOOST_PP_COUNTER #endif // BOOST_PP_IS_ITERATING From 036f0593a087e1f1e2f4c2fbdab009c7f266581a Mon Sep 17 00:00:00 2001 From: John Maddock Date: Thu, 6 Apr 2006 16:28:47 +0000 Subject: [PATCH 03/56] Arrange things so that is_class and BOOST_NO_IS_ABSTRACT are in synch with one another. [SVN r33566] --- include/boost/type_traits/config.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/boost/type_traits/config.hpp b/include/boost/type_traits/config.hpp index af7ebb1..821bf60 100644 --- a/include/boost/type_traits/config.hpp +++ b/include/boost/type_traits/config.hpp @@ -26,7 +26,7 @@ # define BOOST_TT_DECL /**/ #endif -# if BOOST_WORKAROUND(__MWERKS__, < 0x3000) \ +# if (BOOST_WORKAROUND(__MWERKS__, < 0x3000) \ || BOOST_WORKAROUND(BOOST_MSVC, <= 1301) \ || !defined(__EDG_VERSION__) && BOOST_WORKAROUND(__GNUC__, < 3) \ || BOOST_WORKAROUND(__IBMCPP__, < 600 ) \ @@ -34,7 +34,8 @@ || defined(__ghs) \ || BOOST_WORKAROUND(__HP_aCC, BOOST_TESTED_AT(53800)) \ || BOOST_WORKAROUND(MPW_CPLUS, BOOST_TESTED_AT(0x890)) \ - || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580)) + || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))) \ + && defined(BOOST_NO_IS_ABSTRACT) # define BOOST_TT_NO_CONFORMING_IS_CLASS_IMPLEMENTATION 1 From 117eddb5c982e07b62e116dfdc3cc34343ec810a Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 15 Apr 2006 16:16:13 +0000 Subject: [PATCH 04/56] Fixed typo in extent [SVN r33704] --- doc/type_traits.qbk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/type_traits.qbk b/doc/type_traits.qbk index 08c7a87..00ddce2 100644 --- a/doc/type_traits.qbk +++ b/doc/type_traits.qbk @@ -1251,7 +1251,7 @@ __header ` #include ` or ` #include ` inherits from `__integral_constant`.] +[:`extent` inherits from `__integral_constant`.] [:`extent::type` is the type `__integral_constant`.] @@ -2853,3 +2853,4 @@ www.boost.org/more/mailing_lists.htm#main] for subscription details). [endsect] + From 0c7e439b85cc3bc75293febeba3fd0aed547fcba Mon Sep 17 00:00:00 2001 From: Alexander Nasonov Date: Sun, 16 Apr 2006 00:22:36 +0000 Subject: [PATCH 05/56] Initial version of the code and tests [SVN r33707] --- .../type_traits/floating_point_promotion.hpp | 61 ++++++ .../boost/type_traits/integral_promotion.hpp | 194 ++++++++++++++++++ include/boost/type_traits/promote.hpp | 40 ++++ test/promote_basic_test.cpp | 111 ++++++++++ test/promote_enum_test.cpp | 151 ++++++++++++++ test/promote_mpl_test.cpp | 47 +++++ test/promote_util.hpp | 37 ++++ 7 files changed, 641 insertions(+) create mode 100644 include/boost/type_traits/floating_point_promotion.hpp create mode 100644 include/boost/type_traits/integral_promotion.hpp create mode 100644 include/boost/type_traits/promote.hpp create mode 100755 test/promote_basic_test.cpp create mode 100755 test/promote_enum_test.cpp create mode 100755 test/promote_mpl_test.cpp create mode 100755 test/promote_util.hpp diff --git a/include/boost/type_traits/floating_point_promotion.hpp b/include/boost/type_traits/floating_point_promotion.hpp new file mode 100644 index 0000000..e6846f0 --- /dev/null +++ b/include/boost/type_traits/floating_point_promotion.hpp @@ -0,0 +1,61 @@ +// Copyright 2005 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) + +#ifndef FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED +#define FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED + +#include + +// Should be the last #include +#include + +namespace boost { + +namespace type_traits { namespace detail { + +template +struct floating_point_promotion +{ + typedef T type; +}; + +template<> +struct floating_point_promotion +{ + typedef double type; +}; + +template<> +struct floating_point_promotion +{ + typedef double const type; +}; + +template<> +struct floating_point_promotion +{ + typedef double volatile type; +}; + +template<> +struct floating_point_promotion +{ + typedef double const volatile type; +}; + +} } + +BOOST_TT_AUX_TYPE_TRAIT_DEF1( + floating_point_promotion + , T + , BOOST_DEDUCED_TYPENAME + ::boost::type_traits::detail::floating_point_promotion::type + ) +} + +#include + +#endif // #ifndef FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED + diff --git a/include/boost/type_traits/integral_promotion.hpp b/include/boost/type_traits/integral_promotion.hpp new file mode 100644 index 0000000..fa8f8eb --- /dev/null +++ b/include/boost/type_traits/integral_promotion.hpp @@ -0,0 +1,194 @@ +// Copyright 2005 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) + +#ifndef FILE_boost_type_traits_integral_promotion_hpp_INCLUDED +#define FILE_boost_type_traits_integral_promotion_hpp_INCLUDED + +#include + +#include +#include +#include +#include +#include + +// Should be the last #include +#include +#include + +namespace boost { + +namespace type_traits { namespace detail { + +// 4.5/2 +BOOST_TT_AUX_BOOL_TRAIT_DEF1(need_promotion, T, boost::is_enum::value) + +// 4.5/1 +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, char , true) +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, signed char , true) +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, unsigned char , true) +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, signed short int , true) +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, unsigned short int, true) + + +// Specializations for non-standard types. +// Type is promoted if it's smaller then int. + +#define BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(T) \ + BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, T, (sizeof(T) < sizeof(int))) + +// Same set of integral types as in boost/type_traits/is_integral.hpp. +// Please, keep in sync. +#if (defined(BOOST_MSVC) && (BOOST_MSVC < 1300)) \ + || (defined(BOOST_INTEL_CXX_VERSION) && defined(_MSC_VER) && (BOOST_INTEL_CXX_VERSION <= 600)) \ + || (defined(__BORLANDC__) && (__BORLANDC__ == 0x600) && (_MSC_VER < 1300)) +// TODO: common macro for this #if. Or better yet, PP SEQ of non-standard types. +BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(__int8 ) +BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(unsigned __int8 ) +BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(__int16 ) +BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(unsigned __int16) +BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(__int32 ) +BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(unsigned __int32) +#ifdef __BORLANDC__ +BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(unsigned __int64) +BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE( __int64) +#endif +#endif + +#if defined(BOOST_HAS_LONG_LONG) +BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(boost::ulong_long_type) +BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(boost::long_long_type ) +#elif defined(BOOST_HAS_MS_INT64) +BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(unsigned __int64) +BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE( __int64) +#endif + +#undef BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE + + +#ifndef BOOST_NO_INTRINSIC_WCHAR_T +// 4.5/2 +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, wchar_t, true) +#endif + +// 4.5/3 (integral bit-field) is not supported. + +// 4.5/4 +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, bool, true) + + +// Get promoted type by index and cv qualifiers. + +template struct promote_from_index; + +#define BOOST_TT_AUX_PROMOTE_FROM_INDEX(N,T) \ + template<> struct promote_from_index { typedef T type; }; \ + template<> struct promote_from_index { typedef T volatile type; }; \ + template<> struct promote_from_index { typedef T const type; }; \ + template<> struct promote_from_index { typedef T const volatile type; }; + + +BOOST_TT_AUX_PROMOTE_FROM_INDEX(1, int ) +BOOST_TT_AUX_PROMOTE_FROM_INDEX(2, unsigned int ) +BOOST_TT_AUX_PROMOTE_FROM_INDEX(3, long ) +BOOST_TT_AUX_PROMOTE_FROM_INDEX(4, unsigned long) + + +// WARNING: integral promotions to non-standard types +// long long and __int64 are not defined by the standard. +// Additional specialisations and overloads shouldn't +// introduce ambiguity, though. + +#if defined(BOOST_HAS_LONG_LONG) +BOOST_TT_AUX_PROMOTE_FROM_INDEX(5, boost::long_long_type ) +BOOST_TT_AUX_PROMOTE_FROM_INDEX(6, boost::ulong_long_type) +#elif defined(BOOST_HAS_MS_INT64) +BOOST_TT_AUX_PROMOTE_FROM_INDEX(7, __int64 ) +BOOST_TT_AUX_PROMOTE_FROM_INDEX(8, unsigned __int64) +#endif + +#undef BOOST_TT_AUX_PROMOTE_FROM_INDEX + + +// Define BOOST_TT_AUX_PROMOTED_INDEX_TESTER: +#if !defined(BOOST_MSVC) + +template +struct sized_type_for_promotion +{ + typedef char (&type)[N]; +}; + +#define BOOST_TT_AUX_PROMOTED_INDEX_TESTER(I,T) \ + sized_type_for_promotion::type promoted_index_tester(T); + +#else + +#define BOOST_TT_AUX_PROMOTED_INDEX_TESTER(I,T) \ + char (&promoted_index_tester(T))[I]; + +#endif + +BOOST_TT_AUX_PROMOTED_INDEX_TESTER(1, int ) +BOOST_TT_AUX_PROMOTED_INDEX_TESTER(2, unsigned int ) +BOOST_TT_AUX_PROMOTED_INDEX_TESTER(3, long ) +BOOST_TT_AUX_PROMOTED_INDEX_TESTER(4, unsigned long) + +#if defined(BOOST_HAS_LONG_LONG) +BOOST_TT_AUX_PROMOTED_INDEX_TESTER(5, boost::long_long_type ) +BOOST_TT_AUX_PROMOTED_INDEX_TESTER(6, boost::ulong_long_type) +#elif defined(BOOST_HAS_MS_INT64) +BOOST_TT_AUX_PROMOTED_INDEX_TESTER(7, __int64 ) +BOOST_TT_AUX_PROMOTED_INDEX_TESTER(8, unsigned __int64) +#endif + +#undef BOOST_TT_AUX_PROMOTED_INDEX_TESTER + + +// Get an index of promoted type for type T. +// Precondition: need_promotion +template +struct promoted_index +{ + static T testee; // undefined + BOOST_STATIC_CONSTANT(int, value = sizeof(promoted_index_tester(+testee)) ); + // Unary plus promotes testee LOOK HERE ---> ^ +}; + +template +struct integral_promotion_impl +{ + typedef BOOST_DEDUCED_TYPENAME promote_from_index< + (boost::type_traits::detail::promoted_index::value) + , (boost::is_const::value) + , (boost::is_volatile::value) + >::type type; +}; + +template +struct integral_promotion + : boost::mpl::eval_if< + need_promotion + , integral_promotion_impl + , boost::mpl::identity + > +{ +}; + +} } + +BOOST_TT_AUX_TYPE_TRAIT_DEF1( + integral_promotion + , T + , BOOST_DEDUCED_TYPENAME + boost::type_traits::detail::integral_promotion::type + ) +} + +#include +#include + +#endif // #ifndef FILE_boost_type_traits_integral_promotion_hpp_INCLUDED + diff --git a/include/boost/type_traits/promote.hpp b/include/boost/type_traits/promote.hpp new file mode 100644 index 0000000..71ef437 --- /dev/null +++ b/include/boost/type_traits/promote.hpp @@ -0,0 +1,40 @@ +// Copyright 2005 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) + +#ifndef FILE_boost_type_traits_promote_hpp_INCLUDED +#define FILE_boost_type_traits_promote_hpp_INCLUDED + +#include +#include +#include + +// Should be the last #include +#include + +namespace boost { + +namespace detail { + +template +struct promote_impl + : integral_promotion< + BOOST_DEDUCED_TYPENAME floating_point_promotion::type + > +{ +}; + +} + +BOOST_TT_AUX_TYPE_TRAIT_DEF1( + promote + , T + , BOOST_DEDUCED_TYPENAME ::boost::detail::promote_impl::type + ) +} + +#include + +#endif // #ifndef FILE_boost_type_traits_promote_hpp_INCLUDED + diff --git a/test/promote_basic_test.cpp b/test/promote_basic_test.cpp new file mode 100755 index 0000000..3bef939 --- /dev/null +++ b/test/promote_basic_test.cpp @@ -0,0 +1,111 @@ +// Copyright 2005 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) + +#include + +#if !defined(BOOST_NO_CWCHAR) +#include +#endif + +#include "promote_util.hpp" + +struct Struct {}; + +int main() +{ + // char types + +#if CHAR_MAX <= INT_MAX + test_cv< char, int >(); +#else + // TODO: dead branch? + test_cv< char, unsigned int >(); +#endif + + test_cv< signed char, int >(); + +#if UCHAR_MAX <= INT_MAX + test_cv< unsigned char, int >(); +#else + test_cv< unsigned char, unsigned int >(); +#endif + + + // short types + + test_cv< short int, int >(); + +#if USHRT_MAX <= INT_MAX + test_cv< unsigned short, int >(); +#else + test_cv< unsigned short, unsigned int >(); +#endif + + + // int and long + + test_cv< int, int >(); + test_cv< unsigned int, unsigned int >(); + test_cv< long, long >(); + test_cv< unsigned long, unsigned long >(); + +#if defined(BOOST_NO_CWCHAR) || !defined(WCHAR_MAX) || !defined(WCHAR_MIN) +// Skip wchar_t promotion +#elif WCHAR_MAX <= INT_MAX + test_cv< wchar_t, int >(); +#elif WCHAR_MIN == 0 && WCHAR_MAX <= UINT_MAX + test_cv< wchar_t, unsigned int >(); +#elif WCHAR_MAX <= LONG_MAX + test_cv< wchar_t, long >(); +#else + test_cv< wchar_t, unsigned long >(); +#endif + + + // floating point promotion + + test_cv< float , double >(); + test_cv< double, double >(); + + + // Other types + + test_cv< Struct, Struct >(); + test_cv< void , void >(); + test_cv< void* , void* >(); + + // Array types + + typedef int arr[3]; + typedef int (&arr_ref)[3]; + typedef int (*arr_ptr)[3]; + + test_cv< arr , arr >(); + test_cv< arr_ptr, arr_ptr >(); + + test_no_cv(); + + + // Function types + + typedef int (fun)(); + typedef int (&fun_ref)(); + typedef int (*fun_ptr)(); + + test_no_cv< fun , fun >(); + test_no_cv< fun_ref, fun_ref >(); + test_no_cv< fun_ptr, fun_ptr >(); + + // Member pointer types + + typedef int (Struct::*mem_fun_ptr)(); + typedef int Struct::*mem_ptr; + + test_no_cv< mem_ptr, mem_ptr >(); + test_no_cv< mem_fun_ptr, mem_fun_ptr >(); + + return 0; +} + diff --git a/test/promote_enum_test.cpp b/test/promote_enum_test.cpp new file mode 100755 index 0000000..c3d3f59 --- /dev/null +++ b/test/promote_enum_test.cpp @@ -0,0 +1,151 @@ +// Copyright 2005-2006 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) + +// Status of some compilers: +// +// Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86 +// /Za (disable extentions) is totally broken. +// /Ze (enable extentions) promotes UIntEnum incorrectly to int. +// See 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 +// +// gcc 3.4.4 with -fshort-enums option on x86 +// Dummy value is required, otherwise gcc promotes Enum1 +// to unsigned int although USHRT_MAX <= INT_MAX. +// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24063 +// +// CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-20 2004/03/19 +// on SPARC V9 64-bit processor (-xarch=v9 flag) +// Dummy values are required for LongEnum3 and LongEnum4. +// +// CC: Sun C++ 5.7 Patch 117830-03 2005/07/21 +// ICE in boost/type_traits/is_enum.hpp at line 67. + + +#include + +#include "promote_util.hpp" + +enum IntEnum1 { IntEnum1_min = -5 , IntEnum1_max = 5 }; +enum IntEnum2 { IntEnum2_min = SHRT_MIN, IntEnum2_max = SHRT_MAX }; +enum IntEnum3 { IntEnum3_min = INT_MIN , IntEnum3_max = INT_MAX }; +enum IntEnum4 { IntEnum4_value = INT_MAX }; +enum IntEnum5 { IntEnum5_value = INT_MIN }; + +void test_promote_to_int() +{ + test_cv(); + test_cv(); + test_cv(); + test_cv(); + test_cv(); +} + + +#if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ == 4 && USHRT_MAX <= INT_MAX) + +enum Enum1 { Enum1_value = USHRT_MAX }; + +#else + +// workaround for bug #24063 in gcc 3.4 +// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24063 +namespace gcc_short_enums_workaround { + +enum short_enum { value = 1 }; + +template +struct select +{ + // Adding negative dummy value doesn't change + // promoted type because USHRT_MAX <= INT_MAX. + enum type { dummy = -1, value = USHRT_MAX }; +}; + +template<> +struct select +{ + // No dummy value + enum type { value = USHRT_MAX }; +}; + +} // namespace gcc_short_enums_workaround + +typedef gcc_short_enums_workaround::select< + sizeof(gcc_short_enums_workaround::short_enum) != sizeof(int) + >::type Enum1; + +#endif + +void test_promote_to_int_or_uint() +{ +#if USHRT_MAX <= INT_MAX + test_cv(); +#else + test_cv(); +#endif +} + +#if (defined(BOOST_MSVC) && BOOST_MSVC <= 1400 ) || \ + (defined(BOOST_INTEL_WIN) && BOOST_INTEL_WIN <= 900) +// Don't test UIntEnum on VC++ 8.0 and Intel for Windows 9.0, +// they are broken. More info is on top of this file. +#else + +enum UIntEnum { UIntEnum_max = UINT_MAX }; + +void test_promote_to_uint() +{ + test_cv< UIntEnum, unsigned int >(); +} + +#endif + +// Enums can't be promoted to [unsigned] long if sizeof(int) == sizeof(long). +#if INT_MAX < LONG_MAX + +enum LongEnum1 { LongEnum1_min = -1 , LongEnum1_max = UINT_MAX }; +enum LongEnum2 { LongEnum2_min = LONG_MIN, LongEnum2_max = LONG_MAX }; + +enum LongEnum3 +{ + LongEnum3_value = LONG_MAX +#if defined(__SUNPRO_CC) && __SUNPRO_CC <= 0x530 + , LongEnum3_dummy = -1 +#endif +}; + +enum LongEnum4 +{ + LongEnum4_value = LONG_MIN +#if defined(__SUNPRO_CC) && __SUNPRO_CC <= 0x530 + , LongEnum4_dummy = 1 +#endif +}; + +void test_promote_to_long() +{ + test_cv< LongEnum1, long >(); + test_cv< LongEnum2, long >(); + test_cv< LongEnum3, long >(); + test_cv< LongEnum4, long >(); +} + +enum ULongEnum { ULongEnum_value = ULONG_MAX }; + +void test_promote_to_ulong() +{ + test_cv< ULongEnum, unsigned long >(); +} + +#endif // #if INT_MAX < LONG_MAX + +int main() +{ + return 0; +} + diff --git a/test/promote_mpl_test.cpp b/test/promote_mpl_test.cpp new file mode 100755 index 0000000..79dc1d2 --- /dev/null +++ b/test/promote_mpl_test.cpp @@ -0,0 +1,47 @@ +// Copyright 2005 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) + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace mpl = boost::mpl; + +int main() +{ + using namespace mpl::placeholders; + + typedef mpl::vector< char + , signed char // 1 + , unsigned char + , short int const // 3 + , unsigned short int + , int volatile // 5 + , unsigned int // 6 + , long // 7 + , unsigned long // 8 + , float const // 9 + > types; + + typedef mpl::transform< types + , mpl::lambda< boost::promote<_> >::type + >::type promoted; + + BOOST_STATIC_ASSERT(( ::boost::is_same< mpl::at_c::type, int >::value )); + BOOST_STATIC_ASSERT(( ::boost::is_same< mpl::at_c::type, int const >::value )); + BOOST_STATIC_ASSERT(( ::boost::is_same< mpl::at_c::type, int volatile >::value )); + BOOST_STATIC_ASSERT(( ::boost::is_same< mpl::at_c::type, unsigned int >::value )); + BOOST_STATIC_ASSERT(( ::boost::is_same< mpl::at_c::type, long >::value )); + BOOST_STATIC_ASSERT(( ::boost::is_same< mpl::at_c::type, unsigned long >::value )); + BOOST_STATIC_ASSERT(( ::boost::is_same< mpl::at_c::type, double const >::value )); + + return 0; +} + diff --git a/test/promote_util.hpp b/test/promote_util.hpp new file mode 100755 index 0000000..1aa8d55 --- /dev/null +++ b/test/promote_util.hpp @@ -0,0 +1,37 @@ +// Copyright 2005 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) + +#ifndef FILE_boost_libs_type_traits_test_promote_util_hpp_INCLUDED +#define FILE_boost_libs_type_traits_test_promote_util_hpp_INCLUDED + +#include + +#include +#include +#include + +template +inline void test_no_cv() +{ + typedef BOOST_DEDUCED_TYPENAME boost::promote::type promoted; + BOOST_STATIC_ASSERT(( boost::is_same::value )); +} + +template +inline void test_cv() +{ + typedef BOOST_DEDUCED_TYPENAME ::boost::promote::type promoted; + typedef BOOST_DEDUCED_TYPENAME ::boost::promote::type promoted_c; + typedef BOOST_DEDUCED_TYPENAME ::boost::promote::type promoted_v; + typedef BOOST_DEDUCED_TYPENAME ::boost::promote::type promoted_cv; + + BOOST_STATIC_ASSERT(( ::boost::is_same< promoted , Promoted >::value )); + BOOST_STATIC_ASSERT(( ::boost::is_same< promoted_c , Promoted const >::value )); + BOOST_STATIC_ASSERT(( ::boost::is_same< promoted_v , Promoted volatile >::value )); + BOOST_STATIC_ASSERT(( ::boost::is_same< promoted_cv, Promoted const volatile >::value )); +} + +#endif // #ifndef FILE_boost_libs_type_traits_test_promote_util_hpp_INCLUDED + From 591657959b8c07578e8c9c3a635e04316eb4b232 Mon Sep 17 00:00:00 2001 From: Alexander Nasonov Date: Sun, 16 Apr 2006 16:17:59 +0000 Subject: [PATCH 06/56] Applying blindly WCHAR_MAX fix for VC7.1 [SVN r33710] --- test/promote_basic_test.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/test/promote_basic_test.cpp b/test/promote_basic_test.cpp index 3bef939..c770433 100755 --- a/test/promote_basic_test.cpp +++ b/test/promote_basic_test.cpp @@ -51,18 +51,31 @@ int main() test_cv< long, long >(); test_cv< unsigned long, unsigned long >(); -#if defined(BOOST_NO_CWCHAR) || !defined(WCHAR_MAX) || !defined(WCHAR_MIN) -// Skip wchar_t promotion -#elif WCHAR_MAX <= INT_MAX + // wchar_t + +#if !defined(BOOST_NO_CWCHAR) && defined(WCHAR_MAX) && defined(WCHAR_MIN) + +// Version prior to VC8 didn't allow WCHAR_MAX in #if expressions +#if defined(BOOST_MSVC) && BOOST_MSVC < 1400 +#define BOOST_TT_AUX_WCHAR_MAX 0 // force test_cv< wchar_t, int > +#else +#define BOOST_TT_AUX_WCHAR_MAX WCHAR_MAX +#endif + +#if BOOST_TT_AUX_WCHAR_MAX <= INT_MAX test_cv< wchar_t, int >(); -#elif WCHAR_MIN == 0 && WCHAR_MAX <= UINT_MAX +#elif WCHAR_MIN == 0 && BOOST_TT_AUX_WCHAR_MAX <= UINT_MAX test_cv< wchar_t, unsigned int >(); -#elif WCHAR_MAX <= LONG_MAX +#elif BOOST_TT_AUX_WCHAR_MAX <= LONG_MAX test_cv< wchar_t, long >(); #else test_cv< wchar_t, unsigned long >(); #endif +#undef BOOST_TT_AUX_WCHAR_MAX + +#endif + // floating point promotion From 88b97b08364693636d8fe37f7d8c7ed1727257dd Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 21 Apr 2006 09:44:40 +0000 Subject: [PATCH 07/56] Fixed documentation bug in function_traits. [SVN r33753] --- doc/type_traits.qbk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/type_traits.qbk b/doc/type_traits.qbk index 00ddce2..59d96bb 100644 --- a/doc/type_traits.qbk +++ b/doc/type_traits.qbk @@ -1305,9 +1305,9 @@ the same thing as a /pointer to a function/. [[`function_traits::arity`] [An integral constant expression that has the value 4.]] [[`function_traits::result_type`] [The type `void`.]] [[`function_traits::result_type`] [The type `long`.]] -[[`function_traits::arg0_type`] [The type `int`.]] -[[`function_traits::arg3_type`] [The type `void*`.]] -[[`function_traits::arg4_type`] [A compiler error: there is no `arg4_type` since there are only three arguments.]] +[[`function_traits::arg1_type`] [The type `int`.]] +[[`function_traits::arg4_type`] [The type `void*`.]] +[[`function_traits::arg5_type`] [A compiler error: there is no `arg4_type` since there are only three arguments.]] [[`function_traits::arity`] [A compiler error: argument type is a /function pointer/, and not a /function type/.]] ] From 1708737f01d2d03f601b1a0932212e6176a4b188 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 21 Apr 2006 12:58:39 +0000 Subject: [PATCH 08/56] Fix bug in __is_pod intrinsic. [SVN r33757] --- include/boost/type_traits/intrinsics.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/type_traits/intrinsics.hpp b/include/boost/type_traits/intrinsics.hpp index 43bb3ce..48c3440 100644 --- a/include/boost/type_traits/intrinsics.hpp +++ b/include/boost/type_traits/intrinsics.hpp @@ -72,7 +72,7 @@ #if defined(BOOST_MSVC) && defined(_MSC_FULL_VER) && (_MSC_FULL_VER >=140050215) # define BOOST_IS_UNION(T) __is_union(T) -# define BOOST_IS_POD(T) __is_pod(T) +# 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) From b5f0ef82b7fb766cb73b87a0e72567118217bf71 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 21 Apr 2006 12:59:28 +0000 Subject: [PATCH 09/56] Updated tests for intrinsics. [SVN r33758] --- test/has_trivial_assign_test.cpp | 9 ++++++++ test/has_trivial_constr_test.cpp | 10 +++++++++ test/has_trivial_copy_test.cpp | 9 ++++++++ test/has_trivial_destructor_test.cpp | 9 ++++++++ test/is_pod_test.cpp | 8 +++++++ test/test.hpp | 31 ++++++++++++++++++++++++++++ 6 files changed, 76 insertions(+) diff --git a/test/has_trivial_assign_test.cpp b/test/has_trivial_assign_test.cpp index ce4029a..61be263 100644 --- a/test/has_trivial_assign_test.cpp +++ b/test/has_trivial_assign_test.cpp @@ -189,6 +189,15 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, tru BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign >::value, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign >::value, true, false); + BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); TT_TEST_END diff --git a/test/has_trivial_constr_test.cpp b/test/has_trivial_constr_test.cpp index ccadb1f..a651157 100644 --- a/test/has_trivial_constr_test.cpp +++ b/test/has_trivial_constr_test.cpp @@ -155,6 +155,16 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true, false); +//BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor >::value, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor >::value, true, false); +//BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor >::value, true, false); + + BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); TT_TEST_END diff --git a/test/has_trivial_copy_test.cpp b/test/has_trivial_copy_test.cpp index 18b4d68..f845240 100644 --- a/test/has_trivial_copy_test.cpp +++ b/test/has_trivial_copy_test.cpp @@ -189,6 +189,15 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true, BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy >::value, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy >::value, true, false); + BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); TT_TEST_END diff --git a/test/has_trivial_destructor_test.cpp b/test/has_trivial_destructor_test.cpp index 577c5e4..98db25d 100644 --- a/test/has_trivial_destructor_test.cpp +++ b/test/has_trivial_destructor_test.cpp @@ -161,6 +161,15 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor >::value, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor >::value, true, false); + TT_TEST_END diff --git a/test/is_pod_test.cpp b/test/is_pod_test.cpp index 59523dd..c21a7af 100644 --- a/test/is_pod_test.cpp +++ b/test/is_pod_test.cpp @@ -158,6 +158,14 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_pod::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_pod::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_pod::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod >::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod >::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod >::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod >::value, false); TT_TEST_END diff --git a/test/test.hpp b/test/test.hpp index 7c83d1b..2e354b9 100644 --- a/test/test.hpp +++ b/test/test.hpp @@ -376,6 +376,37 @@ typedef void foo2_t(int&, double); typedef void foo3_t(int&, bool, int, int); typedef void foo4_t(int, bool, int*, int[], int, int, int, int, int); +struct trivial_except_construct +{ + trivial_except_construct(); + int i; +}; + +struct trivial_except_destroy +{ + ~trivial_except_destroy(); + int i; +}; + +struct trivial_except_copy +{ + trivial_except_copy(trivial_except_copy const&); + int i; +}; + +struct trivial_except_assign +{ + trivial_except_assign& operator=(trivial_except_assign const&); + int i; +}; + +template +struct wrap +{ + T t; + int j; +}; + #endif From 6d862ae4d368a625c3e32e00ee00440a256e8d68 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 2 May 2006 11:00:21 +0000 Subject: [PATCH 10/56] Added DMC support. [SVN r33905] --- include/boost/type_traits/intrinsics.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/boost/type_traits/intrinsics.hpp b/include/boost/type_traits/intrinsics.hpp index 48c3440..3b48b47 100644 --- a/include/boost/type_traits/intrinsics.hpp +++ b/include/boost/type_traits/intrinsics.hpp @@ -85,6 +85,21 @@ # define BOOST_HAS_TYPE_TRAITS_INTRINSICS #endif +#if defined(__DMC__) && (__DMC__ >= 0x848) +// For Digital Mars C++, www.digitalmars.com +# define BOOST_IS_UNION(T) (__typeinfo(T) & 0x400) +# define BOOST_IS_POD(T) (__typeinfo(T) & 0x800) +# define BOOST_IS_EMPTY(T) (__typeinfo(T) & 0x1000) +# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__typeinfo(T) & 0x10) +# define BOOST_HAS_TRIVIAL_COPY(T) (__typeinfo(T) & 0x20) +# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__typeinfo(T) & 0x40) +# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__typeinfo(T) & 0x8) +# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__typeinfo(T) & 0x80) +# define BOOST_HAS_NOTHROW_COPY(T) (__typeinfo(T) & 0x100) +# define BOOST_HAS_NOTHROW_ASSIGN(T) (__typeinfo(T) & 0x200) +# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) (__typeinfo(T) & 0x4) +# define BOOST_HAS_TYPE_TRAITS_INTRINSICS +#endif #ifndef BOOST_IS_UNION # define BOOST_IS_UNION(T) false @@ -135,3 +150,4 @@ + From dac6a91362c8c5734f327f25f3b389c5b230ebf9 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 19 May 2006 13:05:16 +0000 Subject: [PATCH 11/56] Latest Sunpro version apparently doesn't need the workarounds in here. [SVN r34026] --- include/boost/type_traits/is_base_and_derived.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/type_traits/is_base_and_derived.hpp b/include/boost/type_traits/is_base_and_derived.hpp index 598133f..d3605f7 100644 --- a/include/boost/type_traits/is_base_and_derived.hpp +++ b/include/boost/type_traits/is_base_and_derived.hpp @@ -24,7 +24,7 @@ namespace boost { namespace detail { #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581)) \ - && !BOOST_WORKAROUND(__SUNPRO_CC , BOOST_TESTED_AT(0x540)) \ + && !BOOST_WORKAROUND(__SUNPRO_CC , <= 0x540) \ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 243) \ && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) From ece355a4119adc95b4579f84bccb12c69f0e5ef2 Mon Sep 17 00:00:00 2001 From: Alexander Nasonov Date: Sat, 20 May 2006 09:34:53 +0000 Subject: [PATCH 12/56] // reminder to keep in sync code duplicate. [SVN r34039] --- include/boost/type_traits/is_integral.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/boost/type_traits/is_integral.hpp b/include/boost/type_traits/is_integral.hpp index b6ca6c7..51710c2 100644 --- a/include/boost/type_traits/is_integral.hpp +++ b/include/boost/type_traits/is_integral.hpp @@ -41,6 +41,8 @@ BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char,true) BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true) #endif +// Same set of integral types as in boost/type_traits/integral_promotion.hpp. +// Please, keep in sync. -- Alexander Nasonov #if (defined(BOOST_MSVC) && (BOOST_MSVC < 1300)) \ || (defined(BOOST_INTEL_CXX_VERSION) && defined(_MSC_VER) && (BOOST_INTEL_CXX_VERSION <= 600)) \ || (defined(__BORLANDC__) && (__BORLANDC__ == 0x600) && (_MSC_VER < 1300)) From a74063a1a27b4310f9c13414f798f9916375e50b Mon Sep 17 00:00:00 2001 From: Alexander Nasonov Date: Sat, 20 May 2006 09:35:45 +0000 Subject: [PATCH 13/56] remove leading :: from ::boost [SVN r34040] --- include/boost/type_traits/floating_point_promotion.hpp | 2 +- include/boost/type_traits/promote.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/type_traits/floating_point_promotion.hpp b/include/boost/type_traits/floating_point_promotion.hpp index e6846f0..23d8a7f 100644 --- a/include/boost/type_traits/floating_point_promotion.hpp +++ b/include/boost/type_traits/floating_point_promotion.hpp @@ -51,7 +51,7 @@ BOOST_TT_AUX_TYPE_TRAIT_DEF1( floating_point_promotion , T , BOOST_DEDUCED_TYPENAME - ::boost::type_traits::detail::floating_point_promotion::type + boost::type_traits::detail::floating_point_promotion::type ) } diff --git a/include/boost/type_traits/promote.hpp b/include/boost/type_traits/promote.hpp index 71ef437..14efad4 100644 --- a/include/boost/type_traits/promote.hpp +++ b/include/boost/type_traits/promote.hpp @@ -30,7 +30,7 @@ struct promote_impl BOOST_TT_AUX_TYPE_TRAIT_DEF1( promote , T - , BOOST_DEDUCED_TYPENAME ::boost::detail::promote_impl::type + , BOOST_DEDUCED_TYPENAME boost::detail::promote_impl::type ) } From 6e89d5997514276600c533d5788ad82a3ca3ba5a Mon Sep 17 00:00:00 2001 From: Alexander Nasonov Date: Mon, 22 May 2006 21:02:59 +0000 Subject: [PATCH 14/56] included missing files: floating_point_promotion.hpp, integral_promotion.hpp and promote.hpp [SVN r34061] --- include/boost/type_traits.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/boost/type_traits.hpp b/include/boost/type_traits.hpp index 08bb5a1..b6cc3c6 100644 --- a/include/boost/type_traits.hpp +++ b/include/boost/type_traits.hpp @@ -70,6 +70,9 @@ #include "boost/type_traits/type_with_alignment.hpp" #include "boost/type_traits/function_traits.hpp" #include "boost/type_traits/aligned_storage.hpp" +#include "boost/type_traits/floating_point_promotion.hpp" +#include "boost/type_traits/integral_promotion.hpp" +#include "boost/type_traits/promote.hpp" #include "boost/type_traits/ice.hpp" From 1721b740ff07ab98561d4c92dfa48711e7256a7e Mon Sep 17 00:00:00 2001 From: Alexander Nasonov Date: Fri, 26 May 2006 17:53:53 +0000 Subject: [PATCH 15/56] BOOST_TT_AUX_BOOL_TRAIT_DEF1 removed [SVN r34105] --- .../boost/type_traits/integral_promotion.hpp | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/include/boost/type_traits/integral_promotion.hpp b/include/boost/type_traits/integral_promotion.hpp index fa8f8eb..a85e243 100644 --- a/include/boost/type_traits/integral_promotion.hpp +++ b/include/boost/type_traits/integral_promotion.hpp @@ -10,34 +10,36 @@ #include #include +#include #include #include #include +#include // Should be the last #include #include -#include namespace boost { namespace type_traits { namespace detail { // 4.5/2 -BOOST_TT_AUX_BOOL_TRAIT_DEF1(need_promotion, T, boost::is_enum::value) +template struct need_promotion : boost::is_enum {}; // 4.5/1 -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, char , true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, signed char , true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, unsigned char , true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, signed short int , true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, unsigned short int, true) +template<> struct need_promotion : true_type {}; +template<> struct need_promotion : true_type {}; +template<> struct need_promotion : true_type {}; +template<> struct need_promotion : true_type {}; +template<> struct need_promotion : true_type {}; // Specializations for non-standard types. // Type is promoted if it's smaller then int. #define BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(T) \ - BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, T, (sizeof(T) < sizeof(int))) + template<> struct need_promotion \ + : integral_constant {}; // Same set of integral types as in boost/type_traits/is_integral.hpp. // Please, keep in sync. @@ -70,13 +72,13 @@ BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE( __int64) #ifndef BOOST_NO_INTRINSIC_WCHAR_T // 4.5/2 -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, wchar_t, true) +template<> struct need_promotion : true_type {}; #endif // 4.5/3 (integral bit-field) is not supported. // 4.5/4 -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, bool, true) +template<> struct need_promotion : true_type {}; // Get promoted type by index and cv qualifiers. @@ -170,7 +172,7 @@ struct integral_promotion_impl template struct integral_promotion : boost::mpl::eval_if< - need_promotion + need_promotion::type> , integral_promotion_impl , boost::mpl::identity > @@ -187,7 +189,6 @@ BOOST_TT_AUX_TYPE_TRAIT_DEF1( ) } -#include #include #endif // #ifndef FILE_boost_type_traits_integral_promotion_hpp_INCLUDED From 0acf61da07eef185b881b4b5c2fbaaeb896ea554 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Sat, 27 May 2006 13:58:58 +0000 Subject: [PATCH 16/56] workaround to restore MIPSpro 7.3.1 Boost.Python build: the old EDG238-based compiler does not support the new boost/type_traits/integral_promotion.hpp [SVN r34110] --- include/boost/type_traits.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/boost/type_traits.hpp b/include/boost/type_traits.hpp index b6cc3c6..afba2ea 100644 --- a/include/boost/type_traits.hpp +++ b/include/boost/type_traits.hpp @@ -71,8 +71,10 @@ #include "boost/type_traits/function_traits.hpp" #include "boost/type_traits/aligned_storage.hpp" #include "boost/type_traits/floating_point_promotion.hpp" +#if !(defined(__sgi) && defined(__EDG_VERSION__) && (__EDG_VERSION__ == 238)) #include "boost/type_traits/integral_promotion.hpp" #include "boost/type_traits/promote.hpp" +#endif #include "boost/type_traits/ice.hpp" From 20e4a364b2b552d2c40fc24f7d8c75b2be9dd807 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 2 Jun 2006 17:52:15 +0000 Subject: [PATCH 17/56] Fix header include name: was a duplicate used elsewhere. [SVN r34144] --- include/boost/type_traits/msvc/remove_all_extents.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/type_traits/msvc/remove_all_extents.hpp b/include/boost/type_traits/msvc/remove_all_extents.hpp index b5424a6..3517132 100644 --- a/include/boost/type_traits/msvc/remove_all_extents.hpp +++ b/include/boost/type_traits/msvc/remove_all_extents.hpp @@ -2,8 +2,8 @@ // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_TYPE_TRAITS_MSVC_REMOVE_EXTENT_HOLT_2004_0827 -#define BOOST_TYPE_TRAITS_MSVC_REMOVE_EXTENT_HOLT_2004_0827 +#ifndef BOOST_TYPE_TRAITS_MSVC_REMOVE_ALL_EXTENT_HOLT_2004_0827 +#define BOOST_TYPE_TRAITS_MSVC_REMOVE_ALL_EXTENT_HOLT_2004_0827 #include #include From 16dd4cb9983f21517f15a75fd1a1bb294b43d4e4 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 5 Jun 2006 09:40:22 +0000 Subject: [PATCH 18/56] Added some extra namespace qualifications to keep VC7 happy when used from within the TR1 lib. [SVN r34182] --- include/boost/type_traits/add_pointer.hpp | 2 +- include/boost/type_traits/add_reference.hpp | 2 +- include/boost/type_traits/is_class.hpp | 2 +- include/boost/type_traits/remove_const.hpp | 4 ++-- include/boost/type_traits/remove_pointer.hpp | 2 +- include/boost/type_traits/remove_reference.hpp | 2 +- include/boost/type_traits/remove_volatile.hpp | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/boost/type_traits/add_pointer.hpp b/include/boost/type_traits/add_pointer.hpp index 3e91919..308baf0 100644 --- a/include/boost/type_traits/add_pointer.hpp +++ b/include/boost/type_traits/add_pointer.hpp @@ -63,7 +63,7 @@ struct add_pointer_impl } // namespace detail -BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_pointer,T,typename detail::add_pointer_impl::type) +BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_pointer,T,typename boost::detail::add_pointer_impl::type) } // namespace boost diff --git a/include/boost/type_traits/add_reference.hpp b/include/boost/type_traits/add_reference.hpp index 793ca4f..7dfb4be 100644 --- a/include/boost/type_traits/add_reference.hpp +++ b/include/boost/type_traits/add_reference.hpp @@ -74,7 +74,7 @@ BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void const volatile,void const } // namespace detail -BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_reference,T,typename detail::add_reference_impl::type) +BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_reference,T,typename boost::detail::add_reference_impl::type) // agurt, 07/mar/03: workaround Borland's ill-formed sensitivity to an additional // level of indirection, here diff --git a/include/boost/type_traits/is_class.hpp b/include/boost/type_traits/is_class.hpp index 6a12a9e..6bf2fdc 100644 --- a/include/boost/type_traits/is_class.hpp +++ b/include/boost/type_traits/is_class.hpp @@ -116,7 +116,7 @@ struct is_class_impl # ifdef __EDG_VERSION__ BOOST_TT_AUX_BOOL_TRAIT_DEF1( - is_class,T, detail::is_class_impl::type>::value) + is_class,T, boost::detail::is_class_impl::type>::value) # else BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_class,T,::boost::detail::is_class_impl::value) # endif diff --git a/include/boost/type_traits/remove_const.hpp b/include/boost/type_traits/remove_const.hpp index 45f8d6e..7e18d88 100644 --- a/include/boost/type_traits/remove_const.hpp +++ b/include/boost/type_traits/remove_const.hpp @@ -58,7 +58,7 @@ struct remove_const_impl // * convert a type T to non-const type - remove_const -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_const,T,typename detail::remove_const_impl::type) +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_const,T,typename boost::detail::remove_const_impl::type) BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_const,T&,T&) #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_const,T const[N],T type[N]) @@ -67,7 +67,7 @@ BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_const,T #elif !BOOST_WORKAROUND(BOOST_MSVC,<=1300) -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_const,T,typename detail::remove_const_impl::type) +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_const,T,typename boost::detail::remove_const_impl::type) #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION diff --git a/include/boost/type_traits/remove_pointer.hpp b/include/boost/type_traits/remove_pointer.hpp index 893be09..5359992 100644 --- a/include/boost/type_traits/remove_pointer.hpp +++ b/include/boost/type_traits/remove_pointer.hpp @@ -32,7 +32,7 @@ BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_pointer,T* const volat #elif !BOOST_WORKAROUND(BOOST_MSVC,<=1300) -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_pointer,T,typename detail::remove_pointer_impl::type) +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_pointer,T,typename boost::detail::remove_pointer_impl::type) #endif diff --git a/include/boost/type_traits/remove_reference.hpp b/include/boost/type_traits/remove_reference.hpp index 27e9002..3d0b707 100644 --- a/include/boost/type_traits/remove_reference.hpp +++ b/include/boost/type_traits/remove_reference.hpp @@ -39,7 +39,7 @@ BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T& const vol #elif !BOOST_WORKAROUND(BOOST_MSVC,<=1300) -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_reference,T,typename detail::remove_reference_impl::type) +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_reference,T,typename boost::detail::remove_reference_impl::type) #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION diff --git a/include/boost/type_traits/remove_volatile.hpp b/include/boost/type_traits/remove_volatile.hpp index ec6b6c5..723ebe3 100644 --- a/include/boost/type_traits/remove_volatile.hpp +++ b/include/boost/type_traits/remove_volatile.hpp @@ -57,7 +57,7 @@ struct remove_volatile_impl // * convert a type T to a non-volatile type - remove_volatile -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_volatile,T,typename detail::remove_volatile_impl::type) +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_volatile,T,typename boost::detail::remove_volatile_impl::type) BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_volatile,T&,T&) #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_volatile,T volatile[N],T type[N]) @@ -66,7 +66,7 @@ BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_volatile #elif !BOOST_WORKAROUND(BOOST_MSVC,<=1300) -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_volatile,T,typename detail::remove_volatile_impl::type) +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_volatile,T,typename boost::detail::remove_volatile_impl::type) #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION From 8d23867d2af01cde96defedeb0134593fdb51a71 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Thu, 8 Jun 2006 01:47:33 +0000 Subject: [PATCH 19/56] Disambiguated certain constructs. [SVN r34227] --- include/boost/type_traits/alignment_of.hpp | 2 +- include/boost/type_traits/type_with_alignment.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/type_traits/alignment_of.hpp b/include/boost/type_traits/alignment_of.hpp index 70594c0..f18d422 100644 --- a/include/boost/type_traits/alignment_of.hpp +++ b/include/boost/type_traits/alignment_of.hpp @@ -51,7 +51,7 @@ struct alignment_of_impl { BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::alignment_logic< - sizeof(detail::alignment_of_hack) - sizeof(T), + sizeof(::boost::detail::alignment_of_hack) - sizeof(T), sizeof(T) >::value)); }; diff --git a/include/boost/type_traits/type_with_alignment.hpp b/include/boost/type_traits/type_with_alignment.hpp index 37bfbb2..49816d2 100644 --- a/include/boost/type_traits/type_with_alignment.hpp +++ b/include/boost/type_traits/type_with_alignment.hpp @@ -192,11 +192,11 @@ struct is_pod< ::boost::detail::lower_alignment > template class type_with_alignment { - typedef detail::lower_alignment t1; + typedef ::boost::detail::lower_alignment t1; typedef typename mpl::if_c< ::boost::detail::is_aligned< ::boost::alignment_of::value,Align >::value , t1 - , detail::max_align + , ::boost::detail::max_align >::type align_t; BOOST_STATIC_CONSTANT(std::size_t, found = alignment_of::value); From bbd235a4b2e7b1fe1c54ac77d70334d95b0c3500 Mon Sep 17 00:00:00 2001 From: Alexander Nasonov Date: Tue, 13 Jun 2006 21:00:06 +0000 Subject: [PATCH 20/56] Documentation for promotion traits. [SVN r34296] --- doc/type_traits.qbk | 124 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 122 insertions(+), 2 deletions(-) diff --git a/doc/type_traits.qbk b/doc/type_traits.qbk index 59d96bb..6fa5f65 100644 --- a/doc/type_traits.qbk +++ b/doc/type_traits.qbk @@ -1,7 +1,8 @@ [library Boost.TypeTraits - [copyright 2000 2005 Adobe Systems Inc, David Abrahams, Steve Cleary, + [copyright 2000 2006 Adobe Systems Inc, David Abrahams, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat Marcus, - Itay Maman, John Maddock, Thorsten Ottosen, Robert Ramey and Jeremy Siek] + Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, + Robert Ramey and Jeremy Siek] [purpose Meta-programming support library] [license Distributed under the Boost Software License, Version 1.0. @@ -93,6 +94,10 @@ [def __function_traits [link boost_typetraits.function_traits function_traits]] +[def __promote [link boost_typetraits.promote promote]] +[def __integral_promotion [link boost_typetraits.integral_promotion integral_promotion]] +[def __floating_point_promotion [link boost_typetraits.floating_point_promotion floating_point_promotion]] + [section:intro Introduction] The Boost type-traits library contains a @@ -617,6 +622,15 @@ result of applying the transformation to the template argument `T`. template struct __add_volatile; + template + struct __floating_point_promotion; + + template + struct __integral_promotion; + + template + struct __promote; + template struct __remove_all_extents; @@ -1017,6 +1031,21 @@ different types [endsect] +[section:to_double Convert Numeric Types and Enums to double] + +Demonstrates a conversion of +[@../../libs/numeric/conversion/doc/definitions.html#numtypes Numeric Types] +and enum types to double: + + template + inline double to_double(T const& value) + { + typedef typename boost::promote::type promoted; + return boost::numeric::converter::convert(value); + } + +[endsect] + [endsect] [section:reference Alphabetical Reference] @@ -1271,6 +1300,36 @@ expression that evaluates to /0/.] [endsect] +[section:floating_point_promotion floating_point_promotion] + + template + struct floating_point_promotion + { + typedef __below type; + }; + +__type If floating point promotion can be applied to an rvalue of type `T`, +then applies floating point promotion to `T` and keeps cv-qualifiers of `T`, +otherwise leaves `T` unchanged. + +__std_ref 4.6. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`floating_point_promotion::type`][`double const`]] + +[[`floating_point_promotion::type`][`float&`]] + +[[`floating_point_promotion::type`][`short`]] + +] + +[endsect] + [section:function_traits function_traits] [def __argN '''argN_type'''] @@ -1582,6 +1641,36 @@ one of these. [endsect] +[section:integral_promotion integral_promotion] + + template + struct integral_promotion + { + typedef __below type; + }; + +__type If integral promotion can be applied to an rvalue of type `T`, then +applies integral promotion to `T` and keeps cv-qualifiers of `T`, +otherwise leaves `T` unchanged. + +__std_ref 4.5 except 4.5/3 (integral bit-field). + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`integral_promotion::type`][`int const`]] + +[[`integral_promotion::type`][`short&`]] + +[[`integral_promotion::type`][`int`]] + +] + +[endsect] + [section:is_abstract is_abstract] template struct is_abstract : public __tof {}; @@ -2520,6 +2609,37 @@ at the top level in this case.] [endsect] +[section:promote promote] + + template + struct promote + { + typedef __below type; + }; + +__type If integral or floating point promotion can be applied to an rvalue +of type `T`, then applies integral and floating point promotions to `T` and +keeps cv-qualifiers of `T`, otherwise leaves `T` unchanged. See also +__integral_promotion and __floating_point_promotion. + +__std_ref 4.5 except 4.5/3 (integral bit-field) and 4.6. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`promote::type`][`int volatile`]] + +[[`promote::type`][`double const`]] + +[[`promote::type`][`short&`]] + +] + +[endsect] + [section:rank rank] template struct rank : public __integral_constant {}; From b1269caaf6dc536cbcc391037c785e961240a75a Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 26 Jun 2006 09:48:58 +0000 Subject: [PATCH 21/56] Added some comments related to frequently asked questions. [SVN r34408] --- doc/type_traits.qbk | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/doc/type_traits.qbk b/doc/type_traits.qbk index 6fa5f65..5461646 100644 --- a/doc/type_traits.qbk +++ b/doc/type_traits.qbk @@ -2068,6 +2068,7 @@ expression that evaluates to /true/.] [endsect] [section:is_function is_function] + template struct is_function : public __tof {}; @@ -2107,6 +2108,18 @@ to a member function.] [:`is_function::value_type` is the type `bool`.] +[tip Don't confuse function-types with pointers to functions:\n\n +`typedef int f(double);`\n\n +defines a function type,\n\n +`f foo;`\n\n +declares a prototype for a function of type `f`,\n\n +`f* pf = foo;`\n +`f& fr = foo;`\n\n +declares a pointer and a reference to the function `foo`.\n\n +If you want to detect whether some type is a pointer-to-function then use:\n\n +`__is_function<__remove_pointer::type>::value && __is_pointer::value`\n\n +or for pointers to member functions you can just use __is_member_function_pointer directly.] + [endsect] [section:is_fundamental is_fundamental] @@ -2355,6 +2368,13 @@ expression that evaluates to /false/.] [:`is_pointer::value_type` is the type `bool`.] +[important `is_pointer` detects "real" pointer types only, and /not/ smart pointers. +Users should not specialise `is_pointer` for smart pointer types, as doing so may cause +Boost (and other third party) code to fail to function correctly. +Users wanting a trait to detect smart pointers should create their own. +However, note that there is no way in general to auto-magically detect smart pointer types, +so such a trait would have to be partially specialised for each supported smart pointer type.] + [endsect] [section:is_polymorphic is_polymorphic] From db595df8095da5f033caec2a669b64c51eaa8e12 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 11 Jul 2006 12:07:06 +0000 Subject: [PATCH 22/56] With apologies: changed Rani's surname so that the code will compile cleanly on machines using a far-eastern locale, unfortunately non-ASCII characters in source files are not portable across platforms and compilers. [SVN r34507] --- include/boost/type_traits/is_base_and_derived.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/type_traits/is_base_and_derived.hpp b/include/boost/type_traits/is_base_and_derived.hpp index d3605f7..a3157f7 100644 --- a/include/boost/type_traits/is_base_and_derived.hpp +++ b/include/boost/type_traits/is_base_and_derived.hpp @@ -37,7 +37,7 @@ namespace detail { This version detects ambiguous base classes and private base classes correctly, and was devised by Rani Sharoni. -Explanation by Terje Slettebø and Rani Sharoni. +Explanation by Terje Slettebo and Rani Sharoni. Let's take the multiple base class below as an example, and the following will also show why there's not a problem with private or ambiguous base From 99a176c004322c899369dc22b26be34cfbd21406 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 12 Jul 2006 11:10:22 +0000 Subject: [PATCH 23/56] Undef macros before defining them (again). [SVN r34511] --- .../type_traits/detail/bool_trait_def.hpp | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/include/boost/type_traits/detail/bool_trait_def.hpp b/include/boost/type_traits/detail/bool_trait_def.hpp index d6b024c..a54c910 100644 --- a/include/boost/type_traits/detail/bool_trait_def.hpp +++ b/include/boost/type_traits/detail/bool_trait_def.hpp @@ -17,6 +17,28 @@ #include #include +// +// Unfortunately some libraries have started using this header without +// cleaning up afterwards: so we'd better undef the macros just in case +// they've been defined already.... +// +#ifdef BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL +#undef BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL +#undef BOOST_TT_AUX_BOOL_C_BASE +#undef BOOST_TT_AUX_BOOL_TRAIT_DEF1 +#undef BOOST_TT_AUX_BOOL_TRAIT_DEF2 +#undef BOOST_TT_AUX_BOOL_TRAIT_SPEC1 +#undef BOOST_TT_AUX_BOOL_TRAIT_SPEC2 +#undef BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1 +#undef BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2 +#undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1 +#undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2 +#undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1 +#undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2 +#undef BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1 +#undef BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1 +#endif + #if defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x570) # define BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ typedef ::boost::integral_constant type; \ From 413b552f6fd13a2da74bf55b03838dc28cf2311f Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 17 Jul 2006 11:08:01 +0000 Subject: [PATCH 24/56] Added missing license info. [SVN r34586] --- cxx_type_traits.htm | 4 ++++ index.html | 4 ++++ test/Jamfile | 4 ++++ test/Jamfile.v2 | 5 +++++ 4 files changed, 17 insertions(+) diff --git a/cxx_type_traits.htm b/cxx_type_traits.htm index 28f1073..4c92a7e 100644 --- a/cxx_type_traits.htm +++ b/cxx_type_traits.htm @@ -8,8 +8,12 @@ ../../doc/html/boost_typetraits/background.html or view the online version at http://www.boost.org/regression-logs/cs-win32_metacomm/doc/html/boost_typetraits/background.html +

Copyright John Maddock 2006

+

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

+ diff --git a/index.html b/index.html index 1180f8b..def0f22 100644 --- a/index.html +++ b/index.html @@ -8,8 +8,12 @@ ../../doc/html/boost_typetraits.html or view the online version at http://www.boost.org/regression-logs/cs-win32_metacomm/doc/html/boost_typetraits.html +

Copyright John Maddock 2001

+

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

+ diff --git a/test/Jamfile b/test/Jamfile index 4756165..ce5b6b1 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -1,4 +1,7 @@ # Copyright John Maddock 2004 +# 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) # # There are two ways to invoke this Jamfile: # @@ -70,3 +73,4 @@ else } + diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 5e13609..b55e978 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -1,3 +1,7 @@ +# copyright John Maddock 2004 +# 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) # bring in the rules for testing import testing ; @@ -18,3 +22,4 @@ rule all-tests { test-suite type_traits : [ all-tests ] ; + From 522e5a9983a61229664f3832edea8623fa24267e Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 17 Jul 2006 11:09:44 +0000 Subject: [PATCH 25/56] Added copyright. [SVN r34587] --- include/boost/type_traits/aligned_storage.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/type_traits/aligned_storage.hpp b/include/boost/type_traits/aligned_storage.hpp index 634fa74..5420f26 100755 --- a/include/boost/type_traits/aligned_storage.hpp +++ b/include/boost/type_traits/aligned_storage.hpp @@ -1,5 +1,5 @@ -// (C) John Maddock 2005. +// Copyright (C) John Maddock 2005. // 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). @@ -10,3 +10,4 @@ # define BOOST_TT_ALIGNED_STORAGE_HPP_INCLUDED # include #endif // BOOST_TT_ALIGNED_STORAGE_HPP_INCLUDED + From 7959ba42063f6a3c2e5b0ed81277ff2ec415cf1f Mon Sep 17 00:00:00 2001 From: John Maddock Date: Thu, 24 Aug 2006 10:59:16 +0000 Subject: [PATCH 26/56] Removed aCC workarounds that are no longer necessary. Updated aCC config. [SVN r34937] --- include/boost/type_traits/config.hpp | 2 +- include/boost/type_traits/is_convertible.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/type_traits/config.hpp b/include/boost/type_traits/config.hpp index 821bf60..7f98789 100644 --- a/include/boost/type_traits/config.hpp +++ b/include/boost/type_traits/config.hpp @@ -32,7 +32,7 @@ || BOOST_WORKAROUND(__IBMCPP__, < 600 ) \ || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \ || defined(__ghs) \ - || BOOST_WORKAROUND(__HP_aCC, BOOST_TESTED_AT(53800)) \ + || BOOST_WORKAROUND(__HP_aCC, < 60700) \ || BOOST_WORKAROUND(MPW_CPLUS, BOOST_TESTED_AT(0x890)) \ || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))) \ && defined(BOOST_NO_IS_ABSTRACT) diff --git a/include/boost/type_traits/is_convertible.hpp b/include/boost/type_traits/is_convertible.hpp index f817f66..5ad740e 100644 --- a/include/boost/type_traits/is_convertible.hpp +++ b/include/boost/type_traits/is_convertible.hpp @@ -340,7 +340,7 @@ struct is_convertible_impl_select template struct is_convertible_impl_dispatch_base { -#ifndef __HP_aCC +#if !BOOST_WORKAROUND(__HP_aCC, < 60700) typedef is_convertible_impl_select< ::boost::is_arithmetic::value, ::boost::is_arithmetic::value, From d5a7f6f622ff6c0fc0de0ec0d6114e58fd561cba Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 3 Oct 2006 17:51:44 +0000 Subject: [PATCH 27/56] Fix for old broken Borland compilers. [SVN r35457] --- include/boost/type_traits.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/boost/type_traits.hpp b/include/boost/type_traits.hpp index afba2ea..80c9954 100644 --- a/include/boost/type_traits.hpp +++ b/include/boost/type_traits.hpp @@ -70,11 +70,13 @@ #include "boost/type_traits/type_with_alignment.hpp" #include "boost/type_traits/function_traits.hpp" #include "boost/type_traits/aligned_storage.hpp" +#if !BOOST_WORKAROUND(__BORLANDC__, < 0x564) #include "boost/type_traits/floating_point_promotion.hpp" #if !(defined(__sgi) && defined(__EDG_VERSION__) && (__EDG_VERSION__ == 238)) #include "boost/type_traits/integral_promotion.hpp" #include "boost/type_traits/promote.hpp" #endif +#endif // Borland #include "boost/type_traits/ice.hpp" From f26b33201ba9e53bb55dff55bdb88feebea1b4e1 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 13 Oct 2006 09:19:09 +0000 Subject: [PATCH 28/56] Removed dead code. [SVN r35585] --- .../boost/type_traits/integral_constant.hpp | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/include/boost/type_traits/integral_constant.hpp b/include/boost/type_traits/integral_constant.hpp index 0a6450a..4ed1bb0 100755 --- a/include/boost/type_traits/integral_constant.hpp +++ b/include/boost/type_traits/integral_constant.hpp @@ -19,42 +19,7 @@ template #endif struct integral_constant : public mpl::integral_c { - //BOOST_STATIC_CONSTANT(T, value = val); - //typedef T value_type; typedef integral_constant type; - -#if 0 - // - // everything that follows now, is MPL-compatibility code: - // - typedef ::boost::mpl::integral_c_tag tag; - - // have to #ifdef here: some compilers don't like the 'val + 1' form (MSVC), - // while some other don't like 'value + 1' (Borland), and some don't like - // either -#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243) -private: - BOOST_STATIC_CONSTANT(T, next_value = BOOST_MPL_AUX_STATIC_CAST(T, (val + 1))); - BOOST_STATIC_CONSTANT(T, prior_value = BOOST_MPL_AUX_STATIC_CAST(T, (val - 1))); -public: - typedef integral_constant next; - typedef integral_constant prior; -#elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \ - || BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(502)) \ - || BOOST_WORKAROUND(__HP_aCC, BOOST_TESTED_AT(53800)) - typedef integral_constant next; - typedef integral_constant prior; -#else - typedef integral_constant next; - typedef integral_constant prior; -#endif - - // enables uniform function call syntax for families of overloaded - // functions that return objects of both arithmetic ('int', 'long', - // 'double', etc.) and wrapped integral types (for an example, see - // "mpl/example/power.cpp") - operator T() const { return static_cast(this->value); } -#endif }; template<> struct integral_constant : public mpl::true_ From 51dda56abdfd3b99d7f836f86c6ed772739e3c74 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 9 Dec 2006 09:33:22 +0000 Subject: [PATCH 29/56] Fix cv qualified pointer types so they are recognised as pointers. [SVN r36306] --- .../type_traits/is_member_function_pointer.hpp | 3 ++- include/boost/type_traits/is_member_pointer.hpp | 3 +++ include/boost/type_traits/is_pointer.hpp | 17 ++++++++++++++--- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/include/boost/type_traits/is_member_function_pointer.hpp b/include/boost/type_traits/is_member_function_pointer.hpp index edfc5ad..5b32385 100644 --- a/include/boost/type_traits/is_member_function_pointer.hpp +++ b/include/boost/type_traits/is_member_function_pointer.hpp @@ -22,6 +22,7 @@ // version does not do so. // # include +# include #else # include # include @@ -41,7 +42,7 @@ namespace boost { BOOST_TT_AUX_BOOL_TRAIT_DEF1( is_member_function_pointer , T - , ::boost::type_traits::is_mem_fun_pointer_impl::value + , ::boost::type_traits::is_mem_fun_pointer_impl::type>::value ) #else diff --git a/include/boost/type_traits/is_member_pointer.hpp b/include/boost/type_traits/is_member_pointer.hpp index 73300d3..b098afb 100644 --- a/include/boost/type_traits/is_member_pointer.hpp +++ b/include/boost/type_traits/is_member_pointer.hpp @@ -47,6 +47,9 @@ BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer, #elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,::boost::is_member_function_pointer::value) BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*,true) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*const,true) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*volatile,true) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*const volatile,true) #else // no partial template specialization diff --git a/include/boost/type_traits/is_pointer.hpp b/include/boost/type_traits/is_pointer.hpp index 8c15545..db0701e 100644 --- a/include/boost/type_traits/is_pointer.hpp +++ b/include/boost/type_traits/is_pointer.hpp @@ -25,6 +25,9 @@ #include #include #include +#if !BOOST_WORKAROUND(BOOST_MSVC,<=1300) +#include +#endif #ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION # include @@ -56,15 +59,13 @@ template< typename T > struct helper \ /**/ TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T*,true) -TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T* const,true) -TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T* volatile,true) -TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T* const volatile,true) # undef TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC template< typename T > struct is_pointer_impl { +#if BOOST_WORKAROUND(BOOST_MSVC,<=1300) BOOST_STATIC_CONSTANT(bool, value = (::boost::type_traits::ice_and< ::boost::detail::is_pointer_helper::value @@ -73,6 +74,16 @@ struct is_pointer_impl >::value >::value) ); +#else + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_and< + ::boost::detail::is_pointer_helper::type>::value + , ::boost::type_traits::ice_not< + ::boost::is_member_pointer::value + >::value + >::value) + ); +#endif }; } // namespace detail From 48232e77cba8912c31098b59333e8f39ac27ad47 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 9 Dec 2006 09:34:19 +0000 Subject: [PATCH 30/56] Added additional tests for cv-qualified pointer types: these all fail and add new regressions for old compilers, hence their location here. [SVN r36307] --- test/tricky_partial_spec_test.cpp | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/test/tricky_partial_spec_test.cpp b/test/tricky_partial_spec_test.cpp index 92c4714..ce7e005 100644 --- a/test/tricky_partial_spec_test.cpp +++ b/test/tricky_partial_spec_test.cpp @@ -18,6 +18,10 @@ #include #include #include +#include +#include +#include +#include #endif #include #include @@ -80,6 +84,34 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_polymorphic::va BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_polymorphic::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_polymorphic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_object_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_object_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_object_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_object_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_object_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_object_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_object_pointer::value, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, true); + TT_TEST_END From f79939445709dc829382d659b08716adbcda8d25 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 12 Dec 2006 16:14:41 +0000 Subject: [PATCH 31/56] Fix is_base_of example. [SVN r36348] --- doc/type_traits.qbk | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/type_traits.qbk b/doc/type_traits.qbk index 5461646..8795f12 100644 --- a/doc/type_traits.qbk +++ b/doc/type_traits.qbk @@ -1795,11 +1795,11 @@ __examples [:`is_base_of::value` is an integral constant expression that evaluates to /true/.] -[:`is_base_of::value` is an integral constant -expression that evaluates to /false/: a class is not it's own base.] +[:`is_base_of::value` is an integral constant +expression that evaluates to /true/.] -[:`is_base_of::value` is an integral constant -expression that evaluates to /false/: the arguments are the wrong way round.] +[:`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`.] @@ -2994,3 +2994,5 @@ www.boost.org/more/mailing_lists.htm#main] for subscription details). [endsect] + + From ae6dd08936d3cc8b0ff2d44c9e63cdc8c0fca471 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 22 Dec 2006 10:08:55 +0000 Subject: [PATCH 32/56] Typo fix. [SVN r36486] --- doc/type_traits.qbk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/type_traits.qbk b/doc/type_traits.qbk index 8795f12..c7b7233 100644 --- a/doc/type_traits.qbk +++ b/doc/type_traits.qbk @@ -683,7 +683,7 @@ The first part guarantees the successful compilation of something like this: and the second part provides the library's users with a mechanism to make the above code work not only for `char`, `int` or other built-in type, -but for they own types as well: +but for their own types as well: namespace myspace{ struct MyClass {}; From 820cae7c2ccffd12e0a5c0fb82b043f0cd229f81 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sun, 31 Dec 2006 17:29:18 +0000 Subject: [PATCH 33/56] removed dead file. [SVN r36553] --- test/Jamfile | 76 ---------------------------------------------------- 1 file changed, 76 deletions(-) delete mode 100644 test/Jamfile diff --git a/test/Jamfile b/test/Jamfile deleted file mode 100644 index ce5b6b1..0000000 --- a/test/Jamfile +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright John Maddock 2004 -# 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) -# -# There are two ways to invoke this Jamfile: -# -# If we pass the argument --type-traits-unit-test -# to bjam, then the tests are built as one big test -# program: this may be slightly quicker in some cases, -# but causes problems if any of the test sources don't compile. -# -# Alternatively, the default behaviour is to build each source -# file as a separate test program, these no longer depend upon Boost.Test -# (which causes cyclic dependencies). We also get a separate status report -# for each trait, which makes it easier to track down issues with non-conforming -# compilers. -# - -subproject libs/type_traits/test ; - -# bring in the rules for testing -import testing ; - -# -# define the sources which need testing, mostly this is just -# all the files *_test.cpp, but any badly named examples can -# be added to this list :-) -# -TEST_SOURCES = [ GLOB $(BOOST_ROOT)/libs/type_traits/test : *_test.cpp ] - udt_specialisations.cpp ; - -if --type-traits-unit-test in $(ARGV) -{ - test-suite type_traits : - [ run # sources: - $(TEST_SOURCES) - init.cpp - # dependencies - ../../test/build/boost_unit_test_framework - : # additional args - --report_level=detailed --build_info=yes --log_level=messages - : # test-files - : # requirements - $(BOOST_ROOT) - USE_UNIT_TEST=1 - : # test name - type_traits_test - ] ; - -} -else -{ - # this rule enumerates through all the sources and invokes - # the run rule for each source, the result is a list of all - # the run rules, which we can pass on to the test_suite rule: - rule test_all - { - #ECHO executing test_all rule ; - local all_rules = ; - for local file in $(TEST_SOURCES) - { - all_rules += [ run $(file) ] ; - } - #ECHO $(all_rules) ; - return $(all_rules) ; - } - - test-suite type_traits : - [ test_all r ] - ; # type traits suite - -} - - - From 6378e00d865b15ec34db90178e7f1913951e677b Mon Sep 17 00:00:00 2001 From: Alexander Nasonov Date: Wed, 6 Jun 2007 20:02:45 +0000 Subject: [PATCH 34/56] Apply patch posted in 'attempt to patch floating_point_promotion on borland' message and wait for regression test results. http://lists.boost.org/Archives/boost/2007/06/122727.php [SVN r37919] --- include/boost/type_traits.hpp | 2 -- .../type_traits/floating_point_promotion.hpp | 30 +++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/include/boost/type_traits.hpp b/include/boost/type_traits.hpp index 80c9954..afba2ea 100644 --- a/include/boost/type_traits.hpp +++ b/include/boost/type_traits.hpp @@ -70,13 +70,11 @@ #include "boost/type_traits/type_with_alignment.hpp" #include "boost/type_traits/function_traits.hpp" #include "boost/type_traits/aligned_storage.hpp" -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x564) #include "boost/type_traits/floating_point_promotion.hpp" #if !(defined(__sgi) && defined(__EDG_VERSION__) && (__EDG_VERSION__ == 238)) #include "boost/type_traits/integral_promotion.hpp" #include "boost/type_traits/promote.hpp" #endif -#endif // Borland #include "boost/type_traits/ice.hpp" diff --git a/include/boost/type_traits/floating_point_promotion.hpp b/include/boost/type_traits/floating_point_promotion.hpp index 23d8a7f..8b6ae3a 100644 --- a/include/boost/type_traits/floating_point_promotion.hpp +++ b/include/boost/type_traits/floating_point_promotion.hpp @@ -8,6 +8,15 @@ #include +#ifdef BOOST_NO_CV_SPECIALIZATIONS +#include +#include +#include +#include +#include +#include +#endif + // Should be the last #include #include @@ -15,6 +24,8 @@ namespace boost { namespace type_traits { namespace detail { +#ifndef BOOST_NO_CV_SPECIALIZATIONS + template struct floating_point_promotion { @@ -45,6 +56,25 @@ struct floating_point_promotion typedef double const volatile type; }; +#else + +template +struct floating_point_promotion + : mpl::at< + mpl::vector< T, double, double const, double volatile, + double const volatile > + , mpl::plus< + is_same + , mpl::multiplies< is_same , mpl::int_<2> > + , mpl::multiplies< is_same , mpl::int_<3> > + , mpl::multiplies< is_same, mpl::int_<4> > + > + > +{ +}; + +#endif + } } BOOST_TT_AUX_TYPE_TRAIT_DEF1( From 4d0bcdc9f57465229043aff25cac710415223e76 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 10 Sep 2007 09:19:49 +0000 Subject: [PATCH 35/56] Big type_traits update: Added make_signed, make_unsigned and is_complex. Added docs for some previously undocumented traits: is_signed, is_unsigned and decay.html Added synonyms for some traits that have changed name in the latest C++ std draft. Re-organised docs, moved docs out of the main doc build for now (it takes too long). This also fixes issues: http://svn.boost.org/trac/boost/ticket/492 and http://svn.boost.org/trac/boost/ticket/1008. [SVN r39175] --- cxx_type_traits.htm | 9 +- doc/Jamfile.v2 | 51 +- doc/add_const.qbk | 33 + doc/add_cv.qbk | 33 + doc/add_pointer.qbk | 37 + doc/add_reference.qbk | 33 + doc/add_volatile.qbk | 33 + doc/aligned_storage.qbk | 14 + doc/alignment_of.qbk | 26 + doc/alignment_traits.qbk | 16 + doc/background.qbk | 314 ++ doc/credits.qbk | 33 + doc/decay.qbk | 32 + doc/decomposing_func.qbk | 12 + doc/examples.qbk | 211 ++ doc/extent.qbk | 33 + doc/floating_point_promotion.qbk | 29 + doc/function_traits.qbk | 42 + doc/has_nothrow_assign.qbk | 21 + doc/has_nothrow_constructor.qbk | 26 + doc/has_nothrow_copy.qbk | 26 + doc/has_trivial_assign.qbk | 39 + doc/has_trivial_constructor.qbk | 47 + doc/has_trivial_copy.qbk | 45 + doc/has_trivial_destructor.qbk | 41 + doc/has_virtual_destructor.qbk | 20 + doc/html/boost_typetraits/background.html | 690 ++++ doc/html/boost_typetraits/category.html | 60 + .../boost_typetraits/category/alignment.html | 59 + .../boost_typetraits/category/background.html | 699 ++++ .../boost_typetraits/category/function.html | 56 + .../boost_typetraits/category/transform.html | 165 + .../category/value_traits.html | 61 + .../category/value_traits/primary.html | 128 + .../category/value_traits/properties.html | 122 + .../category/value_traits/relate.html | 60 + doc/html/boost_typetraits/credits.html | 74 + doc/html/boost_typetraits/examples.html | 54 + doc/html/boost_typetraits/examples/copy.html | 92 + .../boost_typetraits/examples/destruct.html | 79 + doc/html/boost_typetraits/examples/fill.html | 86 + doc/html/boost_typetraits/examples/iter.html | 95 + .../boost_typetraits/examples/to_double.html | 55 + doc/html/boost_typetraits/intrinsics.html | 240 ++ doc/html/boost_typetraits/intro.html | 61 + doc/html/boost_typetraits/mpl.html | 58 + doc/html/boost_typetraits/reference.html | 117 + .../boost_typetraits/reference/add_const.html | 142 + .../boost_typetraits/reference/add_cv.html | 145 + .../reference/add_pointer.html | 144 + .../reference/add_reference.html | 141 + .../reference/add_volatile.html | 143 + .../reference/aligned_storage.html | 59 + .../reference/alignment_of.html | 102 + .../boost_typetraits/reference/decay.html | 148 + .../boost_typetraits/reference/extent.html | 134 + .../reference/floating_point_promotion.html | 126 + .../reference/function_traits.html | 261 ++ .../reference/has_no_throw_def_cons.html | 45 + .../reference/has_nothrow_assign.html | 70 + .../reference/has_nothrow_constructor.html | 77 + .../reference/has_nothrow_copy.html | 76 + .../reference/has_nothrow_cp_cons.html | 45 + .../reference/has_trivial_assign.html | 127 + .../reference/has_trivial_constructor.html | 137 + .../reference/has_trivial_copy.html | 133 + .../reference/has_trivial_cp_cons.html | 45 + .../reference/has_trivial_def_cons.html | 45 + .../reference/has_trivial_destructor.html | 130 + .../reference/has_virtual_destructor.html | 69 + .../reference/integral_constant.html | 61 + .../reference/integral_promotion.html | 126 + .../reference/is_abstract.html | 119 + .../reference/is_arithmetic.html | 102 + .../boost_typetraits/reference/is_array.html | 105 + .../reference/is_base_of.html | 154 + .../boost_typetraits/reference/is_class.html | 138 + .../reference/is_complex.html | 60 + .../reference/is_compound.html | 121 + .../boost_typetraits/reference/is_const.html | 131 + .../reference/is_convertible.html | 172 + .../boost_typetraits/reference/is_empty.html | 134 + .../boost_typetraits/reference/is_enum.html | 138 + .../reference/is_floating_point.html | 100 + .../reference/is_function.html | 213 ++ .../reference/is_fundamental.html | 105 + .../reference/is_integral.html | 101 + .../reference/is_member_function_pointer.html | 115 + .../reference/is_member_object_pointer.html | 115 + .../reference/is_member_pointer.html | 101 + .../boost_typetraits/reference/is_object.html | 144 + .../boost_typetraits/reference/is_pod.html | 131 + .../reference/is_pointer.html | 144 + .../reference/is_polymorphic.html | 117 + .../reference/is_reference.html | 108 + .../boost_typetraits/reference/is_same.html | 122 + .../boost_typetraits/reference/is_scalar.html | 137 + .../boost_typetraits/reference/is_signed.html | 131 + .../reference/is_stateless.html | 87 + .../boost_typetraits/reference/is_union.html | 124 + .../reference/is_unsigned.html | 133 + .../boost_typetraits/reference/is_void.html | 111 + .../reference/is_volatile.html | 111 + .../reference/make_signed.html | 157 + .../reference/make_unsigned.html | 158 + .../boost_typetraits/reference/promote.html | 127 + doc/html/boost_typetraits/reference/rank.html | 122 + .../reference/remove_all_extents.html | 154 + .../reference/remove_const.html | 154 + .../boost_typetraits/reference/remove_cv.html | 154 + .../reference/remove_extent.html | 154 + .../reference/remove_pointer.html | 153 + .../reference/remove_reference.html | 141 + .../reference/remove_volatile.html | 154 + .../reference/type_with_alignment.html | 58 + doc/html/boost_typetraits/user_defined.html | 77 + doc/html/index.html | 164 + doc/integral_constant.qbk | 18 + doc/integral_promotion.qbk | 29 + doc/intrinsics.qbk | 54 + doc/is_abstract.qbk | 33 + doc/is_arithmetic.qbk | 24 + doc/is_array.qbk | 27 + doc/is_base_of.qbk | 46 + doc/is_class.qbk | 37 + doc/is_complex.qbk | 13 + doc/is_compound.qbk | 30 + doc/is_const.qbk | 35 + doc/is_convertible.qbk | 58 + doc/is_empty.qbk | 37 + doc/is_enum.qbk | 36 + doc/is_floating_point.qbk | 23 + doc/is_function.qbk | 66 + doc/is_fundamental.qbk | 24 + doc/is_integral.qbk | 23 + doc/is_member_function_pointer.qbk | 29 + doc/is_member_object_pointer.qbk | 29 + doc/is_member_pointer.qbk | 25 + doc/is_object.qbk | 37 + doc/is_pod.qbk | 43 + doc/is_pointer.qbk | 37 + doc/is_polymorphic.qbk | 29 + doc/is_reference.qbk | 29 + doc/is_same.qbk | 30 + doc/is_scalar.qbk | 36 + doc/is_signed.qbk | 34 + doc/is_stateless.qbk | 32 + doc/is_union.qbk | 35 + doc/is_unsigned.qbk | 34 + doc/is_void.qbk | 26 + doc/is_volatile.qbk | 27 + doc/make_signed.qbk | 39 + doc/make_unsigned.qbk | 39 + doc/mpl.qbk | 12 + doc/promote.qbk | 30 + doc/rank.qbk | 29 + doc/remove_all_extents.qbk | 36 + doc/remove_const.qbk | 35 + doc/remove_cv.qbk | 35 + doc/remove_extent.qbk | 36 + doc/remove_pointer.qbk | 35 + doc/remove_reference.qbk | 33 + doc/remove_volatile.qbk | 35 + doc/transform_traits.qbk | 110 + doc/type_traits.qbk | 3085 +---------------- doc/type_with_alignment.qbk | 14 + doc/user_defined.qbk | 35 + doc/value_traits.qbk | 187 + include/boost/type_traits.hpp | 4 + .../type_traits/has_nothrow_constructor.hpp | 1 + .../boost/type_traits/has_nothrow_copy.hpp | 1 + .../type_traits/has_trivial_constructor.hpp | 1 + .../boost/type_traits/has_trivial_copy.hpp | 1 + include/boost/type_traits/is_complex.hpp | 34 + include/boost/type_traits/is_signed.hpp | 4 +- include/boost/type_traits/is_unsigned.hpp | 4 +- include/boost/type_traits/make_signed.hpp | 136 + include/boost/type_traits/make_unsigned.hpp | 136 + index.html | 10 +- test/is_complex_test.cpp | 45 + test/make_signed_test.cpp | 107 + test/make_unsigned_test.cpp | 107 + 182 files changed, 15452 insertions(+), 2938 deletions(-) create mode 100644 doc/add_const.qbk create mode 100644 doc/add_cv.qbk create mode 100644 doc/add_pointer.qbk create mode 100644 doc/add_reference.qbk create mode 100644 doc/add_volatile.qbk create mode 100644 doc/aligned_storage.qbk create mode 100644 doc/alignment_of.qbk create mode 100644 doc/alignment_traits.qbk create mode 100644 doc/background.qbk create mode 100644 doc/credits.qbk create mode 100644 doc/decay.qbk create mode 100644 doc/decomposing_func.qbk create mode 100644 doc/examples.qbk create mode 100644 doc/extent.qbk create mode 100644 doc/floating_point_promotion.qbk create mode 100644 doc/function_traits.qbk create mode 100644 doc/has_nothrow_assign.qbk create mode 100644 doc/has_nothrow_constructor.qbk create mode 100644 doc/has_nothrow_copy.qbk create mode 100644 doc/has_trivial_assign.qbk create mode 100644 doc/has_trivial_constructor.qbk create mode 100644 doc/has_trivial_copy.qbk create mode 100644 doc/has_trivial_destructor.qbk create mode 100644 doc/has_virtual_destructor.qbk create mode 100644 doc/html/boost_typetraits/background.html create mode 100644 doc/html/boost_typetraits/category.html create mode 100644 doc/html/boost_typetraits/category/alignment.html create mode 100644 doc/html/boost_typetraits/category/background.html create mode 100644 doc/html/boost_typetraits/category/function.html create mode 100644 doc/html/boost_typetraits/category/transform.html create mode 100644 doc/html/boost_typetraits/category/value_traits.html create mode 100644 doc/html/boost_typetraits/category/value_traits/primary.html create mode 100644 doc/html/boost_typetraits/category/value_traits/properties.html create mode 100644 doc/html/boost_typetraits/category/value_traits/relate.html create mode 100644 doc/html/boost_typetraits/credits.html create mode 100644 doc/html/boost_typetraits/examples.html create mode 100644 doc/html/boost_typetraits/examples/copy.html create mode 100644 doc/html/boost_typetraits/examples/destruct.html create mode 100644 doc/html/boost_typetraits/examples/fill.html create mode 100644 doc/html/boost_typetraits/examples/iter.html create mode 100644 doc/html/boost_typetraits/examples/to_double.html create mode 100644 doc/html/boost_typetraits/intrinsics.html create mode 100644 doc/html/boost_typetraits/intro.html create mode 100644 doc/html/boost_typetraits/mpl.html create mode 100644 doc/html/boost_typetraits/reference.html create mode 100644 doc/html/boost_typetraits/reference/add_const.html create mode 100644 doc/html/boost_typetraits/reference/add_cv.html create mode 100644 doc/html/boost_typetraits/reference/add_pointer.html create mode 100644 doc/html/boost_typetraits/reference/add_reference.html create mode 100644 doc/html/boost_typetraits/reference/add_volatile.html create mode 100644 doc/html/boost_typetraits/reference/aligned_storage.html create mode 100644 doc/html/boost_typetraits/reference/alignment_of.html create mode 100644 doc/html/boost_typetraits/reference/decay.html create mode 100644 doc/html/boost_typetraits/reference/extent.html create mode 100644 doc/html/boost_typetraits/reference/floating_point_promotion.html create mode 100644 doc/html/boost_typetraits/reference/function_traits.html create mode 100644 doc/html/boost_typetraits/reference/has_no_throw_def_cons.html create mode 100644 doc/html/boost_typetraits/reference/has_nothrow_assign.html create mode 100644 doc/html/boost_typetraits/reference/has_nothrow_constructor.html create mode 100644 doc/html/boost_typetraits/reference/has_nothrow_copy.html create mode 100644 doc/html/boost_typetraits/reference/has_nothrow_cp_cons.html create mode 100644 doc/html/boost_typetraits/reference/has_trivial_assign.html create mode 100644 doc/html/boost_typetraits/reference/has_trivial_constructor.html create mode 100644 doc/html/boost_typetraits/reference/has_trivial_copy.html create mode 100644 doc/html/boost_typetraits/reference/has_trivial_cp_cons.html create mode 100644 doc/html/boost_typetraits/reference/has_trivial_def_cons.html create mode 100644 doc/html/boost_typetraits/reference/has_trivial_destructor.html create mode 100644 doc/html/boost_typetraits/reference/has_virtual_destructor.html create mode 100644 doc/html/boost_typetraits/reference/integral_constant.html create mode 100644 doc/html/boost_typetraits/reference/integral_promotion.html create mode 100644 doc/html/boost_typetraits/reference/is_abstract.html create mode 100644 doc/html/boost_typetraits/reference/is_arithmetic.html create mode 100644 doc/html/boost_typetraits/reference/is_array.html create mode 100644 doc/html/boost_typetraits/reference/is_base_of.html create mode 100644 doc/html/boost_typetraits/reference/is_class.html create mode 100644 doc/html/boost_typetraits/reference/is_complex.html create mode 100644 doc/html/boost_typetraits/reference/is_compound.html create mode 100644 doc/html/boost_typetraits/reference/is_const.html create mode 100644 doc/html/boost_typetraits/reference/is_convertible.html create mode 100644 doc/html/boost_typetraits/reference/is_empty.html create mode 100644 doc/html/boost_typetraits/reference/is_enum.html create mode 100644 doc/html/boost_typetraits/reference/is_floating_point.html create mode 100644 doc/html/boost_typetraits/reference/is_function.html create mode 100644 doc/html/boost_typetraits/reference/is_fundamental.html create mode 100644 doc/html/boost_typetraits/reference/is_integral.html create mode 100644 doc/html/boost_typetraits/reference/is_member_function_pointer.html create mode 100644 doc/html/boost_typetraits/reference/is_member_object_pointer.html create mode 100644 doc/html/boost_typetraits/reference/is_member_pointer.html create mode 100644 doc/html/boost_typetraits/reference/is_object.html create mode 100644 doc/html/boost_typetraits/reference/is_pod.html create mode 100644 doc/html/boost_typetraits/reference/is_pointer.html create mode 100644 doc/html/boost_typetraits/reference/is_polymorphic.html create mode 100644 doc/html/boost_typetraits/reference/is_reference.html create mode 100644 doc/html/boost_typetraits/reference/is_same.html create mode 100644 doc/html/boost_typetraits/reference/is_scalar.html create mode 100644 doc/html/boost_typetraits/reference/is_signed.html create mode 100644 doc/html/boost_typetraits/reference/is_stateless.html create mode 100644 doc/html/boost_typetraits/reference/is_union.html create mode 100644 doc/html/boost_typetraits/reference/is_unsigned.html create mode 100644 doc/html/boost_typetraits/reference/is_void.html create mode 100644 doc/html/boost_typetraits/reference/is_volatile.html create mode 100644 doc/html/boost_typetraits/reference/make_signed.html create mode 100644 doc/html/boost_typetraits/reference/make_unsigned.html create mode 100644 doc/html/boost_typetraits/reference/promote.html create mode 100644 doc/html/boost_typetraits/reference/rank.html create mode 100644 doc/html/boost_typetraits/reference/remove_all_extents.html create mode 100644 doc/html/boost_typetraits/reference/remove_const.html create mode 100644 doc/html/boost_typetraits/reference/remove_cv.html create mode 100644 doc/html/boost_typetraits/reference/remove_extent.html create mode 100644 doc/html/boost_typetraits/reference/remove_pointer.html create mode 100644 doc/html/boost_typetraits/reference/remove_reference.html create mode 100644 doc/html/boost_typetraits/reference/remove_volatile.html create mode 100644 doc/html/boost_typetraits/reference/type_with_alignment.html create mode 100644 doc/html/boost_typetraits/user_defined.html create mode 100644 doc/html/index.html create mode 100644 doc/integral_constant.qbk create mode 100644 doc/integral_promotion.qbk create mode 100644 doc/intrinsics.qbk create mode 100644 doc/is_abstract.qbk create mode 100644 doc/is_arithmetic.qbk create mode 100644 doc/is_array.qbk create mode 100644 doc/is_base_of.qbk create mode 100644 doc/is_class.qbk create mode 100644 doc/is_complex.qbk create mode 100644 doc/is_compound.qbk create mode 100644 doc/is_const.qbk create mode 100644 doc/is_convertible.qbk create mode 100644 doc/is_empty.qbk create mode 100644 doc/is_enum.qbk create mode 100644 doc/is_floating_point.qbk create mode 100644 doc/is_function.qbk create mode 100644 doc/is_fundamental.qbk create mode 100644 doc/is_integral.qbk create mode 100644 doc/is_member_function_pointer.qbk create mode 100644 doc/is_member_object_pointer.qbk create mode 100644 doc/is_member_pointer.qbk create mode 100644 doc/is_object.qbk create mode 100644 doc/is_pod.qbk create mode 100644 doc/is_pointer.qbk create mode 100644 doc/is_polymorphic.qbk create mode 100644 doc/is_reference.qbk create mode 100644 doc/is_same.qbk create mode 100644 doc/is_scalar.qbk create mode 100644 doc/is_signed.qbk create mode 100644 doc/is_stateless.qbk create mode 100644 doc/is_union.qbk create mode 100644 doc/is_unsigned.qbk create mode 100644 doc/is_void.qbk create mode 100644 doc/is_volatile.qbk create mode 100644 doc/make_signed.qbk create mode 100644 doc/make_unsigned.qbk create mode 100644 doc/mpl.qbk create mode 100644 doc/promote.qbk create mode 100644 doc/rank.qbk create mode 100644 doc/remove_all_extents.qbk create mode 100644 doc/remove_const.qbk create mode 100644 doc/remove_cv.qbk create mode 100644 doc/remove_extent.qbk create mode 100644 doc/remove_pointer.qbk create mode 100644 doc/remove_reference.qbk create mode 100644 doc/remove_volatile.qbk create mode 100644 doc/transform_traits.qbk create mode 100644 doc/type_with_alignment.qbk create mode 100644 doc/user_defined.qbk create mode 100644 doc/value_traits.qbk create mode 100644 include/boost/type_traits/is_complex.hpp create mode 100644 include/boost/type_traits/make_signed.hpp create mode 100644 include/boost/type_traits/make_unsigned.hpp create mode 100644 test/is_complex_test.cpp create mode 100644 test/make_signed_test.cpp create mode 100644 test/make_unsigned_test.cpp diff --git a/cxx_type_traits.htm b/cxx_type_traits.htm index 4c92a7e..a0f1a68 100644 --- a/cxx_type_traits.htm +++ b/cxx_type_traits.htm @@ -1,13 +1,11 @@ - + - +

Automatic redirection failed, please go to - ../../doc/html/boost_typetraits/background.html - or view the online version at - http://www.boost.org/regression-logs/cs-win32_metacomm/doc/html/boost_typetraits/background.html + doc/html/boost_typetraits/background.html.

Copyright John Maddock 2006

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

@@ -17,3 +15,4 @@ + diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index 789cf02..a642ebe 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -10,10 +10,53 @@ boostbook standalone : type_traits : - nav.layout=none - navig.graphics=0 + # Path for links to Boost: + boost.root=../../../../ + # Path for libraries index: + boost.libraries=../../../libraries.htm + # Use the main Boost stylesheet: + html.stylesheet=../../../../doc/html/boostbook.css + + # Some general style settings: + table.footnote.number.format=1 + footnote.number.format=1 + + # HTML options first: + # Use graphics not text for navigation: + navig.graphics=1 + # How far down we chunk nested sections, basically all of them: + chunk.section.depth=10 + # Don't put the first section on the same page as the TOC: + chunk.first.sections=1 + # How far down sections get TOC's + toc.section.depth=10 + # Max depth in each TOC: + toc.max.depth=4 + # How far down we go with TOC's + generate.section.toc.level=10 + + # PDF Options: + # TOC Generation: this is needed for FOP-0.9 and later: + # fop1.extensions=1 + xep.extensions=1 + # TOC generation: this is needed for FOP 0.2, but must not be set to zero for FOP-0.9! + fop.extensions=0 + # No indent on body text: + body.start.indent=0pt + # Margin size: + page.margin.inner=0.5in + # Margin size: + page.margin.outer=0.5in + # Paper type = A4 + paper.type=A4 + # Yes, we want graphics for admonishments: + admon.graphics=1 + # Set this one for PDF generation *only*: + # default pnd graphics are awful in PDF form, + # better use SVG's instead: + # admon.graphics.extension=".svg" ; -install html : ../../../doc/html/boostbook.css ; -install ../ : ../../../boost.png ; +#install html : ../../../doc/html/boostbook.css ; +#install ../ : ../../../boost.png ; diff --git a/doc/add_const.qbk b/doc/add_const.qbk new file mode 100644 index 0000000..a161036 --- /dev/null +++ b/doc/add_const.qbk @@ -0,0 +1,33 @@ +[section:add_const add_const] + + template + struct add_const + { + typedef __below type; + }; + +__type The same type as `T const` for all `T`. + +__std_ref 3.9.3. + +__compat If the compiler does not support partial specialization of class-templates +then this template will compile, but the member `type` will always be the same as +type `T` except where __transform_workaround have been applied. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`add_const::type`][`int const`]] + +[[`add_const::type`] [`int&`]] + +[[`add_const::type`] [`int* const`]] + +[[`add_const::type`] [`int const`]] + +] + +[endsect] diff --git a/doc/add_cv.qbk b/doc/add_cv.qbk new file mode 100644 index 0000000..1ee893e --- /dev/null +++ b/doc/add_cv.qbk @@ -0,0 +1,33 @@ +[section:add_cv add_cv] + + template + struct add_cv + { + typedef __below type; + }; + +__type The same type as `T const volatile` for all `T`. + +__std_ref 3.9.3. + +__compat If the compiler does not support partial specialization of class-templates +then this template will compile, but the member `type` will always be the same as +type `T` except where __transform_workaround have been applied. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`add_cv::type`][`int const volatile`]] + +[[`add_cv::type`] [`int&`]] + +[[`add_cv::type`] [`int* const volatile`]] + +[[`add_cv::type`] [`int const volatile`]] + +] + +[endsect] diff --git a/doc/add_pointer.qbk b/doc/add_pointer.qbk new file mode 100644 index 0000000..3a81708 --- /dev/null +++ b/doc/add_pointer.qbk @@ -0,0 +1,37 @@ +[section:add_pointer add_pointer] + + template + struct add_pointer + { + typedef __below type; + }; + +__type The same type as `remove_reference::type*`. + +The rationale for this template +is that it produces the same type as `TYPEOF(&t)`, +where `t` is an object of type `T`. + +__std_ref 8.3.1. + +__compat If the compiler does not support partial specialization of class-templates +then this template will compile, but the member `type` will always be the same as +type `T` except where __transform_workaround have been applied. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`add_pointer::type`][`int*`]] + +[[`add_pointer::type`] [`int const*`]] + +[[`add_pointer::type`] [`int**`]] + +[[`add_pointer::type`] [`int**`]] + +] + +[endsect] diff --git a/doc/add_reference.qbk b/doc/add_reference.qbk new file mode 100644 index 0000000..745207d --- /dev/null +++ b/doc/add_reference.qbk @@ -0,0 +1,33 @@ +[section:add_reference add_reference] + + template + struct add_reference + { + typedef __below type; + }; + +__type If `T` is not a reference type then `T&`, otherwise `T`. + +__std_ref 8.3.2. + +__compat If the compiler does not support partial specialization of class-templates +then this template will compile, but the member `type` will always be the same as +type `T` except where __transform_workaround have been applied. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`add_reference::type`][`int&`]] + +[[`add_reference::type`] [`int const&`]] + +[[`add_reference::type`] [`int*&`]] + +[[`add_reference::type`] [`int*&`]] + +] + +[endsect] diff --git a/doc/add_volatile.qbk b/doc/add_volatile.qbk new file mode 100644 index 0000000..a285295 --- /dev/null +++ b/doc/add_volatile.qbk @@ -0,0 +1,33 @@ +[section:add_volatile add_volatile] + + template + struct add_volatile + { + typedef __below type; + }; + +__type The same type as `T volatile` for all `T`. + +__std_ref 3.9.3. + +__compat If the compiler does not support partial specialization of class-templates +then this template will compile, but the member `type` will always be the same as +type `T` except where __transform_workaround have been applied. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`add_volatile::type`][`int volatile`]] + +[[`add_volatile::type`] [`int&`]] + +[[`add_volatile::type`] [`int* volatile`]] + +[[`add_volatile::type`] [`int const volatile`]] + +] + +[endsect] diff --git a/doc/aligned_storage.qbk b/doc/aligned_storage.qbk new file mode 100644 index 0000000..ac00879 --- /dev/null +++ b/doc/aligned_storage.qbk @@ -0,0 +1,14 @@ +[section:aligned_storage aligned_storage] + + template + struct aligned_storage + { + typedef __below type; + }; + +__type a built-in or POD type with size `Size` and an alignment +that is a multiple of `Align`. + +__header ` #include ` or ` #include ` + +[endsect] diff --git a/doc/alignment_of.qbk b/doc/alignment_of.qbk new file mode 100644 index 0000000..001b74d --- /dev/null +++ b/doc/alignment_of.qbk @@ -0,0 +1,26 @@ +[section:alignment_of alignment_of] + template + struct alignment_of : public __integral_constant {}; + +__inherit Class template alignment_of inherits from +`__integral_constant`, where `ALIGNOF(T)` is the +alignment of type T. + +['Note: strictly speaking you should only rely on +the value of `ALIGNOF(T)` being a multiple of the true alignment of T, although +in practice it does compute the correct value in all the cases we know about.] + +__header ` #include ` or ` #include ` + +__examples + +[:`alignment_of` inherits from `__integral_constant`.] + +[:`alignment_of::type` is the type `__integral_constant`.] + +[:`alignment_of::value` is an integral constant +expression with value `ALIGNOF(double)`.] + +[:`alignment_of::value_type` is the type `std::size_t`.] + +[endsect] diff --git a/doc/alignment_traits.qbk b/doc/alignment_traits.qbk new file mode 100644 index 0000000..59b38cd --- /dev/null +++ b/doc/alignment_traits.qbk @@ -0,0 +1,16 @@ +[section:alignment Synthesizing Types with Specific Alignments] + +Some low level memory management routines need to synthesize a POD type with +specific alignment properties. The template `__type_with_alignment` finds the smallest +type with a specified alignment, while template `__aligned_storage` creates a type +with a specific size and alignment. + +[*Synopsis] + + template + struct __type_with_alignment; + + template + struct __aligned_storage; + +[endsect] diff --git a/doc/background.qbk b/doc/background.qbk new file mode 100644 index 0000000..a56d661 --- /dev/null +++ b/doc/background.qbk @@ -0,0 +1,314 @@ +[section:background Background and Tutorial] + +The following is an updated version of the article "C++ Type traits" +by John Maddock and Steve Cleary that appeared in the October 2000 +issue of [@http://www.ddj.com Dr Dobb's Journal]. + +Generic programming (writing code which works with any data type meeting a +set of requirements) has become the method of choice for providing reusable code. +However, there are times in generic programming when "generic" just isn't +good enough - sometimes the differences between types are too large for an +efficient generic implementation. This is when the traits technique +becomes important - by encapsulating those properties that need to be +considered on a type by type basis inside a traits class, we can +minimize the amount of code that has to differ from one type to another, +and maximize the amount of generic code. + +Consider an example: when working with character strings, one common operation is +to determine the length of a null terminated string. Clearly it's possible to +write generic code that can do this, but it turns out that there are much more +efficient methods available: for example, the C library functions `strlen` and +`wcslen` are usually written in assembler, and with suitable hardware support +can be considerably faster than a generic version written in C++. +The authors of the C++ standard library realized this, and abstracted the +properties of `char` and `wchar_t` into the class `char_traits`. Generic code +that works with character strings can simply use `char_traits<>::length` to +determine the length of a null terminated string, safe in the knowledge +that specializations of `char_traits` will use the most appropriate method +available to them. + +[h4 Type Traits] + +Class `char_traits` is a classic example of a collection of type specific +properties wrapped up in a single class - what Nathan Myers termed a +/baggage class/[link background.references \[1\]]. In the Boost type-traits library, we[link background.references \[2\]] have written a +set of very specific traits classes, each of which encapsulate a single trait +from the C++ type system; for example, is a type a pointer or a reference type? +Or does a type have a trivial constructor, or a const-qualifier? +The type-traits classes share a unified design: each class inherits from a +the type __true_type if the type has the specified property and inherits from +__false_type otherwise. As we will show, these classes can be used in +generic programming to determine the properties of a given type and introduce +optimizations that are appropriate for that case. + +The type-traits library also contains a set of classes that perform a +specific transformation on a type; for example, they can remove a +top-level const or volatile qualifier from a type. Each class that +performs a transformation defines a single typedef-member `type` +that is the result of the transformation. All of the type-traits +classes are defined inside namespace `boost`; for brevity, namespace-qualification +is omitted in most of the code samples given. + +[h4 Implementation] + +There are far too many separate classes contained in the type-traits library +to give a full implementation here - see the source code in the Boost library +for the full details - however, most of the implementation is fairly repetitive +anyway, so here we will just give you a flavor for how some of the classes are +implemented. Beginning with possibly the simplest class in the library, +`is_void` inherits from `__true_type` only if `T` is `void`. + + template + struct __is_void : public __false_type{}; + + template <> + struct __is_void : public __true_type{}; + +Here we define a primary version of the template class `__is_void`, and +provide a full-specialization when `T` is `void`. While full specialization +of a template class is an important technique, sometimes we need a +solution that is halfway between a fully generic solution, and a full +specialization. This is exactly the situation for which the standards committee +defined partial template-class specialization. As an example, consider the +class `boost::is_pointer`: here we needed a primary version that handles +all the cases where T is not a pointer, and a partial specialization to +handle all the cases where T is a pointer: + + template + struct __is_pointer : public __false_type{}; + + template + struct __is_pointer : public __true_type{}; + +The syntax for partial specialization is somewhat arcane and could easily +occupy an article in its own right; like full specialization, in order to +write a partial specialization for a class, you must first declare the +primary template. The partial specialization contains an extra <...> after the +class name that contains the partial specialization parameters; these define +the types that will bind to that partial specialization rather than the +default template. The rules for what can appear in a partial specialization +are somewhat convoluted, but as a rule of thumb if you can legally write two +function overloads of the form: + + void foo(T); + void foo(U); + +Then you can also write a partial specialization of the form: + + template + class c{ /*details*/ }; + + template + class c{ /*details*/ }; + +This rule is by no means foolproof, but it is reasonably simple to remember +and close enough to the actual rule to be useful for everyday use. + +As a more complex example of partial specialization consider the class +`remove_extent`. This class defines a single typedef-member `type` that +is the same type as T but with any top-level array bounds removed; +this is an example of a traits class that performs a transformation on a type: + + template + struct __remove_extent + { typedef T type; }; + + template + struct __remove_extent + { typedef T type; }; + +The aim of `__remove_extent` is this: imagine a generic algorithm that is +passed an array type as a template parameter, `__remove_extent` provides a +means of determining the underlying type of the array. For example +`remove_extent::type` would evaluate to the type `int[5]`. +This example also shows that the number of template parameters in a +partial specialization does not have to match the number in the +default template. However, the number of parameters that appear after the +class name do have to match the number and type of the parameters in the +default template. + +[h4 Optimized copy] + +As an example of how the type traits classes can be used, consider the +standard library algorithm copy: + + template + Iter2 copy(Iter1 first, Iter1 last, Iter2 out); + +Obviously, there's no problem writing a generic version of copy that works +for all iterator types `Iter1` and `Iter2`; however, there are some +circumstances when the copy operation can best be performed by a call to +`memcpy`. In order to implement copy in terms of `memcpy` all of the +following conditions need to be met: + +* Both of the iterator types `Iter1` and `Iter2` must be pointers. +* Both `Iter1` and `Iter2` must point to the same type - excluding const and +volatile-qualifiers. +* The type pointed to by `Iter1` must have a trivial assignment operator. + +By trivial assignment operator we mean that the type is either a scalar type[link background.references \[3\]] or: + +* The type has no user defined assignment operator. +* The type does not have any data members that are references. +* All base classes, and all data member objects must have trivial assignment operators. + +If all these conditions are met then a type can be copied using `memcpy` +rather than using a compiler generated assignment operator. The type-traits +library provides a class `__has_trivial_assign`, such that +`has_trivial_assign::value` is true only if T has a trivial assignment operator. +This class "just works" for scalar types, but has to be explicitly +specialised for class/struct types that also happen to have a trivial assignment +operator. In other words if __has_trivial_assign gives the wrong answer, +it will give the "safe" wrong answer - that trivial assignment is not allowable. + +The code for an optimized version of copy that uses `memcpy` where appropriate is +given in [link boost_typetraits.examples.copy the examples]. The code begins by defining a template +function `do_copy` that performs a "slow but safe" copy. The last parameter passed +to this function may be either a `__true_type` or a `__false_type`. Following that +there is an overload of do_copy that uses `memcpy`: this time the iterators are required +to actually be pointers to the same type, and the final parameter must be a +`__true_type`. Finally, the version of `copy` calls `do_copy`, passing +`__has_trivial_assign()` as the final parameter: this will dispatch +to the optimized version where appropriate, otherwise it will call the +"slow but safe version". + +[h4 Was it worth it?] + +It has often been repeated in these columns that "premature optimization is the +root of all evil" [link background.references \[4\]]. So the question must be asked: was our optimization +premature? To put this in perspective the timings for our version of copy +compared a conventional generic copy[link background.references \[5\]] are shown in table 1. + +Clearly the optimization makes a difference in this case; but, to be fair, +the timings are loaded to exclude cache miss effects - without this +accurate comparison between algorithms becomes difficult. However, perhaps +we can add a couple of caveats to the premature optimization rule: + +*If you use the right algorithm for the job in the first place then optimization +will not be required; in some cases, memcpy is the right algorithm. +*If a component is going to be reused in many places by many people then +optimizations may well be worthwhile where they would not be so for a single +case - in other words, the likelihood that the optimization will be +absolutely necessary somewhere, sometime is that much higher. +Just as importantly the perceived value of the stock implementation will be +higher: there is no point standardizing an algorithm if users reject it on +the grounds that there are better, more heavily optimized versions available. + +[table Time taken to copy 1000 elements using `copy` (times in micro-seconds) + +[[Version] [T] [Time]] +[["Optimized" copy] [char] [0.99]] +[[Conventional copy] [char] [8.07]] +[["Optimized" copy] [int] [2.52]] +[[Conventional copy] [int] [8.02]] +] + +[h4 Pair of References] +The optimized copy example shows how type traits may be used to perform +optimization decisions at compile-time. Another important usage of type traits +is to allow code to compile that otherwise would not do so unless excessive +partial specialization is used. This is possible by delegating partial +specialization to the type traits classes. Our example for this form of +usage is a pair that can hold references [link background.references \[6\]]. + +First, let us examine the definition of `std::pair`, omitting the +comparison operators, default constructor, and template copy constructor for +simplicity: + + template + struct pair + { + typedef T1 first_type; + typedef T2 second_type; + + T1 first; + T2 second; + + pair(const T1 & nfirst, const T2 & nsecond) + :first(nfirst), second(nsecond) { } + }; + +Now, this "pair" cannot hold references as it currently stands, because the +constructor would require taking a reference to a reference, which is +currently illegal [link background.references \[7\]]. Let us consider what the constructor's parameters +would have to be in order to allow "pair" to hold non-reference types, +references, and constant references: + +[table Required Constructor Argument Types +[[Type of `T1`] [Type of parameter to initializing constructor]] +[[T] [const T &]] +[[T &] [T &]] +[[const T &] [const T &]] +] + +A little familiarity with the type traits classes allows us to construct a +single mapping that allows us to determine the type of parameter from the +type of the contained class. The type traits classes provide a +transformation __add_reference, which adds a reference to its type, +unless it is already a reference. + +[table Using add_reference to synthesize the correct constructor type +[[Type of `T1`] [Type of `const T1`] [Type of `add_reference::type`]] +[[T] [const T] [const T &]] +[[T &] [T & \[8\]] [T &]] +[[const T &] [const T &] [const T &]] +] + +This allows us to build a primary template definition for `pair` that can +contain non-reference types, reference types, and constant reference types: + + template + struct pair + { + typedef T1 first_type; + typedef T2 second_type; + + T1 first; + T2 second; + + pair(boost::__add_reference::type nfirst, + boost::__add_reference::type nsecond) + :first(nfirst), second(nsecond) { } + }; + +Add back in the standard comparison operators, default constructor, +and template copy constructor (which are all the same), and you have a +`std::pair` that can hold reference types! + +This same extension could have been done using partial template specialization +of `pair`, but to specialize `pair` in this way would require three partial +specializations, plus the primary template. Type traits allows us to +define a single primary template that adjusts itself auto-magically to +any of these partial specializations, instead of a brute-force partial +specialization approach. Using type traits in this fashion allows +programmers to delegate partial specialization to the type traits classes, +resulting in code that is easier to maintain and easier to understand. + +[h4 Conclusion] + +We hope that in this article we have been able to give you some idea of +what type-traits are all about. A more complete listing of the available +classes are in the boost documentation, along with further examples using +type traits. Templates have enabled C++ uses to take the advantage of the +code reuse that generic programming brings; hopefully this article has +shown that generic programming does not have to sink to the lowest common +denominator, and that templates can be optimal as well as generic. + +[h4 Acknowledgements] + +The authors would like to thank Beman Dawes and Howard Hinnant for their +helpful comments when preparing this article. + +[h4 [#background.references]References] + +# Nathan C. Myers, C++ Report, June 1995. +# The type traits library is based upon contributions by Steve Cleary, Beman Dawes, Howard Hinnant and John Maddock: it can be found at www.boost.org. +# A scalar type is an arithmetic type (i.e. a built-in integer or floating point type), an enumeration type, a pointer, a pointer to member, or a const- or volatile-qualified version of one of these types. +# This quote is from Donald Knuth, ACM Computing Surveys, December 1974, pg 268. +# The test code is available as part of the boost utility library (see algo_opt_examples.cpp), the code was compiled with gcc 2.95 with all optimisations turned on, tests were conducted on a 400MHz Pentium II machine running Microsoft Windows 98. +# John Maddock and Howard Hinnant have submitted a "compressed_pair" library to Boost, which uses a technique similar to the one described here to hold references. Their pair also uses type traits to determine if any of the types are empty, and will derive instead of contain to conserve space -- hence the name "compressed". +# This is actually an issue with the C++ Core Language Working Group (issue #106), submitted by Bjarne Stroustrup. The tentative resolution is to allow a "reference to a reference to T" to mean the same thing as a "reference to T", but only in template instantiation, in a method similar to multiple cv-qualifiers. +# For those of you who are wondering why this shouldn't be const-qualified, remember that references are always implicitly constant (for example, you can't re-assign a reference). Remember also that "const T &" is something completely different. For this reason, cv-qualifiers on template type arguments that are references are ignored. + +[endsect] + diff --git a/doc/credits.qbk b/doc/credits.qbk new file mode 100644 index 0000000..fd804d6 --- /dev/null +++ b/doc/credits.qbk @@ -0,0 +1,33 @@ +[section:credits Credits] + +This documentation was pulled together by John Maddock, using +[@../../tools/quickbook/doc/html/index.html Boost.Quickbook] +and [@boostbook.html Boost.DocBook]. + +The original version of this library was created by Steve Cleary, +Beman Dawes, Howard Hinnant, and John Maddock. John Maddock is the +current maintainer of the library. + +This version of type traits library is based on contributions by +Adobe Systems Inc, David Abrahams, Steve Cleary, +Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat Marcus, +Itay Maman, John Maddock, Thorsten Ottosen, Robert Ramey and Jeremy Siek. + +Mat Marcus and Jesse Jones invented, and +[@http://opensource.adobe.com/project4/project.shtml published a paper describing], +the partial specialization workarounds used in this library. + +Aleksey Gurtovoy added MPL integration to the library. + +The __is_convertible template is based on code originally devised by +Andrei Alexandrescu, see +"[@http://www.cuj.com/experts/1810/alexandr.htm?topic=experts +Generic: Mappings between Types and Values]". + +The latest version of this library and documentation can be found at +[@http://www.boost.org www.boost.org]. Bugs, suggestions and discussion +should be directed to boost@lists.boost.org +(see [@http://www.boost.org/more/mailing_lists.htm#main +www.boost.org/more/mailing_lists.htm#main] for subscription details). + +[endsect] diff --git a/doc/decay.qbk b/doc/decay.qbk new file mode 100644 index 0000000..d361fff --- /dev/null +++ b/doc/decay.qbk @@ -0,0 +1,32 @@ +[section:decay decay] + + template + struct decay + { + typedef __below type; + }; + +__type Let `U` be the result of `remove_reference::type`, then if `U` is +an array type, the result is `remove_extent*`, otherwise if `U` is a +function type then the result is `U*`, otherwise the result is `U`. + +__std_ref 3.9.1. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`decay::type`][`int[2]*`]] + +[[`decay::type`] [`int*`]] + +[[`decay::type`] [`int(*)(double)`]] + +[[`int(*)(double`] [`int(*)(double)`]] +[[`int(double)`] [`int(*)(double)`]] + +] + +[endsect] diff --git a/doc/decomposing_func.qbk b/doc/decomposing_func.qbk new file mode 100644 index 0000000..ba0b69f --- /dev/null +++ b/doc/decomposing_func.qbk @@ -0,0 +1,12 @@ +[section:function Decomposing Function Types] + +The class template __function_traits extracts information from function types +(see also __is_function). This traits class allows you to tell how many arguments +a function takes, what those argument types are, and what the return type is. + +[*Synopsis] + + template + struct __function_traits; + +[endsect] diff --git a/doc/examples.qbk b/doc/examples.qbk new file mode 100644 index 0000000..b93b3ec --- /dev/null +++ b/doc/examples.qbk @@ -0,0 +1,211 @@ +[section:examples Examples] + +[section:copy An Optimized Version of std::copy] + +Demonstrates a version of `std::copy` that uses `__has_trivial_assign` to +determine whether to use `memcpy` to optimise the copy operation +(see [@../../libs/type_traits/examples/copy_example.cpp copy_example.cpp]): + + // + // opt::copy + // same semantics as std::copy + // calls memcpy where appropriate. + // + + namespace detail{ + + template + I2 copy_imp(I1 first, I1 last, I2 out, const boost::__integral_constant&) + { + while(first != last) + { + *out = *first; + ++out; + ++first; + } + return out; + } + + template + T* copy_imp(const T* first, const T* last, T* out, const boost::__true_type&) + { + memcpy(out, first, (last-first)*sizeof(T)); + return out+(last-first); + } + + + } + + template + inline I2 copy(I1 first, I1 last, I2 out) + { + // + // We can copy with memcpy if T has a trivial assignment operator, + // and if the iterator arguments are actually pointers (this last + // requirement we detect with overload resolution): + // + typedef typename std::iterator_traits::value_type value_type; + return detail::copy_imp(first, last, out, boost::__has_trivial_assign()); + } + + +[endsect] + +[section:fill An Optimised Version of std::fill] + +Demonstrates a version of `std::fill` that uses `__has_trivial_assign` to +determine whether to use `memset` to optimise the fill operation +(see [@../../libs/type_traits/examples/fill_example.cpp fill_example.cpp]): + + // + // fill + // same as std::fill, but uses memset where appropriate + // + namespace detail{ + + template + void do_fill(I first, I last, const T& val, const boost::__integral_constant&) + { + while(first != last) + { + *first = val; + ++first; + } + } + + template + void do_fill(T* first, T* last, const T& val, const boost::__true_type&) + { + std::memset(first, val, last-first); + } + + } + + template + inline void fill(I first, I last, const T& val) + { + // + // We can do an optimised fill if T has a trivial assignment + // operator and if it's size is one: + // + typedef boost::__integral_constant::value && (sizeof(T) == 1)> truth_type; + detail::do_fill(first, last, val, truth_type()); + } + + +[endsect] + +[section:destruct An Example that Omits Destructor Calls For Types with Trivial Destructors] + +Demonstrates a simple algorithm that uses `__has_trivial_destruct` to +determine whether to destructors need to be called +(see [@../../libs/type_traits/examples/trivial_destructor_example.cpp trivial_destructor_example.cpp]): + + // + // algorithm destroy_array: + // The reverse of std::unitialized_copy, takes a block of + // initialized memory and calls destructors on all objects therein. + // + + namespace detail{ + + template + void do_destroy_array(T* first, T* last, const boost::__false_type&) + { + while(first != last) + { + first->~T(); + ++first; + } + } + + template + inline void do_destroy_array(T* first, T* last, const boost::__true_type&) + { + } + + } // namespace detail + + template + inline void destroy_array(T* p1, T* p2) + { + detail::do_destroy_array(p1, p2, ::boost::__has_trivial_destructor()); + } + + +[endsect] + +[section:iter An improved Version of std::iter_swap] + +Demonstrates a version of `std::iter_swap` that use type traits to +determine whether an it's arguments are proxying iterators or not, +if they're not then it just does a `std::swap` of it's dereferenced +arguments (the +same as `std::iter_swap` does), however if they are proxying iterators +then takes special care over the swap to ensure that the algorithm +works correctly for both proxying iterators, and even iterators of +different types +(see [@../../libs/type_traits/examples/iter_swap_example.cpp iter_swap_example.cpp]): + + // + // iter_swap: + // tests whether iterator is a proxying iterator or not, and + // uses optimal form accordingly: + // + namespace detail{ + + template + static void do_swap(I one, I two, const boost::__false_type&) + { + typedef typename std::iterator_traits::value_type v_t; + v_t v = *one; + *one = *two; + *two = v; + } + template + static void do_swap(I one, I two, const boost::__true_type&) + { + using std::swap; + swap(*one, *two); + } + + } + + template + inline void iter_swap(I1 one, I2 two) + { + // + // See is both arguments are non-proxying iterators, + // and if both iterator the same type: + // + typedef typename std::iterator_traits::reference r1_t; + typedef typename std::iterator_traits::reference r2_t; + + typedef boost::__integral_constant::value + && ::boost::__is_reference::value + && ::boost::__is_same::value> truth_type; + + detail::do_swap(one, two, truth_type()); + } + + +[endsect] + +[section:to_double Convert Numeric Types and Enums to double] + +Demonstrates a conversion of +[@../../libs/numeric/conversion/doc/definitions.html#numtypes Numeric Types] +and enum types to double: + + template + inline double to_double(T const& value) + { + typedef typename boost::promote::type promoted; + return boost::numeric::converter::convert(value); + } + +[endsect] + +[endsect] diff --git a/doc/extent.qbk b/doc/extent.qbk new file mode 100644 index 0000000..af09728 --- /dev/null +++ b/doc/extent.qbk @@ -0,0 +1,33 @@ +[section:extent extent] + template + struct extent : public __integral_constant {}; + +__inherit Class template extent inherits from `__integral_constant`, +where `EXTENT(T,N)` is the number of elements in the N'th array dimention of type `T`. + +If `T` is not an array type, or if `N > __rank::value`, or if the N'th array bound +is incomplete, then `EXTENT(T,N)` is zero. + +__header ` #include ` or ` #include ` + +__examples + +[:`extent` inherits from `__integral_constant`.] + +[:`extent::type` is the type `__integral_constant`.] + +[:`extent::value` is an integral constant +expression that evaluates to /4/.] + +[:`extent::value` is an integral constant +expression that evaluates to /0/.] + +[:`extent::value` is an integral constant +expression that evaluates to /2/.] + +[:`extent::value` is an integral constant +expression that evaluates to /0/.] + +[:`extent::value_type` is the type `std::size_t`.] + +[endsect] diff --git a/doc/floating_point_promotion.qbk b/doc/floating_point_promotion.qbk new file mode 100644 index 0000000..12257ab --- /dev/null +++ b/doc/floating_point_promotion.qbk @@ -0,0 +1,29 @@ +[section:floating_point_promotion floating_point_promotion] + + template + struct floating_point_promotion + { + typedef __below type; + }; + +__type If floating point promotion can be applied to an rvalue of type `T`, +then applies floating point promotion to `T` and keeps cv-qualifiers of `T`, +otherwise leaves `T` unchanged. + +__std_ref 4.6. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`floating_point_promotion::type`][`double const`]] + +[[`floating_point_promotion::type`][`float&`]] + +[[`floating_point_promotion::type`][`short`]] + +] + +[endsect] diff --git a/doc/function_traits.qbk b/doc/function_traits.qbk new file mode 100644 index 0000000..ecf220e --- /dev/null +++ b/doc/function_traits.qbk @@ -0,0 +1,42 @@ +[section:function_traits function_traits] +[def __argN '''argN_type'''] + + template + struct function_traits + { + static const std::size_t arity = __below; + typedef __below result_type; + typedef __below __argN; + }; + +The class template function_traits will only compile if: + +* The compiler supports partial specialization of class templates. +* The template argument `T` is a /function type/, note that this ['[*is not]] +the same thing as a /pointer to a function/. + +[table Function Traits Members +[[Member] [Description]] +[[`function_traits::arity`] + [An integral constant expression that gives the number of arguments accepted by the function type `F`.]] +[[`function_traits::result_type`] + [The type returned by function type `F`.]] +[[`function_traits::__argN`] + [The '''Nth''' argument type of function type `F`, where `1 <= N <= arity` of `F`.]] +] + +[table Examples +[[Expression] [Result]] +[[`function_traits::arity`] [An integral constant expression that has the value 0.]] +[[`function_traits::arity`] [An integral constant expression that has the value 1.]] +[[`function_traits::arity`] [An integral constant expression that has the value 4.]] +[[`function_traits::result_type`] [The type `void`.]] +[[`function_traits::result_type`] [The type `long`.]] +[[`function_traits::arg1_type`] [The type `int`.]] +[[`function_traits::arg4_type`] [The type `void*`.]] +[[`function_traits::arg5_type`] [A compiler error: there is no `arg4_type` since there are only three arguments.]] +[[`function_traits::arity`] [A compiler error: argument type is a /function pointer/, and not a /function type/.]] + +] + +[endsect] diff --git a/doc/has_nothrow_assign.qbk b/doc/has_nothrow_assign.qbk new file mode 100644 index 0000000..7763e3f --- /dev/null +++ b/doc/has_nothrow_assign.qbk @@ -0,0 +1,21 @@ +[section:has_nothrow_assign has_nothrow_assign] + + template + struct has_nothrow_assign : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with a non-throwing assignment-operator +then inherits from __true_type, otherwise inherits from __false_type. Type `T` +must be a complete type. + +__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, +`has_nothrow_assign` will never report that a class or struct has a +non-throwing assignment-operator; this is always safe, if possibly sub-optimal. +Currently (May 2005) only Visual C++ 8 has the necessary compiler support to ensure that this +trait "just works". + +__header ` #include ` or ` #include ` + +[endsect] diff --git a/doc/has_nothrow_constructor.qbk b/doc/has_nothrow_constructor.qbk new file mode 100644 index 0000000..1fbc052 --- /dev/null +++ b/doc/has_nothrow_constructor.qbk @@ -0,0 +1,26 @@ +[section:has_nothrow_constructor has_nothrow_constructor] + + template + struct has_nothrow_constructor : public __tof {}; + + template + struct has_nothrow_default_constructor : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with a non-throwing default-constructor +then inherits from __true_type, otherwise inherits from __false_type. Type `T` +must be a complete type. + +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, +`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". + +__header ` #include ` or ` #include ` + +[endsect] diff --git a/doc/has_nothrow_copy.qbk b/doc/has_nothrow_copy.qbk new file mode 100644 index 0000000..52b87b9 --- /dev/null +++ b/doc/has_nothrow_copy.qbk @@ -0,0 +1,26 @@ +[section:has_nothrow_copy has_nothrow_copy] + + template + struct has_nothrow_copy : public __tof {}; + + template + struct has_nothrow_copy_constructor : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with a non-throwing copy-constructor +then inherits from __true_type, otherwise inherits from __false_type. Type `T` +must be a complete type. + +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, +`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". + +__header ` #include ` or ` #include ` + +[endsect] diff --git a/doc/has_trivial_assign.qbk b/doc/has_trivial_assign.qbk new file mode 100644 index 0000000..f356f73 --- /dev/null +++ b/doc/has_trivial_assign.qbk @@ -0,0 +1,39 @@ +[section:has_trivial_assign has_trivial_assign] + template + struct has_trivial_assign : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with a trivial assignment-operator +then inherits from __true_type, otherwise inherits from __false_type. + +If a type has a trivial assignment-operator then the operator has the same effect +as copying the bits of one object to the other: +calls to the operator can be safely replaced with a call to `memcpy`. + +__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, +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. + +__std_ref 12.8p11. + +__header ` #include ` or ` #include ` + +__examples + +[:`has_trivial_assign` inherits from `__true_type`.] + +[:`has_trivial_assign::type` is the type `__true_type`.] + +[:`has_trivial_assign::value` is an integral constant +expression that evaluates to /true/.] + +[:`has_trivial_assign::value` is an integral constant +expression that evaluates to /false/.] + +[:`has_trivial_assign::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/has_trivial_constructor.qbk b/doc/has_trivial_constructor.qbk new file mode 100644 index 0000000..a16fda3 --- /dev/null +++ b/doc/has_trivial_constructor.qbk @@ -0,0 +1,47 @@ +[section:has_trivial_constructor has_trivial_constructor] + + template + struct has_trivial_constructor : public __tof {}; + + template + struct has_trivial_default_constructor : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with a trivial default-constructor +then inherits from __true_type, otherwise inherits from __false_type. + +These two traits are synonyms for each other. + +If a type has a trivial default-constructor then the constructor have no effect: +calls to the constructor can be safely omitted. Note that using meta-programming +to omit a call to a single trivial-constructor call is of no benefit whatsoever. +However, if loops and/or exception handling code can also be omitted, then some +benefit in terms of code size and speed can be obtained. + +__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, +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. + +__std_ref 12.1p6. + +__header ` #include ` or ` #include ` + +__examples + +[:`has_trivial_constructor` inherits from `__true_type`.] + +[:`has_trivial_constructor::type` is the type `__true_type`.] + +[:`has_trivial_constructor::value` is an integral constant +expression that evaluates to /true/.] + +[:`has_trivial_constructor::value` is an integral constant +expression that evaluates to /false/.] + +[:`has_trivial_constructor::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/has_trivial_copy.qbk b/doc/has_trivial_copy.qbk new file mode 100644 index 0000000..4410d8e --- /dev/null +++ b/doc/has_trivial_copy.qbk @@ -0,0 +1,45 @@ +[section:has_trivial_copy has_trivial_copy] + + template + struct has_trivial_copy : public __tof {}; + + template + struct has_trivial_copy_constructor : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with a trivial copy-constructor +then inherits from __true_type, otherwise inherits from __false_type. + +These two traits are synonyms for each other. + +If a type has a trivial copy-constructor then the constructor has the same effect +as copying the bits of one object to the other: +calls to the constructor can be safely replaced with a call to `memcpy`. + +__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, +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. + +__std_ref 12.8p6. + +__header ` #include ` or ` #include ` + +__examples + +[:`has_trivial_copy` inherits from `__true_type`.] + +[:`has_trivial_copy::type` is the type `__true_type`.] + +[:`has_trivial_copy::value` is an integral constant +expression that evaluates to /true/.] + +[:`has_trivial_copy::value` is an integral constant +expression that evaluates to /false/.] + +[:`has_trivial_copy::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/has_trivial_destructor.qbk b/doc/has_trivial_destructor.qbk new file mode 100644 index 0000000..a0ed756 --- /dev/null +++ b/doc/has_trivial_destructor.qbk @@ -0,0 +1,41 @@ +[section:has_trivial_destructor has_trivial_destructor] + template + struct has_trivial_destructor : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with a trivial destructor +then inherits from __true_type, otherwise inherits from __false_type. + +If a type has a trivial destructor then the destructor has no effect: +calls to the destructor can be safely omitted. Note that using meta-programming +to omit a call to a single trivial-constructor call is of no benefit whatsoever. +However, if loops and/or exception handling code can also be omitted, then some +benefit in terms of code size and speed can be obtained. + +__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, +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. + +__std_ref 12.4p3. + +__header ` #include ` or ` #include ` + +__examples + +[:`has_trivial_destructor` inherits from `__true_type`.] + +[:`has_trivial_destructor::type` is the type `__true_type`.] + +[:`has_trivial_destructor::value` is an integral constant +expression that evaluates to /true/.] + +[:`has_trivial_destructor::value` is an integral constant +expression that evaluates to /false/.] + +[:`has_trivial_destructor::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/has_virtual_destructor.qbk b/doc/has_virtual_destructor.qbk new file mode 100644 index 0000000..1498e88 --- /dev/null +++ b/doc/has_virtual_destructor.qbk @@ -0,0 +1,20 @@ +[section:has_virtual_destructor has_virtual_destructor] + template + struct has_virtual_destructor : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with a virtual destructor +then inherits from __true_type, otherwise inherits from __false_type. + +__compat This trait is provided for completeness, since it's part of the +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 has the necessary __intrinsics. + +__std_ref 12.4. + +__header ` #include ` or ` #include ` + +[endsect] diff --git a/doc/html/boost_typetraits/background.html b/doc/html/boost_typetraits/background.html new file mode 100644 index 0000000..e305212 --- /dev/null +++ b/doc/html/boost_typetraits/background.html @@ -0,0 +1,690 @@ + + + +Background and Tutorial + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ The following is an updated version of the article "C++ Type traits" + by John Maddock and Steve Cleary that appeared in the October 2000 issue of + Dr Dobb's Journal. +

+

+ Generic programming (writing code which works with any data type meeting a + set of requirements) has become the method of choice for providing reusable + code. However, there are times in generic programming when "generic" + just isn't good enough - sometimes the differences between types are too large + for an efficient generic implementation. This is when the traits technique + becomes important - by encapsulating those properties that need to be considered + on a type by type basis inside a traits class, we can minimize the amount of + code that has to differ from one type to another, and maximize the amount of + generic code. +

+

+ Consider an example: when working with character strings, one common operation + is to determine the length of a null terminated string. Clearly it's possible + to write generic code that can do this, but it turns out that there are much + more efficient methods available: for example, the C library functions strlen and wcslen + are usually written in assembler, and with suitable hardware support can be + considerably faster than a generic version written in C++. The authors of the + C++ standard library realized this, and abstracted the properties of char and wchar_t + into the class char_traits. + Generic code that works with character strings can simply use char_traits<>::length to determine the length of a null + terminated string, safe in the knowledge that specializations of char_traits will use the most appropriate + method available to them. +

+
+ + Type Traits +
+

+ Class char_traits is a classic + example of a collection of type specific properties wrapped up in a single + class - what Nathan Myers termed a baggage class[1]. In the Boost type-traits library, + we[2] have written a set of very + specific traits classes, each of which encapsulate a single trait from the + C++ type system; for example, is a type a pointer or a reference type? Or does + a type have a trivial constructor, or a const-qualifier? The type-traits classes + share a unified design: each class inherits from a the type true_type + if the type has the specified property and inherits from false_type + otherwise. As we will show, these classes can be used in generic programming + to determine the properties of a given type and introduce optimizations that + are appropriate for that case. +

+

+ The type-traits library also contains a set of classes that perform a specific + transformation on a type; for example, they can remove a top-level const or + volatile qualifier from a type. Each class that performs a transformation defines + a single typedef-member type + that is the result of the transformation. All of the type-traits classes are + defined inside namespace boost; + for brevity, namespace-qualification is omitted in most of the code samples + given. +

+
+ + Implementation +
+

+ There are far too many separate classes contained in the type-traits library + to give a full implementation here - see the source code in the Boost library + for the full details - however, most of the implementation is fairly repetitive + anyway, so here we will just give you a flavor for how some of the classes + are implemented. Beginning with possibly the simplest class in the library, + is_void<T> inherits + from true_type + only if T is void. +

+
+template <typename T> 
+struct is_void : public false_type{};
+
+template <> 
+struct is_void<void> : public true_type{};
+
+

+ Here we define a primary version of the template class is_void, + and provide a full-specialization when T + is void. While full specialization + of a template class is an important technique, sometimes we need a solution + that is halfway between a fully generic solution, and a full specialization. + This is exactly the situation for which the standards committee defined partial + template-class specialization. As an example, consider the class boost::is_pointer<T>: + here we needed a primary version that handles all the cases where T is not + a pointer, and a partial specialization to handle all the cases where T is + a pointer: +

+
+template <typename T> 
+struct is_pointer : public false_type{};
+
+template <typename T> 
+struct is_pointer<T*> : public true_type{};
+
+

+ The syntax for partial specialization is somewhat arcane and could easily occupy + an article in its own right; like full specialization, in order to write a + partial specialization for a class, you must first declare the primary template. + The partial specialization contains an extra <...> after the class name + that contains the partial specialization parameters; these define the types + that will bind to that partial specialization rather than the default template. + The rules for what can appear in a partial specialization are somewhat convoluted, + but as a rule of thumb if you can legally write two function overloads of the + form: +

+
+void foo(T);
+void foo(U);
+
+

+ Then you can also write a partial specialization of the form: +

+
+template <typename T>
+class c{ /*details*/ };
+
+template <typename T>
+class c<U>{ /*details*/ };
+
+

+ This rule is by no means foolproof, but it is reasonably simple to remember + and close enough to the actual rule to be useful for everyday use. +

+

+ As a more complex example of partial specialization consider the class remove_extent<T>. This + class defines a single typedef-member type + that is the same type as T but with any top-level array bounds removed; this + is an example of a traits class that performs a transformation on a type: +

+
+template <typename T> 
+struct remove_extent
+{ typedef T type; };
+
+template <typename T, std::size_t N> 
+struct remove_extent<T[N]>
+{ typedef T type; };
+
+

+ The aim of remove_extent + is this: imagine a generic algorithm that is passed an array type as a template + parameter, remove_extent + provides a means of determining the underlying type of the array. For example + remove_extent<int[4][5]>::type would evaluate to the type int[5]. This example also shows that the number of + template parameters in a partial specialization does not have to match the + number in the default template. However, the number of parameters that appear + after the class name do have to match the number and type of the parameters + in the default template. +

+
+ + Optimized copy +
+

+ As an example of how the type traits classes can be used, consider the standard + library algorithm copy: +

+
+template<typename Iter1, typename Iter2>
+Iter2 copy(Iter1 first, Iter1 last, Iter2 out);
+
+

+ Obviously, there's no problem writing a generic version of copy that works + for all iterator types Iter1 + and Iter2; however, there are + some circumstances when the copy operation can best be performed by a call + to memcpy. In order to implement + copy in terms of memcpy all + of the following conditions need to be met: +

+
    +
  • + Both of the iterator types Iter1 + and Iter2 must be pointers. +
  • +
  • + Both Iter1 and Iter2 must point to the same type - excluding + const and volatile-qualifiers. +
  • +
  • + The type pointed to by Iter1 + must have a trivial assignment operator. +
  • +
+

+ By trivial assignment operator we mean that the type is either a scalar type[3] or: +

+
    +
  • + The type has no user defined assignment operator. +
  • +
  • + The type does not have any data members that are references. +
  • +
  • + All base classes, and all data member objects must have trivial assignment + operators. +
  • +
+

+ If all these conditions are met then a type can be copied using memcpy rather than using a compiler generated + assignment operator. The type-traits library provides a class has_trivial_assign, + such that has_trivial_assign<T>::value is true only if T has a trivial assignment + operator. This class "just works" for scalar types, but has to be + explicitly specialised for class/struct types that also happen to have a trivial + assignment operator. In other words if has_trivial_assign + gives the wrong answer, it will give the "safe" wrong answer - that + trivial assignment is not allowable. +

+

+ The code for an optimized version of copy that uses memcpy + where appropriate is given in the + examples. The code begins by defining a template function do_copy that performs a "slow but safe" + copy. The last parameter passed to this function may be either a true_type + or a false_type. + Following that there is an overload of docopy that + uses `memcpy`: this time the iterators are required to actually be pointers + to the same type, and the final parameter must be a `_true_type. Finally, the version + of copy calls + docopy`, passing `_has_trivial_assign<value_type>()` + as the final parameter: this will dispatch to the optimized version where appropriate, + otherwise it will call the "slow but safe version". +

+
+ + Was it worth it? +
+

+ It has often been repeated in these columns that "premature optimization + is the root of all evil" [4]. + So the question must be asked: was our optimization premature? To put this + in perspective the timings for our version of copy compared a conventional + generic copy[5] are shown in table + 1. +

+

+ Clearly the optimization makes a difference in this case; but, to be fair, + the timings are loaded to exclude cache miss effects - without this accurate + comparison between algorithms becomes difficult. However, perhaps we can add + a couple of caveats to the premature optimization rule: +

+
    +
  • + If you use the right algorithm for the job in the first place then optimization + will not be required; in some cases, memcpy is the right algorithm. +
  • +
  • + If a component is going to be reused in many places by many people then optimizations + may well be worthwhile where they would not be so for a single case - in + other words, the likelihood that the optimization will be absolutely necessary + somewhere, sometime is that much higher. Just as importantly the perceived + value of the stock implementation will be higher: there is no point standardizing + an algorithm if users reject it on the grounds that there are better, more + heavily optimized versions available. +
  • +
+
+

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

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

+ Version +

+
+

+ T +

+
+

+ Time +

+
+

+ "Optimized" copy +

+
+

+ char +

+
+

+ 0.99 +

+
+

+ Conventional copy +

+
+

+ char +

+
+

+ 8.07 +

+
+

+ "Optimized" copy +

+
+

+ int +

+
+

+ 2.52 +

+
+

+ Conventional copy +

+
+

+ int +

+
+

+ 8.02 +

+
+
+
+ + Pair of References +
+

+ The optimized copy example shows how type traits may be used to perform optimization + decisions at compile-time. Another important usage of type traits is to allow + code to compile that otherwise would not do so unless excessive partial specialization + is used. This is possible by delegating partial specialization to the type + traits classes. Our example for this form of usage is a pair that can hold + references [6]. +

+

+ First, let us examine the definition of std::pair, omitting + the comparison operators, default constructor, and template copy constructor + for simplicity: +

+
+template <typename T1, typename T2> 
+struct pair 
+{
+typedef T1 first_type;
+typedef T2 second_type;
+
+T1 first;
+T2 second;
+
+pair(const T1 & nfirst, const T2 & nsecond)
+:first(nfirst), second(nsecond) { }
+};
+
+

+ Now, this "pair" cannot hold references as it currently stands, because + the constructor would require taking a reference to a reference, which is currently + illegal [7]. Let us consider what + the constructor's parameters would have to be in order to allow "pair" + to hold non-reference types, references, and constant references: +

+
+

Table 1.2. Required Constructor Argument Types

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

+ Type of T1 +

+
+

+ Type of parameter to initializing constructor +

+
+

+ T +

+
+

+ const T & +

+
+

+ T & +

+
+

+ T & +

+
+

+ const T & +

+
+

+ const T & +

+
+
+

+ A little familiarity with the type traits classes allows us to construct a + single mapping that allows us to determine the type of parameter from the type + of the contained class. The type traits classes provide a transformation add_reference, which + adds a reference to its type, unless it is already a reference. +

+
+

Table 1.3. Using add_reference to synthesize the correct constructor + type

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

+ Type of T1 +

+
+

+ Type of const T1 +

+
+

+ Type of add_reference<const T1>::type +

+
+

+ T +

+
+

+ const T +

+
+

+ const T & +

+
+

+ T & +

+
+

+ T & [8] +

+
+

+ T & +

+
+

+ const T & +

+
+

+ const T & +

+
+

+ const T & +

+
+
+

+ This allows us to build a primary template definition for pair + that can contain non-reference types, reference types, and constant reference + types: +

+
+template <typename T1, typename T2> 
+struct pair 
+{
+typedef T1 first_type;
+typedef T2 second_type;
+
+T1 first;
+T2 second;
+
+pair(boost::add_reference<const T1>::type nfirst,
+      boost::add_reference<const T2>::type nsecond)
+:first(nfirst), second(nsecond) { }
+};
+
+

+ Add back in the standard comparison operators, default constructor, and template + copy constructor (which are all the same), and you have a std::pair that + can hold reference types! +

+

+ This same extension could have been done using partial template specialization + of pair, but to specialize + pair in this way would require + three partial specializations, plus the primary template. Type traits allows + us to define a single primary template that adjusts itself auto-magically to + any of these partial specializations, instead of a brute-force partial specialization + approach. Using type traits in this fashion allows programmers to delegate + partial specialization to the type traits classes, resulting in code that is + easier to maintain and easier to understand. +

+
+ + Conclusion +
+

+ We hope that in this article we have been able to give you some idea of what + type-traits are all about. A more complete listing of the available classes + are in the boost documentation, along with further examples using type traits. + Templates have enabled C++ uses to take the advantage of the code reuse that + generic programming brings; hopefully this article has shown that generic programming + does not have to sink to the lowest common denominator, and that templates + can be optimal as well as generic. +

+
+ + Acknowledgements +
+

+ The authors would like to thank Beman Dawes and Howard Hinnant for their helpful + comments when preparing this article. +

+
+ + References +
+
    +
  1. + Nathan C. Myers, C++ Report, June 1995. +
  2. +
  3. + The type traits library is based upon contributions by Steve Cleary, Beman + Dawes, Howard Hinnant and John Maddock: it can be found at www.boost.org. +
  4. +
  5. + A scalar type is an arithmetic type (i.e. a built-in integer or floating + point type), an enumeration type, a pointer, a pointer to member, or a const- + or volatile-qualified version of one of these types. +
  6. +
  7. + This quote is from Donald Knuth, ACM Computing Surveys, December 1974, pg + 268. +
  8. +
  9. + The test code is available as part of the boost utility library (see algo_opt_examples.cpp), + the code was compiled with gcc 2.95 with all optimisations turned on, tests + were conducted on a 400MHz Pentium II machine running Microsoft Windows 98. +
  10. +
  11. + John Maddock and Howard Hinnant have submitted a "compressed_pair" + library to Boost, which uses a technique similar to the one described here + to hold references. Their pair also uses type traits to determine if any + of the types are empty, and will derive instead of contain to conserve space + -- hence the name "compressed". +
  12. +
  13. + This is actually an issue with the C++ Core Language Working Group (issue + #106), submitted by Bjarne Stroustrup. The tentative resolution is to allow + a "reference to a reference to T" to mean the same thing as a "reference + to T", but only in template instantiation, in a method similar to multiple + cv-qualifiers. +
  14. +
  15. + For those of you who are wondering why this shouldn't be const-qualified, + remember that references are always implicitly constant (for example, you + can't re-assign a reference). Remember also that "const T &" + is something completely different. For this reason, cv-qualifiers on template + type arguments that are references are ignored. +
  16. +
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/category.html b/doc/html/boost_typetraits/category.html new file mode 100644 index 0000000..256ef75 --- /dev/null +++ b/doc/html/boost_typetraits/category.html @@ -0,0 +1,60 @@ + + + +Type Traits by Category + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/category/alignment.html b/doc/html/boost_typetraits/category/alignment.html new file mode 100644 index 0000000..cb22d55 --- /dev/null +++ b/doc/html/boost_typetraits/category/alignment.html @@ -0,0 +1,59 @@ + + + +Synthesizing Types with Specific Alignments + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Some low level memory management routines need to synthesize a POD type with + specific alignment properties. The template type_with_alignment + finds the smallest type with a specified alignment, while template aligned_storage + creates a type with a specific size and alignment. +

+

+ Synopsis +

+
+template <std::size_t Align>
+struct type_with_alignment;
+
+template <std::size_t Size, std::size_t Align>
+struct aligned_storage;
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/category/background.html b/doc/html/boost_typetraits/category/background.html new file mode 100644 index 0000000..3891995 --- /dev/null +++ b/doc/html/boost_typetraits/category/background.html @@ -0,0 +1,699 @@ + + + +Background and Tutorial + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ The following is an updated version of the article "C++ Type traits" + by John Maddock and Steve Cleary that appeared in the October 2000 issue + of Dr Dobb's Journal. +

+

+ Generic programming (writing code which works with any data type meeting + a set of requirements) has become the method of choice for providing reusable + code. However, there are times in generic programming when "generic" + just isn't good enough - sometimes the differences between types are too + large for an efficient generic implementation. This is when the traits technique + becomes important - by encapsulating those properties that need to be considered + on a type by type basis inside a traits class, we can minimize the amount + of code that has to differ from one type to another, and maximize the amount + of generic code. +

+

+ Consider an example: when working with character strings, one common operation + is to determine the length of a null terminated string. Clearly it's possible + to write generic code that can do this, but it turns out that there are much + more efficient methods available: for example, the C library functions strlen and wcslen + are usually written in assembler, and with suitable hardware support can + be considerably faster than a generic version written in C++. The authors + of the C++ standard library realized this, and abstracted the properties + of char and wchar_t + into the class char_traits. + Generic code that works with character strings can simply use char_traits<>::length to determine the length of a null + terminated string, safe in the knowledge that specializations of char_traits will use the most appropriate + method available to them. +

+
+ + Type Traits +
+

+ Class char_traits is a classic + example of a collection of type specific properties wrapped up in a single + class - what Nathan Myers termed a baggage class[1]. In the Boost type-traits library, + we[2] have written a set of + very specific traits classes, each of which encapsulate a single trait from + the C++ type system; for example, is a type a pointer or a reference type? + Or does a type have a trivial constructor, or a const-qualifier? The type-traits + classes share a unified design: each class inherits from a the type true_type if + the type has the specified property and inherits from false_type + otherwise. As we will show, these classes can be used in generic programming + to determine the properties of a given type and introduce optimizations that + are appropriate for that case. +

+

+ The type-traits library also contains a set of classes that perform a specific + transformation on a type; for example, they can remove a top-level const + or volatile qualifier from a type. Each class that performs a transformation + defines a single typedef-member type + that is the result of the transformation. All of the type-traits classes + are defined inside namespace boost; + for brevity, namespace-qualification is omitted in most of the code samples + given. +

+
+ + Implementation +
+

+ There are far too many separate classes contained in the type-traits library + to give a full implementation here - see the source code in the Boost library + for the full details - however, most of the implementation is fairly repetitive + anyway, so here we will just give you a flavor for how some of the classes + are implemented. Beginning with possibly the simplest class in the library, + is_void<T> inherits + from true_type + only if T is void. +

+
+template <typename T> 
+struct is_void : public false_type{};
+
+template <> 
+struct is_void<void> : public true_type{};
+
+

+ Here we define a primary version of the template class is_void, + and provide a full-specialization when T + is void. While full specialization + of a template class is an important technique, sometimes we need a solution + that is halfway between a fully generic solution, and a full specialization. + This is exactly the situation for which the standards committee defined partial + template-class specialization. As an example, consider the class boost::is_pointer<T>: + here we needed a primary version that handles all the cases where T is not + a pointer, and a partial specialization to handle all the cases where T is + a pointer: +

+
+template <typename T> 
+struct is_pointer : public false_type{};
+
+template <typename T> 
+struct is_pointer<T*> : public true_type{};
+
+

+ The syntax for partial specialization is somewhat arcane and could easily + occupy an article in its own right; like full specialization, in order to + write a partial specialization for a class, you must first declare the primary + template. The partial specialization contains an extra <...> after + the class name that contains the partial specialization parameters; these + define the types that will bind to that partial specialization rather than + the default template. The rules for what can appear in a partial specialization + are somewhat convoluted, but as a rule of thumb if you can legally write + two function overloads of the form: +

+
+void foo(T);
+void foo(U);
+
+

+ Then you can also write a partial specialization of the form: +

+
+template <typename T>
+class c{ /*details*/ };
+
+template <typename T>
+class c<U>{ /*details*/ };
+
+

+ This rule is by no means foolproof, but it is reasonably simple to remember + and close enough to the actual rule to be useful for everyday use. +

+

+ As a more complex example of partial specialization consider the class remove_extent<T>. + This class defines a single typedef-member type + that is the same type as T but with any top-level array bounds removed; this + is an example of a traits class that performs a transformation on a type: +

+
+template <typename T> 
+struct remove_extent
+{ typedef T type; };
+
+template <typename T, std::size_t N> 
+struct remove_extent<T[N]>
+{ typedef T type; };
+
+

+ The aim of remove_extent + is this: imagine a generic algorithm that is passed an array type as a template + parameter, remove_extent + provides a means of determining the underlying type of the array. For example + remove_extent<int[4][5]>::type would evaluate to the type int[5]. This example also shows that the number + of template parameters in a partial specialization does not have to match + the number in the default template. However, the number of parameters that + appear after the class name do have to match the number and type of the parameters + in the default template. +

+
+ + Optimized + copy +
+

+ As an example of how the type traits classes can be used, consider the standard + library algorithm copy: +

+
+template<typename Iter1, typename Iter2>
+Iter2 copy(Iter1 first, Iter1 last, Iter2 out);
+
+

+ Obviously, there's no problem writing a generic version of copy that works + for all iterator types Iter1 + and Iter2; however, there + are some circumstances when the copy operation can best be performed by a + call to memcpy. In order + to implement copy in terms of memcpy + all of the following conditions need to be met: +

+
    +
  • + Both of the iterator types Iter1 + and Iter2 must be pointers. +
  • +
  • + Both Iter1 and Iter2 must point to the same type - excluding + const and volatile-qualifiers. +
  • +
  • + The type pointed to by Iter1 + must have a trivial assignment operator. +
  • +
+

+ By trivial assignment operator we mean that the type is either a scalar type[3] or: +

+
    +
  • + The type has no user defined assignment operator. +
  • +
  • + The type does not have any data members that are references. +
  • +
  • + All base classes, and all data member objects must have trivial assignment + operators. +
  • +
+

+ If all these conditions are met then a type can be copied using memcpy rather than using a compiler generated + assignment operator. The type-traits library provides a class has_trivial_assign, + such that has_trivial_assign<T>::value is true only if T has a trivial assignment + operator. This class "just works" for scalar types, but has to + be explicitly specialised for class/struct types that also happen to have + a trivial assignment operator. In other words if has_trivial_assign + gives the wrong answer, it will give the "safe" wrong answer - + that trivial assignment is not allowable. +

+

+ The code for an optimized version of copy that uses memcpy + where appropriate is given in the examples. + The code begins by defining a template function do_copy + that performs a "slow but safe" copy. The last parameter passed + to this function may be either a true_type + or a false_type. + Following that there is an overload of docopy + that uses `memcpy`: this time the iterators are required to actually be pointers + to the same type, and the final parameter must be a `_true_type. Finally, the version of + copy calls docopy`, passing `_has_trivial_assign<value_type>()` + as the final parameter: this will dispatch to the optimized version where + appropriate, otherwise it will call the "slow but safe version". +

+
+ + Was + it worth it? +
+

+ It has often been repeated in these columns that "premature optimization + is the root of all evil" [4]. + So the question must be asked: was our optimization premature? To put this + in perspective the timings for our version of copy compared a conventional + generic copy[5] are shown in + table 1. +

+

+ Clearly the optimization makes a difference in this case; but, to be fair, + the timings are loaded to exclude cache miss effects - without this accurate + comparison between algorithms becomes difficult. However, perhaps we can + add a couple of caveats to the premature optimization rule: +

+
    +
  • + If you use the right algorithm for the job in the first place then optimization + will not be required; in some cases, memcpy is the right algorithm. +
  • +
  • + If a component is going to be reused in many places by many people then + optimizations may well be worthwhile where they would not be so for a single + case - in other words, the likelihood that the optimization will be absolutely + necessary somewhere, sometime is that much higher. Just as importantly + the perceived value of the stock implementation will be higher: there is + no point standardizing an algorithm if users reject it on the grounds that + there are better, more heavily optimized versions available. +
  • +
+
+

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

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

+ Version +

+
+

+ T +

+
+

+ Time +

+
+

+ "Optimized" copy +

+
+

+ char +

+
+

+ 0.99 +

+
+

+ Conventional copy +

+
+

+ char +

+
+

+ 8.07 +

+
+

+ "Optimized" copy +

+
+

+ int +

+
+

+ 2.52 +

+
+

+ Conventional copy +

+
+

+ int +

+
+

+ 8.02 +

+
+
+
+ + Pair + of References +
+

+ The optimized copy example shows how type traits may be used to perform optimization + decisions at compile-time. Another important usage of type traits is to allow + code to compile that otherwise would not do so unless excessive partial specialization + is used. This is possible by delegating partial specialization to the type + traits classes. Our example for this form of usage is a pair that can hold + references [6]. +

+

+ First, let us examine the definition of std::pair, + omitting the comparison operators, default constructor, and template copy + constructor for simplicity: +

+
+template <typename T1, typename T2> 
+struct pair 
+{
+typedef T1 first_type;
+typedef T2 second_type;
+
+T1 first;
+T2 second;
+
+pair(const T1 & nfirst, const T2 & nsecond)
+:first(nfirst), second(nsecond) { }
+};
+
+

+ Now, this "pair" cannot hold references as it currently stands, + because the constructor would require taking a reference to a reference, + which is currently illegal [7]. + Let us consider what the constructor's parameters would have to be in order + to allow "pair" to hold non-reference types, references, and constant + references: +

+
+

Table 1.2. Required Constructor Argument Types

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

+ Type of T1 +

+
+

+ Type of parameter to initializing constructor +

+
+

+ T +

+
+

+ const T & +

+
+

+ T & +

+
+

+ T & +

+
+

+ const T & +

+
+

+ const T & +

+
+
+

+ A little familiarity with the type traits classes allows us to construct + a single mapping that allows us to determine the type of parameter from the + type of the contained class. The type traits classes provide a transformation + add_reference, + which adds a reference to its type, unless it is already a reference. +

+
+

Table 1.3. Using add_reference to synthesize the correct constructor + type

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

+ Type of T1 +

+
+

+ Type of const T1 +

+
+

+ Type of add_reference<const + T1>::type +

+
+

+ T +

+
+

+ const T +

+
+

+ const T & +

+
+

+ T & +

+
+

+ T & [8] +

+
+

+ T & +

+
+

+ const T & +

+
+

+ const T & +

+
+

+ const T & +

+
+
+

+ This allows us to build a primary template definition for pair + that can contain non-reference types, reference types, and constant reference + types: +

+
+template <typename T1, typename T2> 
+struct pair 
+{
+typedef T1 first_type;
+typedef T2 second_type;
+
+T1 first;
+T2 second;
+
+pair(boost::add_reference<const T1>::type nfirst,
+      boost::add_reference<const T2>::type nsecond)
+:first(nfirst), second(nsecond) { }
+};
+
+

+ Add back in the standard comparison operators, default constructor, and template + copy constructor (which are all the same), and you have a std::pair + that can hold reference types! +

+

+ This same extension could have been done using partial template specialization + of pair, but to specialize + pair in this way would require + three partial specializations, plus the primary template. Type traits allows + us to define a single primary template that adjusts itself auto-magically + to any of these partial specializations, instead of a brute-force partial + specialization approach. Using type traits in this fashion allows programmers + to delegate partial specialization to the type traits classes, resulting + in code that is easier to maintain and easier to understand. +

+
+ + Conclusion +
+

+ We hope that in this article we have been able to give you some idea of what + type-traits are all about. A more complete listing of the available classes + are in the boost documentation, along with further examples using type traits. + Templates have enabled C++ uses to take the advantage of the code reuse that + generic programming brings; hopefully this article has shown that generic + programming does not have to sink to the lowest common denominator, and that + templates can be optimal as well as generic. +

+
+ + Acknowledgements +
+

+ The authors would like to thank Beman Dawes and Howard Hinnant for their + helpful comments when preparing this article. +

+
+ + References +
+
    +
  1. + Nathan C. Myers, C++ Report, June 1995. +
  2. +
  3. + The type traits library is based upon contributions by Steve Cleary, Beman + Dawes, Howard Hinnant and John Maddock: it can be found at www.boost.org. +
  4. +
  5. + A scalar type is an arithmetic type (i.e. a built-in integer or floating + point type), an enumeration type, a pointer, a pointer to member, or a + const- or volatile-qualified version of one of these types. +
  6. +
  7. + This quote is from Donald Knuth, ACM Computing Surveys, December 1974, + pg 268. +
  8. +
  9. + The test code is available as part of the boost utility library (see algo_opt_examples.cpp), + the code was compiled with gcc 2.95 with all optimisations turned on, tests + were conducted on a 400MHz Pentium II machine running Microsoft Windows + 98. +
  10. +
  11. + John Maddock and Howard Hinnant have submitted a "compressed_pair" + library to Boost, which uses a technique similar to the one described here + to hold references. Their pair also uses type traits to determine if any + of the types are empty, and will derive instead of contain to conserve + space -- hence the name "compressed". +
  12. +
  13. + This is actually an issue with the C++ Core Language Working Group (issue + #106), submitted by Bjarne Stroustrup. The tentative resolution is to allow + a "reference to a reference to T" to mean the same thing as a + "reference to T", but only in template instantiation, in a method + similar to multiple cv-qualifiers. +
  14. +
  15. + For those of you who are wondering why this shouldn't be const-qualified, + remember that references are always implicitly constant (for example, you + can't re-assign a reference). Remember also that "const T &" + is something completely different. For this reason, cv-qualifiers on template + type arguments that are references are ignored. +
  16. +
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/category/function.html b/doc/html/boost_typetraits/category/function.html new file mode 100644 index 0000000..20a4736 --- /dev/null +++ b/doc/html/boost_typetraits/category/function.html @@ -0,0 +1,56 @@ + + + +Decomposing Function Types + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ The class template function_traits + extracts information from function types (see also is_function). + This traits class allows you to tell how many arguments a function takes, + what those argument types are, and what the return type is. +

+

+ Synopsis +

+
+template <std::size_t Align>
+struct function_traits;
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/category/transform.html b/doc/html/boost_typetraits/category/transform.html new file mode 100644 index 0000000..179d9e8 --- /dev/null +++ b/doc/html/boost_typetraits/category/transform.html @@ -0,0 +1,165 @@ + + + +Type Traits that Transform One Type to Another + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ The following templates transform one type to another, based upon some well-defined + rule. Each template has a single member called type + that is the result of applying the transformation to the template argument + T. +

+

+ Synopsis: +

+
+template <class T>
+struct add_const;
+
+template <class T>
+struct add_cv;
+
+template <class T>
+struct add_pointer;
+
+template <class T>
+struct add_reference;
+
+template <class T>
+struct add_volatile;
+
+template <class T>
+struct decay;
+
+template <class T>
+struct floating_point_promotion;
+
+template <class T>
+struct integral_promotion;
+
+template <class T>
+struct make_signed;
+
+template <class T>
+struct make_unsigned;
+
+template <class T>
+struct promote;
+
+template <class T>
+struct remove_all_extents;
+
+template <class T>
+struct remove_const;
+
+template <class T>
+struct remove_cv;
+
+template <class T>
+struct remove_extent;
+
+template <class T>
+struct remove_pointer;
+
+template <class T>
+struct remove_reference;
+
+template <class T>
+struct remove_volatile;
+
+
+ + Broken + Compiler Workarounds: +
+

+ For all of these templates support for partial specialization of class templates + is required to correctly implement the transformation. On the other hand, + practice shows that many of the templates from this category are very useful, + and often essential for implementing some generic libraries. Lack of these + templates is often one of the major limiting factors in porting those libraries + to compilers that do not yet support this language feature. As some of these + compilers are going to be around for a while, and at least one of them is + very wide-spread, it was decided that the library should provide workarounds + where possible. +

+

+ The basic idea behind the workaround is to manually define full specializations + of all type transformation templates for all fundamental types, and all their + 1st and 2nd rank cv-[un]qualified derivative pointer types, and to provide + a user-level macro that will define all the explicit specializations needed + for any user-defined type T. +

+

+ The first part guarantees the successful compilation of something like this: +

+
+BOOST_STATIC_ASSERT((is_same<char, remove_reference<char&>::type>::value));
+BOOST_STATIC_ASSERT((is_same<char const, remove_reference<char const&>::type>::value));
+BOOST_STATIC_ASSERT((is_same<char volatile, remove_reference<char volatile&>::type>::value));
+BOOST_STATIC_ASSERT((is_same<char const volatile, remove_reference<char const volatile&>::type>::value));
+BOOST_STATIC_ASSERT((is_same<char*, remove_reference<char*&>::type>::value));
+BOOST_STATIC_ASSERT((is_same<char const*, remove_reference<char const*&>::type>::value));
+...
+BOOST_STATIC_ASSERT((is_same<char const volatile* const volatile* const volatile, remove_reference<char const volatile* const volatile* const volatile&>::type>::value));
+
+

+ and the second part provides the library's users with a mechanism to make + the above code work not only for char, + int or other built-in type, + but for their own types as well: +

+
+namespace myspace{
+   struct MyClass {};
+}
+// declare this at global scope:
+BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(myspace::MyClass)
+// transformations on myspace::MyClass now work:
+BOOST_STATIC_ASSERT((is_same<myspace::MyClass, remove_reference<myspace::MyClass&>::type>::value));
+BOOST_STATIC_ASSERT((is_same<myspace::MyClass, remove_const<myspace::MyClass const>::type>::value));
+// etc.
+
+

+ Note that the macro BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION evaluates + to nothing on those compilers that do support + partial specialization. +

+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/category/value_traits.html b/doc/html/boost_typetraits/category/value_traits.html new file mode 100644 index 0000000..aca0bb4 --- /dev/null +++ b/doc/html/boost_typetraits/category/value_traits.html @@ -0,0 +1,61 @@ + + + +Type Traits that Describe the Properties of a Type + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ These traits are all value traits, which is to say the + traits classes all inherit from integral_constant, + and are used to access some numerical property of a type. Often this is a + simple true or false Boolean value, but in a few cases may be some other + integer value (for example when dealing with type alignments, or array bounds: + see alignment_of, + rank + and extent). +

+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/category/value_traits/primary.html b/doc/html/boost_typetraits/category/value_traits/primary.html new file mode 100644 index 0000000..6aff1a3 --- /dev/null +++ b/doc/html/boost_typetraits/category/value_traits/primary.html @@ -0,0 +1,128 @@ + + + +Categorizing a Type + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ These traits identify what "kind" of type some type T is. These are split into two groups: + primary traits which are all mutually exclusive, and composite traits that + are compositions of one or more primary traits. +

+

+ For any given type, exactly one primary type trait will inherit from true_type, + and all the others will inherit from false_type, + in other words these traits are mutually exclusive. +

+

+ This means that is_integral<T>::value + and is_floating_point<T>::value + will only ever be true for built-in types; if you want to check for a user-defined + class type that behaves "as if" it is an integral or floating + point type, then use the std::numeric_limits + template instead. +

+

+ Synopsis: +

+
+template <class T>
+struct is_array<T>;
+  
+template <class T>
+struct is_class<T>;
+
+template <class T>
+struct is_complex<T>;
+  
+template <class T>
+struct is_enum<T>;
+  
+template <class T>
+struct is_floating_point<T>;
+  
+template <class T>
+struct is_function<T>;
+
+template <class T>
+struct is_integral<T>;
+  
+template <class T>
+struct is_member_function_pointer<T>;
+  
+template <class T>
+struct is_member_object_pointer<T>;
+  
+template <class T>
+struct is_pointer<T>;
+  
+template <class T>
+struct is_reference<T>;
+  
+template <class T>
+struct is_union<T>;
+  
+template <class T>
+struct is_void<T>;
+
+

+ The following traits are made up of the union of one or more type categorizations. + A type may belong to more than one of these categories, in addition to + one of the primary categories. +

+
+template <class T>
+struct is_arithmetic;
+
+template <class T>
+struct is_compound;
+
+template <class T>
+struct is_fundamental;
+
+template <class T>
+struct is_member_pointer;
+
+template <class T>
+struct is_object;
+
+template <class T>
+struct is_scalar;
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/category/value_traits/properties.html b/doc/html/boost_typetraits/category/value_traits/properties.html new file mode 100644 index 0000000..41abd37 --- /dev/null +++ b/doc/html/boost_typetraits/category/value_traits/properties.html @@ -0,0 +1,122 @@ + + + +General Type Properties + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ The following templates describe the general properties of a type. +

+

+ Synopsis: +

+
+template <class T>
+struct alignment_of;
+
+template <class T>
+struct has_nothrow_assign;
+
+template <class T>
+struct has_nothrow_constructor;
+
+template <class T>
+struct has_nothrow_default_constructor;
+
+template <class T>
+struct has_nothrow_copy;
+
+template <class T>
+struct has_nothrow_copy_constructor;
+
+template <class T>
+struct has_trivial_assign;
+
+template <class T>
+struct has_trivial_constructor;
+
+template <class T>
+struct has_trivial_default_constructor;
+
+template <class T>
+struct has_trivial_copy;
+
+template <class T>
+struct has_trivial_copy_constructor;
+
+template <class T>
+struct has_trivial_destructor;
+
+template <class T>
+struct has_virtual_destructor;
+
+template <class T>
+struct is_abstract;
+
+template <class T>
+struct is_const;
+
+template <class T>
+struct is_empty;
+
+template <class T>
+struct is_stateless;
+
+template <class T>
+struct is_pod;
+
+template <class T>
+struct is_polymorphic;
+
+template <class T>
+struct is_signed;
+
+template <class T>
+struct is_unsigned;
+
+template <class T>
+struct is_volatile;
+
+template <class T, std::size_t N = 0>
+struct extent;
+
+template <class T>
+struct rank;
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/category/value_traits/relate.html b/doc/html/boost_typetraits/category/value_traits/relate.html new file mode 100644 index 0000000..a6771fd --- /dev/null +++ b/doc/html/boost_typetraits/category/value_traits/relate.html @@ -0,0 +1,60 @@ + + + +Relationships Between Two Types + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ These templates determine the whether there is a relationship between two + types: +

+

+ Synopsis: +

+
+template <class Base, class Derived>
+struct is_base_of;
+
+template <class From, class To>
+struct is_convertible;
+
+template <class T, class U>
+struct is_same;
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/credits.html b/doc/html/boost_typetraits/credits.html new file mode 100644 index 0000000..8127b84 --- /dev/null +++ b/doc/html/boost_typetraits/credits.html @@ -0,0 +1,74 @@ + + + +Credits + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHome +
+
+ +

+ This documentation was pulled together by John Maddock, using Boost.Quickbook + and Boost.DocBook. +

+

+ The original version of this library was created by Steve Cleary, Beman Dawes, + Howard Hinnant, and John Maddock. John Maddock is the current maintainer of + the library. +

+

+ This version of type traits library is based on contributions by Adobe Systems + Inc, David Abrahams, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, + Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Thorsten Ottosen, Robert + Ramey and Jeremy Siek. +

+

+ Mat Marcus and Jesse Jones invented, and published + a paper describing, the partial specialization workarounds used in + this library. +

+

+ Aleksey Gurtovoy added MPL integration to the library. +

+

+ The is_convertible + template is based on code originally devised by Andrei Alexandrescu, see "Generic<Programming>: + Mappings between Types and Values". +

+

+ The latest version of this library and documentation can be found at www.boost.org. Bugs, suggestions and discussion + should be directed to boost@lists.boost.org (see www.boost.org/more/mailing_lists.htm#main + for subscription details). +

+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHome +
+ + diff --git a/doc/html/boost_typetraits/examples.html b/doc/html/boost_typetraits/examples.html new file mode 100644 index 0000000..8e2a14f --- /dev/null +++ b/doc/html/boost_typetraits/examples.html @@ -0,0 +1,54 @@ + + + +Examples + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/examples/copy.html b/doc/html/boost_typetraits/examples/copy.html new file mode 100644 index 0000000..2372378 --- /dev/null +++ b/doc/html/boost_typetraits/examples/copy.html @@ -0,0 +1,92 @@ + + + +An Optimized Version of std::copy + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Demonstrates a version of std::copy + that uses has_trivial_assign + to determine whether to use memcpy + to optimise the copy operation (see copy_example.cpp): +

+
+//
+// opt::copy
+// same semantics as std::copy
+// calls memcpy where appropriate.
+//
+
+namespace detail{
+
+template<typename I1, typename I2, bool b>
+I2 copy_imp(I1 first, I1 last, I2 out, const boost::integral_constant<bool, b>&)
+{
+   while(first != last)
+   {
+      *out = *first;
+      ++out;
+      ++first;
+   }
+   return out;
+}
+
+template<typename T>
+T* copy_imp(const T* first, const T* last, T* out, const boost::true_type&)
+{
+   memcpy(out, first, (last-first)*sizeof(T));
+   return out+(last-first);
+}
+
+
+}
+
+template<typename I1, typename I2>
+inline I2 copy(I1 first, I1 last, I2 out)
+{
+   //
+   // We can copy with memcpy if T has a trivial assignment operator,
+   // and if the iterator arguments are actually pointers (this last
+   // requirement we detect with overload resolution):
+   //
+   typedef typename std::iterator_traits<I1>::value_type value_type;
+   return detail::copy_imp(first, last, out, boost::has_trivial_assign<value_type>());
+}
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/examples/destruct.html b/doc/html/boost_typetraits/examples/destruct.html new file mode 100644 index 0000000..96cfdf2 --- /dev/null +++ b/doc/html/boost_typetraits/examples/destruct.html @@ -0,0 +1,79 @@ + + + +An Example that Omits Destructor Calls For Types with Trivial Destructors + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Demonstrates a simple algorithm that uses __has_trivial_destruct + to determine whether to destructors need to be called (see trivial_destructor_example.cpp): +

+
+//
+// algorithm destroy_array:
+// The reverse of std::unitialized_copy, takes a block of
+// initialized memory and calls destructors on all objects therein.
+//
+
+namespace detail{
+
+template <class T>
+void do_destroy_array(T* first, T* last, const boost::false_type&)
+{
+   while(first != last)
+   {
+      first->~T();
+      ++first;
+   }
+}
+
+template <class T>
+inline void do_destroy_array(T* first, T* last, const boost::true_type&)
+{
+}
+
+} // namespace detail
+
+template <class T>
+inline void destroy_array(T* p1, T* p2)
+{
+   detail::do_destroy_array(p1, p2, ::boost::has_trivial_destructor<T>());
+}
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/examples/fill.html b/doc/html/boost_typetraits/examples/fill.html new file mode 100644 index 0000000..f190a28 --- /dev/null +++ b/doc/html/boost_typetraits/examples/fill.html @@ -0,0 +1,86 @@ + + + +An Optimised Version of std::fill + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Demonstrates a version of std::fill + that uses has_trivial_assign + to determine whether to use memset + to optimise the fill operation (see fill_example.cpp): +

+
+//
+// fill
+// same as std::fill, but uses memset where appropriate
+//
+namespace detail{
+
+template <typename I, typename T, bool b>
+void do_fill(I first, I last, const T& val, const boost::integral_constant<bool, b>&)
+{
+   while(first != last)
+   {
+      *first = val;
+      ++first;
+   }
+}
+
+template <typename T>
+void do_fill(T* first, T* last, const T& val, const boost::true_type&)
+{
+   std::memset(first, val, last-first);
+}
+
+}
+
+template <class I, class T>
+inline void fill(I first, I last, const T& val)
+{
+   //
+   // We can do an optimised fill if T has a trivial assignment 
+   // operator and if it's size is one:
+   //
+   typedef boost::integral_constant<bool, 
+      ::boost::has_trivial_assign<T>::value && (sizeof(T) == 1)> truth_type;
+   detail::do_fill(first, last, val, truth_type());
+}
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/examples/iter.html b/doc/html/boost_typetraits/examples/iter.html new file mode 100644 index 0000000..615796a --- /dev/null +++ b/doc/html/boost_typetraits/examples/iter.html @@ -0,0 +1,95 @@ + + + +An improved Version of std::iter_swap + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Demonstrates a version of std::iter_swap + that use type traits to determine whether an it's arguments are proxying + iterators or not, if they're not then it just does a std::swap + of it's dereferenced arguments (the same as std::iter_swap + does), however if they are proxying iterators then takes special care over + the swap to ensure that the algorithm works correctly for both proxying iterators, + and even iterators of different types (see iter_swap_example.cpp): +

+
+//
+// iter_swap:
+// tests whether iterator is a proxying iterator or not, and
+// uses optimal form accordingly:
+//
+namespace detail{
+
+template <typename I>
+static void do_swap(I one, I two, const boost::false_type&)
+{
+   typedef typename std::iterator_traits<I>::value_type v_t;
+   v_t v = *one;
+   *one = *two;
+   *two = v;
+}
+template <typename I>
+static void do_swap(I one, I two, const boost::true_type&)
+{
+   using std::swap;
+   swap(*one, *two);
+}
+
+}
+
+template <typename I1, typename I2>
+inline void iter_swap(I1 one, I2 two)
+{
+   //
+   // See is both arguments are non-proxying iterators, 
+   // and if both iterator the same type:
+   //
+   typedef typename std::iterator_traits<I1>::reference r1_t;
+   typedef typename std::iterator_traits<I2>::reference r2_t;
+
+   typedef boost::integral_constant<bool,
+      ::boost::is_reference<r1_t>::value
+      && ::boost::is_reference<r2_t>::value
+      && ::boost::is_same<r1_t, r2_t>::value> truth_type;
+
+   detail::do_swap(one, two, truth_type());
+}
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/examples/to_double.html b/doc/html/boost_typetraits/examples/to_double.html new file mode 100644 index 0000000..72c69a9 --- /dev/null +++ b/doc/html/boost_typetraits/examples/to_double.html @@ -0,0 +1,55 @@ + + + +Convert Numeric Types and Enums to double + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Demonstrates a conversion of Numeric + Types and enum types to double: +

+
+template<class T>
+inline double to_double(T const& value)
+{
+    typedef typename boost::promote<T>::type promoted;
+    return boost::numeric::converter<double,promoted>::convert(value);
+}
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/intrinsics.html b/doc/html/boost_typetraits/intrinsics.html new file mode 100644 index 0000000..c781597 --- /dev/null +++ b/doc/html/boost_typetraits/intrinsics.html @@ -0,0 +1,240 @@ + + + +Support for Compiler Intrinsics + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ There are some traits that can not be implemented within the current C++ language: + to make these traits "just work" with user defined types, some kind + of additional help from the compiler is required. Currently (May 2005) MWCW + 9 and Visual C++ 8 provide the necessary intrinsics, and other compilers will + no doubt follow in due course. +

+

+ The Following traits classes always need compiler support to do the right thing + for all types (but all have safe fallback positions if this support is unavailable): +

+ +

+ The following traits classes can't be portably implemented in the C++ language, + although in practice, the implementations do in fact do the right thing on + all the compilers we know about: +

+ +

+ The following traits classes are dependent on one or more of the above: +

+ +

+ The hooks for compiler-intrinsic support are defined in boost/type_traits/intrinsics.hpp, + adding support for new compilers is simply a matter of defining one of more + of the following macros: +

+
+

Table 1.4. Macros for Compiler Intrinsics

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

+ BOOST_IS_UNION(T) +

+
+

+ Should evaluate to true if T is a union type +

+
+

+ BOOST_IS_POD(T) +

+
+

+ Should evaluate to true if T is a POD type +

+
+

+ BOOST_IS_EMPTY(T) +

+
+

+ Should evaluate to true if T is an empty struct or union +

+
+

+ BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) +

+
+

+ Should evaluate to true if the default constructor for T is trivial (i.e. + has no effect) +

+
+

+ BOOST_HAS_TRIVIAL_COPY(T) +

+
+

+ Should evaluate to true if T has a trivial copy constructor (and can + therefore be replaced by a call to memcpy) +

+
+

+ BOOST_HAS_TRIVIAL_ASSIGN(T) +

+
+

+ Should evaluate to true if T has a trivial assignment operator (and can + therefore be replaced by a call to memcpy) +

+
+

+ BOOST_HAS_TRIVIAL_DESTRUCTOR(T) +

+
+

+ Should evaluate to true if T has a trivial destructor (i.e. ~T() has + no effect) +

+
+

+ BOOST_HAS_NOTHROW_CONSTRUCTOR(T) +

+
+

+ Should evaluate to true if T + x; + can not throw +

+
+

+ BOOST_HAS_NOTHROW_COPY(T) +

+
+

+ Should evaluate to true if T(t) can not throw +

+
+

+ BOOST_HAS_NOTHROW_ASSIGN(T) +

+
+

+ Should evaluate to true if T + t, + u; + t = + u can not throw +

+
+

+ BOOST_HAS_VIRTUAL_DESTRUCTOR(T) +

+
+

+ Should evaluate to true T has a virtual destructor +

+
+
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/intro.html b/doc/html/boost_typetraits/intro.html new file mode 100644 index 0000000..a4582fe --- /dev/null +++ b/doc/html/boost_typetraits/intro.html @@ -0,0 +1,61 @@ + + + +Introduction + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ The Boost type-traits library contains a set of very specific traits classes, + each of which encapsulate a single trait from the C++ type system; for example, + is a type a pointer or a reference type? Or does a type have a trivial constructor, + or a const-qualifier? +

+

+ The type-traits classes share a unified design: each class inherits from a + the type true_type + if the type has the specified property and inherits from false_type + otherwise. +

+

+ The type-traits library also contains a set of classes that perform a specific + transformation on a type; for example, they can remove a top-level const or + volatile qualifier from a type. Each class that performs a transformation defines + a single typedef-member type + that is the result of the transformation. +

+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/mpl.html b/doc/html/boost_typetraits/mpl.html new file mode 100644 index 0000000..f6b8b84 --- /dev/null +++ b/doc/html/boost_typetraits/mpl.html @@ -0,0 +1,58 @@ + + + +MPL Interoperability + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ All the value based traits in this library conform to MPL's requirements for + an Integral + Constant type: that includes a number of rather intrusive workarounds + for broken compilers. +

+

+ Purely as an implementation detail, this means that true_type + inherits from boost::mpl::true_, + false_type + inherits from boost::mpl::false_, + and integral_constant<T, + v> + inherits from boost::mpl::integral_c<T,v> + (provided T is not bool) +

+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference.html b/doc/html/boost_typetraits/reference.html new file mode 100644 index 0000000..886db8c --- /dev/null +++ b/doc/html/boost_typetraits/reference.html @@ -0,0 +1,117 @@ + + + +Alphabetical Reference + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/add_const.html b/doc/html/boost_typetraits/reference/add_const.html new file mode 100644 index 0000000..bef56cf --- /dev/null +++ b/doc/html/boost_typetraits/reference/add_const.html @@ -0,0 +1,142 @@ + + + +add_const + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct add_const
+{
+   typedef see-below type;
+};
+
+

+ type: The same type as T + const for all T. +

+

+ C++ Standard Reference: 3.9.3. +

+

+ Compiler Compatibility: If the compiler + does not support partial specialization of class-templates then this template + will compile, but the member type + will always be the same as type T + except where compiler + workarounds have been applied. +

+

+ Header: #include + <boost/type_traits/add_const.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.5. Examples

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

+ Expression +

+
+

+ Result Type +

+
+

+ add_const<int>::type +

+
+

+ int const +

+
+

+ add_const<int&>::type +

+
+

+ int& +

+
+

+ add_const<int*>::type +

+
+

+ int* + const +

+
+

+ add_const<int const>::type +

+
+

+ int const +

+
+
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/add_cv.html b/doc/html/boost_typetraits/reference/add_cv.html new file mode 100644 index 0000000..9ea2387 --- /dev/null +++ b/doc/html/boost_typetraits/reference/add_cv.html @@ -0,0 +1,145 @@ + + + +add_cv + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct add_cv
+{
+   typedef see-below type;
+};
+
+

+ type: The same type as T + const volatile + for all T. +

+

+ C++ Standard Reference: 3.9.3. +

+

+ Compiler Compatibility: If the compiler + does not support partial specialization of class-templates then this template + will compile, but the member type + will always be the same as type T + except where compiler + workarounds have been applied. +

+

+ Header: #include + <boost/type_traits/add_cv.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.6. Examples

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

+ Expression +

+
+

+ Result Type +

+
+

+ add_cv<int>::type +

+
+

+ int const + volatile +

+
+

+ add_cv<int&>::type +

+
+

+ int& +

+
+

+ add_cv<int*>::type +

+
+

+ int* + const volatile +

+
+

+ add_cv<int const>::type +

+
+

+ int const + volatile +

+
+
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/add_pointer.html b/doc/html/boost_typetraits/reference/add_pointer.html new file mode 100644 index 0000000..fe72730 --- /dev/null +++ b/doc/html/boost_typetraits/reference/add_pointer.html @@ -0,0 +1,144 @@ + + + +add_pointer + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct add_pointer
+{
+   typedef see-below type;
+};
+
+

+ type: The same type as remove_reference<T>::type*. +

+

+ The rationale for this template is that it produces the same type as TYPEOF(&t), where + t is an object of type T. +

+

+ C++ Standard Reference: 8.3.1. +

+

+ Compiler Compatibility: If the compiler + does not support partial specialization of class-templates then this template + will compile, but the member type + will always be the same as type T + except where compiler + workarounds have been applied. +

+

+ Header: #include + <boost/type_traits/add_pointer.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.7. Examples

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

+ Expression +

+
+

+ Result Type +

+
+

+ add_pointer<int>::type +

+
+

+ int* +

+
+

+ add_pointer<int const&>::type +

+
+

+ int const* +

+
+

+ add_pointer<int*>::type +

+
+

+ int** +

+
+

+ add_pointer<int*&>::type +

+
+

+ int** +

+
+
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/add_reference.html b/doc/html/boost_typetraits/reference/add_reference.html new file mode 100644 index 0000000..fad698d --- /dev/null +++ b/doc/html/boost_typetraits/reference/add_reference.html @@ -0,0 +1,141 @@ + + + +add_reference + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct add_reference
+{
+   typedef see-below type;
+};
+
+

+ type: If T + is not a reference type then T&, otherwise T. +

+

+ C++ Standard Reference: 8.3.2. +

+

+ Compiler Compatibility: If the compiler + does not support partial specialization of class-templates then this template + will compile, but the member type + will always be the same as type T + except where compiler + workarounds have been applied. +

+

+ Header: #include + <boost/type_traits/add_reference.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.8. Examples

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

+ Expression +

+
+

+ Result Type +

+
+

+ add_reference<int>::type +

+
+

+ int& +

+
+

+ add_reference<int const&>::type +

+
+

+ int const& +

+
+

+ add_reference<int*>::type +

+
+

+ int*& +

+
+

+ add_reference<int*&>::type +

+
+

+ int*& +

+
+
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/add_volatile.html b/doc/html/boost_typetraits/reference/add_volatile.html new file mode 100644 index 0000000..31e6828 --- /dev/null +++ b/doc/html/boost_typetraits/reference/add_volatile.html @@ -0,0 +1,143 @@ + + + +add_volatile + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct add_volatile
+{
+   typedef see-below type;
+};
+
+

+ type: The same type as T + volatile for all T. +

+

+ C++ Standard Reference: 3.9.3. +

+

+ Compiler Compatibility: If the compiler + does not support partial specialization of class-templates then this template + will compile, but the member type + will always be the same as type T + except where compiler + workarounds have been applied. +

+

+ Header: #include + <boost/type_traits/add_volatile.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.9. Examples

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

+ Expression +

+
+

+ Result Type +

+
+

+ add_volatile<int>::type +

+
+

+ int volatile +

+
+

+ add_volatile<int&>::type +

+
+

+ int& +

+
+

+ add_volatile<int*>::type +

+
+

+ int* + volatile +

+
+

+ add_volatile<int const>::type +

+
+

+ int const + volatile +

+
+
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/aligned_storage.html b/doc/html/boost_typetraits/reference/aligned_storage.html new file mode 100644 index 0000000..aa941c3 --- /dev/null +++ b/doc/html/boost_typetraits/reference/aligned_storage.html @@ -0,0 +1,59 @@ + + + +aligned_storage + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <std::size_t Size, std::size_t Align>
+struct aligned_storage
+{
+   typedef see-below type;
+};
+
+

+ type: a built-in or POD type with size + Size and an alignment that + is a multiple of Align. +

+

+ Header: #include + <boost/type_traits/aligned_storage.hpp> + or #include <boost/type_traits.hpp> +

+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/alignment_of.html b/doc/html/boost_typetraits/reference/alignment_of.html new file mode 100644 index 0000000..912b9a5 --- /dev/null +++ b/doc/html/boost_typetraits/reference/alignment_of.html @@ -0,0 +1,102 @@ + + + +alignment_of + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct alignment_of : public integral_constant<std::size_t, ALIGNOF(T)> {};
+
+

+ Inherits: Class template alignmentof inherits from `_integral_constant<std::size_t, + ALIGNOF(T)>, where + ALIGNOF(T)` is the alignment of type T. +

+

+ Note: strictly speaking you should only rely on the value of ALIGNOF(T) being + a multiple of the true alignment of T, although in practice it does compute + the correct value in all the cases we know about. +

+

+ Header: #include + <boost/type_traits/alignment_of.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ alignment_of<int> + inherits from integral_constant<std::size_t, ALIGNOF(int)>. +

+

+

+
+
+

+

+

+ alignment_of<char>::type is the type integral_constant<std::size_t, ALIGNOF(char)>. +

+

+

+
+
+

+

+

+ alignment_of<double>::value is an integral constant expression + with value ALIGNOF(double). +

+

+

+
+
+

+

+

+ alignment_of<T>::value_type is the type std::size_t. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/decay.html b/doc/html/boost_typetraits/reference/decay.html new file mode 100644 index 0000000..c2fc62f --- /dev/null +++ b/doc/html/boost_typetraits/reference/decay.html @@ -0,0 +1,148 @@ + + + +decay + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+

+ decay +

+
+template <class T>
+struct decay
+{
+   typedef see-below type;
+};
+
+

+ type: Let U + be the result of remove_reference<T>::type, then if U + is an array type, the result is remove_extent<U>*, + otherwise if U is a function + type then the result is U*, otherwise the result is U. +

+

+ C++ Standard Reference: 3.9.1. +

+

+ Header: #include + <boost/type_traits/decay.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.10. Examples

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

+ Expression +

+
+

+ Result Type +

+
+

+ decay<int[2][3]>::type +

+
+

+ int[2]* +

+
+

+ decay<int(&)[2]>::type +

+
+

+ int* +

+
+

+ decay<int(&)(double)>::type +

+
+

+ int(*)(double) +

+
+

+ int(*)(double +

+
+

+ int(*)(double) +

+
+

+ int(double) +

+
+

+ int(*)(double) +

+
+
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/extent.html b/doc/html/boost_typetraits/reference/extent.html new file mode 100644 index 0000000..00f661d --- /dev/null +++ b/doc/html/boost_typetraits/reference/extent.html @@ -0,0 +1,134 @@ + + + +extent + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T, std::size_t N = 0>
+struct extent : public integral_constant<std::size_t, EXTENT(T,N)> {};
+
+

+ Inherits: Class template extent inherits + from integral_constant<std::size_t, EXTENT(T,N)>, + where EXTENT(T,N) is the number of elements in the N'th array + dimention of type T. +

+

+ If T is not an array type, + or if N > + rank<T>::value, or if the N'th array bound is incomplete, + then EXTENT(T,N) is zero. +

+

+ Header: #include + <boost/type_traits/extent.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ extent<int[1]> inherits from integral_constant<std::size_t, 1>. +

+

+

+
+
+

+

+

+ extent<double[2][3][4], + 1>::type is the type integral_constant<std::size_t, 3>. +

+

+

+
+
+

+

+

+ extent<int[4]>::value + is an integral constant expression that evaluates to 4. +

+

+

+
+
+

+

+

+ extent<int[][2]>::value is an integral constant expression + that evaluates to 0. +

+

+

+
+
+

+

+

+ extent<int[][2], 1>::value + is an integral constant expression that evaluates to 2. +

+

+

+
+
+

+

+

+ extent<int*>::value is an integral constant expression + that evaluates to 0. +

+

+

+
+
+

+

+

+ extent<T>::value_type is the type std::size_t. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/floating_point_promotion.html b/doc/html/boost_typetraits/reference/floating_point_promotion.html new file mode 100644 index 0000000..b245f82 --- /dev/null +++ b/doc/html/boost_typetraits/reference/floating_point_promotion.html @@ -0,0 +1,126 @@ + + + +floating_point_promotion + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct floating_point_promotion
+{
+   typedef see-below type;
+};
+
+

+ type: If floating point promotion can be + applied to an rvalue of type T, + then applies floating point promotion to T + and keeps cv-qualifiers of T, + otherwise leaves T unchanged. +

+

+ C++ Standard Reference: 4.6. +

+

+ Header: #include + <boost/type_traits/floating_point_promotion.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.11. Examples

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

+ Expression +

+
+

+ Result Type +

+
+

+ floating_point_promotion<float + const>::type +

+
+

+ double const +

+
+

+ floating_point_promotion<float&>::type +

+
+

+ float& +

+
+

+ floating_point_promotion<short>::type +

+
+

+ short +

+
+
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/function_traits.html b/doc/html/boost_typetraits/reference/function_traits.html new file mode 100644 index 0000000..39f012d --- /dev/null +++ b/doc/html/boost_typetraits/reference/function_traits.html @@ -0,0 +1,261 @@ + + + +function_traits + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct function_traits
+{
+   static const std::size_t    arity = see-below;
+   typedef see-below           result_type;
+   typedef see-below           argN_type; 
+};
+
+

+ The class template function_traits will only compile if: +

+
    +
  • + The compiler supports partial specialization of class templates. +
  • +
  • + The template argument T + is a function type, note that this is not the same thing as a pointer + to a function. +
  • +
+
+

Table 1.12. Function Traits Members

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

+ Member +

+
+

+ Description +

+
+

+ function_traits<T>::arity +

+
+

+ An integral constant expression that gives the number of arguments + accepted by the function type F. +

+
+

+ function_traits<T>::result_type +

+
+

+ The type returned by function type F. +

+
+

+ function_traits<T>::argN_type +

+
+

+ The Nth argument type of function type F, + where 1 <= + N <= + arity of F. +

+
+
+
+

Table 1.13. Examples

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

+ Expression +

+
+

+ Result +

+
+

+ function_traits<void (void)>::arity +

+
+

+ An integral constant expression that has the value 0. +

+
+

+ function_traits<long (int)>::arity +

+
+

+ An integral constant expression that has the value 1. +

+
+

+ function_traits<long (int, long, double, void*)>::arity +

+
+

+ An integral constant expression that has the value 4. +

+
+

+ function_traits<void (void)>::result_type +

+
+

+ The type void. +

+
+

+ function_traits<long (int)>::result_type +

+
+

+ The type long. +

+
+

+ function_traits<long (int)>::arg1_type +

+
+

+ The type int. +

+
+

+ function_traits<long (int, long, double, void*)>::arg4_type +

+
+

+ The type void*. +

+
+

+ function_traits<long (int, long, double, void*)>::arg5_type +

+
+

+ A compiler error: there is no arg4_type + since there are only three arguments. +

+
+

+ function_traits<long (*)(void)>::arity +

+
+

+ A compiler error: argument type is a function pointer, + and not a function type. +

+
+
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/has_no_throw_def_cons.html b/doc/html/boost_typetraits/reference/has_no_throw_def_cons.html new file mode 100644 index 0000000..14f93b2 --- /dev/null +++ b/doc/html/boost_typetraits/reference/has_no_throw_def_cons.html @@ -0,0 +1,45 @@ + + + +has_nothrow_default_constructor + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/has_nothrow_assign.html b/doc/html/boost_typetraits/reference/has_nothrow_assign.html new file mode 100644 index 0000000..da5eeb0 --- /dev/null +++ b/doc/html/boost_typetraits/reference/has_nothrow_assign.html @@ -0,0 +1,70 @@ + + + +has_nothrow_assign + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct has_nothrow_assign : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + type with a non-throwing assignment-operator then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete + type. +

+

+ Compiler Compatibility: 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, has_nothrow_assign + will never report that a class or struct has a non-throwing assignment-operator; + this is always safe, if possibly sub-optimal. Currently (May 2005) only Visual + C++ 8 has the necessary compiler support to ensure that this trait "just + works". +

+

+ Header: #include + <boost/type_traits/has_nothrow_assign.hpp> + or #include <boost/type_traits.hpp> +

+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/has_nothrow_constructor.html b/doc/html/boost_typetraits/reference/has_nothrow_constructor.html new file mode 100644 index 0000000..aaf1cad --- /dev/null +++ b/doc/html/boost_typetraits/reference/has_nothrow_constructor.html @@ -0,0 +1,77 @@ + + + +has_nothrow_constructor + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct has_nothrow_constructor : public true_type-or-false_type {};
+
+template <class T>
+struct has_nothrow_default_constructor : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + type with a non-throwing default-constructor then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete + type. +

+

+ These two traits are synonyms for each other. +

+

+ Compiler Compatibility: 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, 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". +

+

+ Header: #include + <boost/type_traits/has_nothrow_constructor.hpp> + or #include <boost/type_traits.hpp> +

+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/has_nothrow_copy.html b/doc/html/boost_typetraits/reference/has_nothrow_copy.html new file mode 100644 index 0000000..7ed412e --- /dev/null +++ b/doc/html/boost_typetraits/reference/has_nothrow_copy.html @@ -0,0 +1,76 @@ + + + +has_nothrow_copy + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct has_nothrow_copy : public true_type-or-false_type {};
+
+template <class T>
+struct has_nothrow_copy_constructor : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + type with a non-throwing copy-constructor then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete + type. +

+

+ These two traits are synonyms for each other. +

+

+ Compiler Compatibility: 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, 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". +

+

+ Header: #include + <boost/type_traits/has_nothrow_copy.hpp> + or #include <boost/type_traits.hpp> +

+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/has_nothrow_cp_cons.html b/doc/html/boost_typetraits/reference/has_nothrow_cp_cons.html new file mode 100644 index 0000000..aa732b8 --- /dev/null +++ b/doc/html/boost_typetraits/reference/has_nothrow_cp_cons.html @@ -0,0 +1,45 @@ + + + +has_nothrow_copy_constructor + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/has_trivial_assign.html b/doc/html/boost_typetraits/reference/has_trivial_assign.html new file mode 100644 index 0000000..6d2fe1b --- /dev/null +++ b/doc/html/boost_typetraits/reference/has_trivial_assign.html @@ -0,0 +1,127 @@ + + + +has_trivial_assign + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct has_trivial_assign : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + type with a trivial assignment-operator then inherits from true_type, + otherwise inherits from false_type. +

+

+ If a type has a trivial assignment-operator then the operator has the same + effect as copying the bits of one object to the other: calls to the operator + can be safely replaced with a call to memcpy. +

+

+ Compiler Compatibility: 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, 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. +

+

+ C++ Standard Reference: 12.8p11. +

+

+ Header: #include + <boost/type_traits/has_trivial_assign.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ has_trivial_assign<int> + inherits from true_type. +

+

+

+
+
+

+

+

+ has_trivial_assign<char*>::type is the type true_type. +

+

+

+
+
+

+

+

+ has_trivial_assign<int (*)(long)>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ has_trivial_assign<MyClass>::value is an integral constant expression + that evaluates to false. +

+

+

+
+
+

+

+

+ has_trivial_assign<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/has_trivial_constructor.html b/doc/html/boost_typetraits/reference/has_trivial_constructor.html new file mode 100644 index 0000000..95cf0e8 --- /dev/null +++ b/doc/html/boost_typetraits/reference/has_trivial_constructor.html @@ -0,0 +1,137 @@ + + + +has_trivial_constructor + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct has_trivial_constructor : public true_type-or-false_type {};
+
+template <class T>
+struct has_trivial_default_constructor : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + type with a trivial default-constructor then inherits from true_type, + otherwise inherits from false_type. +

+

+ These two traits are synonyms for each other. +

+

+ If a type has a trivial default-constructor then the constructor have no + effect: calls to the constructor can be safely omitted. Note that using meta-programming + to omit a call to a single trivial-constructor call is of no benefit whatsoever. + However, if loops and/or exception handling code can also be omitted, then + some benefit in terms of code size and speed can be obtained. +

+

+ Compiler Compatibility: 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, 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. +

+

+ C++ Standard Reference: 12.1p6. +

+

+ Header: #include + <boost/type_traits/has_trivial_constructor.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ has_trivial_constructor<int> inherits from true_type. +

+

+

+
+
+

+

+

+ has_trivial_constructor<char*>::type + is the type true_type. +

+

+

+
+
+

+

+

+ has_trivial_constructor<int (*)(long)>::value + is an integral constant expression that evaluates to true. +

+

+

+
+
+

+

+

+ has_trivial_constructor<MyClass>::value + is an integral constant expression that evaluates to false. +

+

+

+
+
+

+

+

+ has_trivial_constructor<T>::value_type + is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/has_trivial_copy.html b/doc/html/boost_typetraits/reference/has_trivial_copy.html new file mode 100644 index 0000000..59bff4f --- /dev/null +++ b/doc/html/boost_typetraits/reference/has_trivial_copy.html @@ -0,0 +1,133 @@ + + + +has_trivial_copy + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct has_trivial_copy : public true_type-or-false_type {};
+
+template <class T>
+struct has_trivial_copy_constructor : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + type with a trivial copy-constructor then inherits from true_type, + otherwise inherits from false_type. +

+

+ These two traits are synonyms for each other. +

+

+ If a type has a trivial copy-constructor then the constructor has the same + effect as copying the bits of one object to the other: calls to the constructor + can be safely replaced with a call to memcpy. +

+

+ Compiler Compatibility: 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, 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. +

+

+ C++ Standard Reference: 12.8p6. +

+

+ Header: #include + <boost/type_traits/has_trivial_copy.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ has_trivial_copy<int> + inherits from true_type. +

+

+

+
+
+

+

+

+ has_trivial_copy<char*>::type is the type true_type. +

+

+

+
+
+

+

+

+ has_trivial_copy<int (*)(long)>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ has_trivial_copy<MyClass>::value is an integral constant expression + that evaluates to false. +

+

+

+
+
+

+

+

+ has_trivial_copy<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/has_trivial_cp_cons.html b/doc/html/boost_typetraits/reference/has_trivial_cp_cons.html new file mode 100644 index 0000000..b6ef80a --- /dev/null +++ b/doc/html/boost_typetraits/reference/has_trivial_cp_cons.html @@ -0,0 +1,45 @@ + + + +has_trivial_copy_constructor + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/has_trivial_def_cons.html b/doc/html/boost_typetraits/reference/has_trivial_def_cons.html new file mode 100644 index 0000000..0d99e05 --- /dev/null +++ b/doc/html/boost_typetraits/reference/has_trivial_def_cons.html @@ -0,0 +1,45 @@ + + + +has_trivial_default_constructor + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/has_trivial_destructor.html b/doc/html/boost_typetraits/reference/has_trivial_destructor.html new file mode 100644 index 0000000..ac9332e --- /dev/null +++ b/doc/html/boost_typetraits/reference/has_trivial_destructor.html @@ -0,0 +1,130 @@ + + + +has_trivial_destructor + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct has_trivial_destructor : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + type with a trivial destructor then inherits from true_type, + otherwise inherits from false_type. +

+

+ If a type has a trivial destructor then the destructor has no effect: calls + to the destructor can be safely omitted. Note that using meta-programming + to omit a call to a single trivial-constructor call is of no benefit whatsoever. + However, if loops and/or exception handling code can also be omitted, then + some benefit in terms of code size and speed can be obtained. +

+

+ Compiler Compatibility: 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, 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. +

+

+ C++ Standard Reference: 12.4p3. +

+

+ Header: #include + <boost/type_traits/has_trivial_destructor.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ has_trivial_destructor<int> inherits from true_type. +

+

+

+
+
+

+

+

+ has_trivial_destructor<char*>::type + is the type true_type. +

+

+

+
+
+

+

+

+ has_trivial_destructor<int (*)(long)>::value + is an integral constant expression that evaluates to true. +

+

+

+
+
+

+

+

+ has_trivial_destructor<MyClass>::value + is an integral constant expression that evaluates to false. +

+

+

+
+
+

+

+

+ has_trivial_destructor<T>::value_type + is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/has_virtual_destructor.html b/doc/html/boost_typetraits/reference/has_virtual_destructor.html new file mode 100644 index 0000000..fc2bba2 --- /dev/null +++ b/doc/html/boost_typetraits/reference/has_virtual_destructor.html @@ -0,0 +1,69 @@ + + + +has_virtual_destructor + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct has_virtual_destructor : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + type with a virtual destructor then inherits from true_type, + otherwise inherits from false_type. +

+

+ Compiler Compatibility: This trait is provided + for completeness, since it's part of the 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 has the necessary intrinsics. +

+

+ C++ Standard Reference: 12.4. +

+

+ Header: #include + <boost/type_traits/has_virtual_destructor.hpp> + or #include <boost/type_traits.hpp> +

+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/integral_constant.html b/doc/html/boost_typetraits/reference/integral_constant.html new file mode 100644 index 0000000..ccadf62 --- /dev/null +++ b/doc/html/boost_typetraits/reference/integral_constant.html @@ -0,0 +1,61 @@ + + + +integral_constant + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T, T val>
+struct integral_constant
+{
+   typedef integral_constant<T, val>  type;
+   typedef T                          value_type;
+   static const T value = val;
+};
+
+typedef integral_constant<bool, true>  true_type;
+typedef integral_constant<bool, false> false_type;
+
+

+ Class template integral_constant + is the common base class for all the value-based type traits. The two typedef's + true_type and false_type are provided for convenience: + most of the value traits are Boolean properties and so will inherit from + one of these. +

+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/integral_promotion.html b/doc/html/boost_typetraits/reference/integral_promotion.html new file mode 100644 index 0000000..e18cb0b --- /dev/null +++ b/doc/html/boost_typetraits/reference/integral_promotion.html @@ -0,0 +1,126 @@ + + + +integral_promotion + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct integral_promotion
+{
+   typedef see-below type;
+};
+
+

+ type: If integral promotion can be applied + to an rvalue of type T, then + applies integral promotion to T + and keeps cv-qualifiers of T, + otherwise leaves T unchanged. +

+

+ C++ Standard Reference: 4.5 except 4.5/3 + (integral bit-field). +

+

+ Header: #include + <boost/type_traits/integral_promotion.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.14. Examples

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

+ Expression +

+
+

+ Result Type +

+
+

+ integral_promotion<short + const>::type +

+
+

+ int const +

+
+

+ integral_promotion<short&>::type +

+
+

+ short& +

+
+

+ integral_promotion<enum std::float_round_style>::type +

+
+

+ int +

+
+
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_abstract.html b/doc/html/boost_typetraits/reference/is_abstract.html new file mode 100644 index 0000000..36dfa38 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_abstract.html @@ -0,0 +1,119 @@ + + + +is_abstract + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_abstract : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + abstract type then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 10.3. +

+

+ Header: #include + <boost/type_traits/is_abstract.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: The compiler must + support DR337 (as of April 2005: GCC 3.4, VC++ 7.1 (and later), Intel C++ + 7 (and later), and Comeau 4.3.2). Otherwise behaves the same as is_polymorphic; + this is the "safe fallback position" for which polymorphic types + are always regarded as potentially abstract. The macro BOOST_NO_IS_ABSTRACT + is used to signify that the implementation is buggy, users should check for + this in their own code if the "safe fallback" is not suitable for + their particular use-case. +

+

+ Examples: +

+
+

+

+

+ Given: class abc{ virtual ~abc() = 0; }; +

+

+

+
+
+

+

+

+ is_abstract<abc> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_abstract<abc>::type is the type true_type. +

+

+

+
+
+

+

+

+ is_abstract<abc const>::value + is an integral constant expression that evaluates to true. +

+

+

+
+
+

+

+

+ is_abstract<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_arithmetic.html b/doc/html/boost_typetraits/reference/is_arithmetic.html new file mode 100644 index 0000000..7f45356 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_arithmetic.html @@ -0,0 +1,102 @@ + + + +is_arithmetic + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_arithmetic : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + arithmetic type then inherits from true_type, + otherwise inherits from false_type. + Arithmetic types include integral and floating point types (see also is_integral and + is_floating_point). +

+

+ C++ Standard Reference: 3.9.1p8. +

+

+ Header: #include + <boost/type_traits/is_arithmetic.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ is_arithmetic<int> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_arithmetic<char>::type is the type true_type. +

+

+

+
+
+

+

+

+ is_arithmetic<double>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_arithmetic<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_array.html b/doc/html/boost_typetraits/reference/is_array.html new file mode 100644 index 0000000..6038fa2 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_array.html @@ -0,0 +1,105 @@ + + + +is_array + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_array : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + array type then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.2 and 8.3.4. +

+

+ Header: #include + <boost/type_traits/is_array.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: If the compiler + does not support partial-specialization of class templates, then this template + can give the wrong result with function types. +

+

+ Examples: +

+
+

+

+

+ is_array<int[2]> inherits from true_type. +

+

+

+
+
+

+

+

+ is_array<char[2][3]>::type + is the type true_type. +

+

+

+
+
+

+

+

+ is_array<double[]>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_array<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_base_of.html b/doc/html/boost_typetraits/reference/is_base_of.html new file mode 100644 index 0000000..99fb01b --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_base_of.html @@ -0,0 +1,154 @@ + + + +is_base_of + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class Base, class Derived>
+struct is_base_of : public true_type-or-false_type {};
+
+

+ Inherits: If Base is base class of type + Derived or if both types are the same then inherits from true_type, + otherwise inherits from false_type. +

+

+ This template will detect non-public base classes, and ambiguous base classes. +

+

+ Note that is_base_of<X,X> will always inherit from true_type. + This is the case even if X + is not a class type. This is a change in behaviour from Boost-1.33 + in order to track the Technical Report on C++ Library Extensions. +

+

+ Types Base and Derived must not be incomplete types. +

+

+ C++ Standard Reference: 10. +

+

+ Header: #include + <boost/type_traits/is_base_of.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: If the compiler + does not support partial-specialization of class templates, then this template + can not be used with function types. There are some older compilers which + will produce compiler errors if Base + is a private base class of Derived, + or if Base is an ambiguous + base of Derived. These compilers + include Borland C++, older versions of Sun Forte C++, Digital Mars C++, and + older versions of EDG based compilers. +

+

+ Examples: +

+
+

+

+

+ Given: class Base{}; class Derived : + public Base{}; +

+

+

+
+
+

+

+

+ is_base_of<Base, Derived> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_base_of<Base, Derived>::type is the type true_type. +

+

+

+
+
+

+

+

+ is_base_of<Base, Derived>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_base_of<Base, Derived>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_base_of<Base, Base>::value is an integral constant expression + that evaluates to true: a class is regarded as it's + own base. +

+

+

+
+
+

+

+

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

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_class.html b/doc/html/boost_typetraits/reference/is_class.html new file mode 100644 index 0000000..3a688c2 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_class.html @@ -0,0 +1,138 @@ + + + +is_class + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_class : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + class type then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.2 and 9.2. +

+

+ Header: #include + <boost/type_traits/is_class.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Without (some as + 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. +

+

+ Examples: +

+
+

+

+

+ Given: class MyClass; then: +

+

+

+
+
+

+

+

+ is_class<MyClass> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_class<MyClass const>::type + is the type true_type. +

+

+

+
+
+

+

+

+ is_class<MyClass>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_class<MyClass&>::value is an integral constant expression + that evaluates to false. +

+

+

+
+
+

+

+

+ is_class<MyClass*>::value is an integral constant expression + that evaluates to false. +

+

+

+
+
+

+

+

+ is_class<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_complex.html b/doc/html/boost_typetraits/reference/is_complex.html new file mode 100644 index 0000000..59419cf --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_complex.html @@ -0,0 +1,60 @@ + + + +is_complex + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_complex : public true_type-or-false_type {};
+
+

+ Inherits: If T + is a complex number type then true (of type std::complex<U> + for some type U), otherwise + false. +

+

+ C++ Standard Reference: 26.2. +

+

+ Header: #include + <boost/type_traits/is_complex.hpp> + or #include <boost/type_traits.hpp> +

+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_compound.html b/doc/html/boost_typetraits/reference/is_compound.html new file mode 100644 index 0000000..453c575 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_compound.html @@ -0,0 +1,121 @@ + + + +is_compound + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_compound : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + compound type then inherits from true_type, + otherwise inherits from false_type. + Any type that is not a fundamental type is a compound type (see also is_fundamental). +

+

+ C++ Standard Reference: 3.9.2. +

+

+ Header: #include + <boost/type_traits/is_compound.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ is_compound<MyClass> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_compound<MyEnum>::type is the type true_type. +

+

+

+
+
+

+

+

+ is_compound<int*>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_compound<int&>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

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

+

+

+
+
+

+

+

+ is_compound<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_const.html b/doc/html/boost_typetraits/reference/is_const.html new file mode 100644 index 0000000..6f2922c --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_const.html @@ -0,0 +1,131 @@ + + + +is_const + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_const : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (top level) const-qualified + type then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.3. +

+

+ Header: #include + <boost/type_traits/is_const.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ is_const<int const> inherits from true_type. +

+

+

+
+
+

+

+

+ is_const<int const volatile>::type is the type true_type. +

+

+

+
+
+

+

+

+ is_const<int* const>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_const<int const*>::value + is an integral constant expression that evaluates to false: + the const-qualifier is not at the top level in this case. +

+

+

+
+
+

+

+

+ is_const<int const&>::value + is an integral constant expression that evaluates to false: + the const-qualifier is not at the top level in this case. +

+

+

+
+
+

+

+

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

+

+

+
+
+

+

+

+ is_const<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_convertible.html b/doc/html/boost_typetraits/reference/is_convertible.html new file mode 100644 index 0000000..75a881a --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_convertible.html @@ -0,0 +1,172 @@ + + + +is_convertible + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class From, class To>
+struct is_convertible : public true_type-or-false_type {};
+
+

+ Inherits: If an imaginary lvalue of type + From is convertible to type + To then inherits from true_type, + otherwise inherits from false_type. +

+

+ Type From must not be an incomplete type. +

+

+ Type To must not be an incomplete, or function type. +

+

+ No types are considered to be convertible to array types or abstract-class + types. +

+

+ This template can not detect whether a converting-constructor is public or not: if type To + has a private converting constructor + from type From then instantiating + is_convertible<From, To> + will produce a compiler error. For this reason is_convertible + can not be used to determine whether a type has a public + copy-constructor or not. +

+

+ This template will also produce compiler errors if the conversion is ambiguous, + for example: +

+
+struct A {};
+struct B : A {};
+struct C : A {};
+struct D : B, C {};
+// This produces a compiler error, the conversion is ambiguous:
+bool const y = boost::is_convertible<D*,A*>::value;
+
+

+ C++ Standard Reference: 4 and 8.5. +

+

+ Compiler Compatibility: This template is + currently broken with Borland C++ Builder 5 (and earlier), for constructor-based + conversions, and for the Metrowerks 7 (and earlier) compiler in all cases. + If the compiler does not support is_abstract, + then the template parameter To + must not be an abstract type. +

+

+ Header: #include + <boost/type_traits/is_convertible.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ is_convertible<int, double> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_convertible<const int, double>::type + is the type true_type. +

+

+

+
+
+

+

+

+ is_convertible<int* const, int*>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_convertible<int const*, int*>::value + is an integral constant expression that evaluates to false: + the conversion would require a const_cast. +

+

+

+
+
+

+

+

+ is_convertible<int const&, long>::value + is an integral constant expression that evaluates to true. +

+

+

+
+
+

+

+

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

+

+

+
+
+

+

+

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

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_empty.html b/doc/html/boost_typetraits/reference/is_empty.html new file mode 100644 index 0000000..06d4100 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_empty.html @@ -0,0 +1,134 @@ + + + +is_empty + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_empty : public true_type-or-false_type {};
+
+

+ Inherits: If T is an empty class type then + inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 10p5. +

+

+ Header: #include + <boost/type_traits/is_empty.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: In order to correctly + detect empty classes this trait relies on either: +

+
    +
  • + the compiler implementing zero sized empty base classes, or +
  • +
  • + the compiler providing intrinsics + to detect empty classes. +
  • +
+

+ Can not be used with incomplete types. +

+

+ Can not be used with union types, until is_union can be made to work. +

+

+ If the compiler does not support partial-specialization of class templates, + then this template can not be used with abstract types. +

+

+ Examples: +

+
+

+

+

+ Given: struct empty_class + {}; +

+

+

+
+
+

+

+

+ is_empty<empty_class> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_empty<empty_class const>::type + is the type true_type. +

+

+

+
+
+

+

+

+ is_empty<empty_class>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_empty<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_enum.html b/doc/html/boost_typetraits/reference/is_enum.html new file mode 100644 index 0000000..1397ca2 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_enum.html @@ -0,0 +1,138 @@ + + + +is_enum + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_enum : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + enum type then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.2 and 7.2. +

+

+ Header: #include + <boost/type_traits/is_enum.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: Requires a correctly + functioning is_convertible + template; this means that is_enum is currently broken under Borland C++ Builder + 5, and for the Metrowerks compiler prior to version 8, other compilers should + handle this template just fine. +

+

+ Examples: +

+
+

+

+

+ Given: enum my_enum + { one, two }; +

+

+

+
+
+

+

+

+ is_enum<my_enum> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_enum<my_enum const>::type + is the type true_type. +

+

+

+
+
+

+

+

+ is_enum<my_enum>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_enum<my_enum&>::value is an integral constant expression + that evaluates to false. +

+

+

+
+
+

+

+

+ is_enum<my_enum*>::value is an integral constant expression + that evaluates to false. +

+

+

+
+
+

+

+

+ is_enum<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_floating_point.html b/doc/html/boost_typetraits/reference/is_floating_point.html new file mode 100644 index 0000000..8e53ebe --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_floating_point.html @@ -0,0 +1,100 @@ + + + +is_floating_point + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_floating_point : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + floating point type then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.1p8. +

+

+ Header: #include + <boost/type_traits/is_floating_point.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ is_floating_point<float> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_floating_point<double>::type is the type true_type. +

+

+

+
+
+

+

+

+ is_floating_point<long double>::value + is an integral constant expression that evaluates to true. +

+

+

+
+
+

+

+

+ is_floating_point<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_function.html b/doc/html/boost_typetraits/reference/is_function.html new file mode 100644 index 0000000..5a1e59a --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_function.html @@ -0,0 +1,213 @@ + + + +is_function + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_function : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + function type then inherits from true_type, + otherwise inherits from false_type. + Note that this template does not detect pointers to functions, + or references to functions, these are detected by is_pointer and is_reference respectively: +

+
+typedef int f1();      // f1 is of function type.
+typedef int (f2*)();   // f2 is a pointer to a function.
+typedef int (f3&)();   // f3 is a reference to a function.
+
+

+ C++ Standard Reference: 3.9.2p1 and 8.3.5. +

+

+ Header: #include + <boost/type_traits/is_function.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ is_function<int (void)> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_function<long (double, int)>::type is the type true_type. +

+

+

+
+
+

+

+

+ is_function<long (double, int)>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_function<long (*)(double, int)>::value is an integral constant expression + that evaluates to false: the argument in this case + is a pointer type, not a function type. +

+

+

+
+
+

+

+

+ is_function<long (&)(double, int)>::value is an integral constant expression + that evaluates to false: the argument in this case + is a reference to a function, not a function type. +

+

+

+
+
+

+

+

+ is_function<long (MyClass::*)(double, int)>::value is an integral constant expression + that evaluates to false: the argument in this case + is a pointer to a member function. +

+

+

+
+
+

+

+

+ is_function<T>::value_type is the type bool. +

+

+

+
+
+ + + + + +
[Tip]Tip
+

+

+

+ Don't confuse function-types with pointers to functions: +

+

+

+

+ typedef int + f(double); +

+

+

+

+ defines a function type, +

+

+

+

+ f foo; +

+

+

+

+ declares a prototype for a function of type f, +

+

+

+

+ f* + pf = + foo; +

+

+

+

+ f& + fr = + foo; +

+

+

+

+ declares a pointer and a reference to the function foo. +

+

+

+

+ If you want to detect whether some type is a pointer-to-function then + use: +

+

+

+

+ is_function<remove_pointer<T>::type>::value + && is_pointer<T>::value +

+

+

+

+ or for pointers to member functions you can just use is_member_function_pointer + directly. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_fundamental.html b/doc/html/boost_typetraits/reference/is_fundamental.html new file mode 100644 index 0000000..d01c1a2 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_fundamental.html @@ -0,0 +1,105 @@ + + + +is_fundamental + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_fundamental : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + fundamental type then inherits from true_type, + otherwise inherits from false_type. + Fundamental types include integral, floating point and void types (see also + is_integral, + is_floating_point + and is_void) +

+

+ C++ Standard Reference: 3.9.1. +

+

+ Header: #include + <boost/type_traits/is_fundamental.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ is_fundamental<int)> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_fundamental<double const>::type + is the type true_type. +

+

+

+
+
+

+

+

+ is_fundamental<void>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_fundamental<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_integral.html b/doc/html/boost_typetraits/reference/is_integral.html new file mode 100644 index 0000000..9852baa --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_integral.html @@ -0,0 +1,101 @@ + + + +is_integral + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_integral : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + integral type then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.1p7. +

+

+ Header: #include + <boost/type_traits/is_integral.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ is_integral<int> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_integral<const char>::type + is the type true_type. +

+

+

+
+
+

+

+

+ is_integral<long>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_integral<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_member_function_pointer.html b/doc/html/boost_typetraits/reference/is_member_function_pointer.html new file mode 100644 index 0000000..4586bac --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_member_function_pointer.html @@ -0,0 +1,115 @@ + + + +is_member_function_pointer + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_member_function_pointer : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + pointer to a member function then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.2 and 8.3.3. +

+

+ Header: #include + <boost/type_traits/is_member_function_pointer.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ is_member_function_pointer<int (MyClass::*)(void)> inherits from true_type. +

+

+

+
+
+

+

+

+ is_member_function_pointer<int (MyClass::*)(char)>::type + is the type true_type. +

+

+

+
+
+

+

+

+ is_member_function_pointer<int (MyClass::*)(void)const>::value + is an integral constant expression that evaluates to true. +

+

+

+
+
+

+

+

+ is_member_function_pointer<int (MyClass::*)>::value + is an integral constant expression that evaluates to false: + the argument in this case is a pointer to a data member and not a member + function, see is_member_object_pointer + and is_member_pointer +

+

+

+
+
+

+

+

+ is_member_function_pointer<T>::value_type + is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_member_object_pointer.html b/doc/html/boost_typetraits/reference/is_member_object_pointer.html new file mode 100644 index 0000000..e9247f0 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_member_object_pointer.html @@ -0,0 +1,115 @@ + + + +is_member_object_pointer + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_member_object_pointer : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + pointer to a member object (a data member) then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.2 and 8.3.3. +

+

+ Header: #include + <boost/type_traits/is_member_object_pointer.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ is_member_object_pointer<int (MyClass::*)> inherits from true_type. +

+

+

+
+
+

+

+

+ is_member_object_pointer<double (MyClass::*)>::type + is the type true_type. +

+

+

+
+
+

+

+

+ is_member_object_pointer<const int (MyClass::*)>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_member_object_pointer<int (MyClass::*)(void)>::value + is an integral constant expression that evaluates to false: + the argument in this case is a pointer to a member function and not a + member object, see is_member_function_pointer + and is_member_pointer +

+

+

+
+
+

+

+

+ is_member_object_pointer<T>::value_type + is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_member_pointer.html b/doc/html/boost_typetraits/reference/is_member_pointer.html new file mode 100644 index 0000000..c0e964e --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_member_pointer.html @@ -0,0 +1,101 @@ + + + +is_member_pointer + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_member_pointer : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + pointer to a member (either a function or a data member) then inherits from + true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.2 and 8.3.3. +

+

+ Header: #include + <boost/type_traits/is_member_pointer.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ is_member_pointer<int (MyClass::*)> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_member_pointer<int (MyClass::*)(char)>::type is the type true_type. +

+

+

+
+
+

+

+

+ is_member_pointer<int (MyClass::*)(void)const>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_member_pointer<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_object.html b/doc/html/boost_typetraits/reference/is_object.html new file mode 100644 index 0000000..afb73b1 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_object.html @@ -0,0 +1,144 @@ + + + +is_object + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_object : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + object type then inherits from true_type, + otherwise inherits from false_type. + All types are object types except references, void, and function types. +

+

+ C++ Standard Reference: 3.9p9. +

+

+ Header: #include + <boost/type_traits/is_object.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ is_object<int> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_object<int*>::type is the type true_type. +

+

+

+
+
+

+

+

+ is_object<int (*)(void)>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_object<int (MyClass::*)(void)const>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_object<int &>::value is an integral constant expression + that evaluates to false: reference types are not + objects +

+

+

+
+
+

+

+

+ is_object<int (double)>::value is an integral constant expression + that evaluates to false: function types are not + objects +

+

+

+
+
+

+

+

+ is_object<const void>::value + is an integral constant expression that evaluates to false: + void is not an object type +

+

+

+
+
+

+

+

+ is_object<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_pod.html b/doc/html/boost_typetraits/reference/is_pod.html new file mode 100644 index 0000000..b932557 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_pod.html @@ -0,0 +1,131 @@ + + + +is_pod + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_pod : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + POD type then inherits from true_type, + otherwise inherits from false_type. +

+

+ POD stands for "Plain old data". Arithmetic types, and enumeration + types, a pointers and pointer to members are all PODs. Classes and unions + can also be POD's if they have no non-static data members that are of reference + or non-POD type, no user defined constructors, no user defined assignment + operators, no private or protected non-static data members, no virtual functions + and no base classes. Finally, a cv-qualified POD is still a POD, as is an + array of PODs. +

+

+ C++ Standard Reference: 3.9p10 and 9p4 (Note + that POD's are also aggregates, see 8.5.1). +

+

+ Compiler Compatibility: 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, 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. +

+

+ Header: #include + <boost/type_traits/is_pod.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ is_pod<int> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_pod<char*>::type is the type true_type. +

+

+

+
+
+

+

+

+ is_pod<int (*)(long)>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_pod<MyClass>::value is an integral constant expression + that evaluates to false. +

+

+

+
+
+

+

+

+ is_pod<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_pointer.html b/doc/html/boost_typetraits/reference/is_pointer.html new file mode 100644 index 0000000..5a1c6f6 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_pointer.html @@ -0,0 +1,144 @@ + + + +is_pointer + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_pointer : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + pointer type (includes function pointers, but excludes pointers to members) + then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.2p2 and 8.3.1. +

+

+ Header: #include + <boost/type_traits/is_pointer.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ is_pointer<int*> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_pointer<char* const>::type is the type true_type. +

+

+

+
+
+

+

+

+ is_pointer<int (*)(long)>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_pointer<int (MyClass::*)(long)>::value is an integral constant expression + that evaluates to false. +

+

+

+
+
+

+

+

+ is_pointer<int (MyClass::*)>::value is an integral constant expression + that evaluates to false. +

+

+

+
+
+

+

+

+ is_pointer<T>::value_type is the type bool. +

+

+

+
+
+ + + + + +
[Important]Important
+

+

+

+ is_pointer detects "real" + pointer types only, and not smart pointers. Users + should not specialise is_pointer + for smart pointer types, as doing so may cause Boost (and other third + party) code to fail to function correctly. Users wanting a trait to detect + smart pointers should create their own. However, note that there is no + way in general to auto-magically detect smart pointer types, so such + a trait would have to be partially specialised for each supported smart + pointer type. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_polymorphic.html b/doc/html/boost_typetraits/reference/is_polymorphic.html new file mode 100644 index 0000000..8ba6496 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_polymorphic.html @@ -0,0 +1,117 @@ + + + +is_polymorphic + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_polymorphic : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + polymorphic type then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete + type. +

+

+ C++ Standard Reference: 10.3. +

+

+ Compiler Compatibility: The implementation + requires some knowledge of the compilers ABI, it does actually seem to work + with the majority of compilers though. +

+

+ Header: #include + <boost/type_traits/is_polymorphic.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ Given: class poly{ virtual ~poly(); }; +

+

+

+
+
+

+

+

+ is_polymorphic<poly> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_polymorphic<poly const>::type + is the type true_type. +

+

+

+
+
+

+

+

+ is_polymorphic<poly>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_polymorphic<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_reference.html b/doc/html/boost_typetraits/reference/is_reference.html new file mode 100644 index 0000000..e2f2192 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_reference.html @@ -0,0 +1,108 @@ + + + +is_reference + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_reference : public true_type-or-false_type {};
+
+

+ Inherits: If T is a reference pointer type + then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.2 and 8.3.2. +

+

+ Compiler Compatibility: If the compiler + does not support partial-specialization of class templates, then this template + may report the wrong result for function types, and for types that are both + const and volatile qualified. +

+

+ Header: #include + <boost/type_traits/is_reference.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ is_reference<int&> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_reference<int const&>::type + is the type true_type. +

+

+

+
+
+

+

+

+ is_reference<int (&)(long)>::value is an integral constant expression + that evaluates to true (the argument in this case + is a reference to a function). +

+

+

+
+
+

+

+

+ is_reference<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_same.html b/doc/html/boost_typetraits/reference/is_same.html new file mode 100644 index 0000000..198aa4f --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_same.html @@ -0,0 +1,122 @@ + + + +is_same + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T, class U>
+struct is_same : public true_type-or-false_type {};
+
+

+ Inherits: If T and U are the same types + then inherits from true_type, + otherwise inherits from false_type. +

+

+ Header: #include + <boost/type_traits/is_same.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: If the compiler + does not support partial-specialization of class templates, then this template + can not be used with abstract, incomplete or function types. +

+

+ Examples: +

+
+

+

+

+ is_same<int, int> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_same<int, int>::type is the type true_type. +

+

+

+
+
+

+

+

+ is_same<int, int>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

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

+

+

+
+
+

+

+

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

+

+

+
+
+

+

+

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

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_scalar.html b/doc/html/boost_typetraits/reference/is_scalar.html new file mode 100644 index 0000000..a2c1119 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_scalar.html @@ -0,0 +1,137 @@ + + + +is_scalar + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_scalar : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + scalar type then inherits from true_type, + otherwise inherits from false_type. + Scalar types include integral, floating point, enumeration, pointer, and + pointer-to-member types. +

+

+ C++ Standard Reference: 3.9p10. +

+

+ Header: #include + <boost/type_traits/is_scalar.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: If the compiler + does not support partial-specialization of class templates, then this template + can not be used with function types. +

+

+ Examples: +

+
+

+

+

+ is_scalar<int*> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_scalar<int>::type is the type true_type. +

+

+

+
+
+

+

+

+ is_scalar<double>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_scalar<int (*)(long)>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_scalar<int (MyClass::*)(long)>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_scalar<int (MyClass::*)>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_scalar<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_signed.html b/doc/html/boost_typetraits/reference/is_signed.html new file mode 100644 index 0000000..680dbaa --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_signed.html @@ -0,0 +1,131 @@ + + + +is_signed + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_signed : public true_type-or-false_type {};
+
+

+ Inherits: If T is an signed integer type + or an enumerated type with an underlying signed integer type, then inherits + from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.1, 7.2. +

+

+ Header: #include + <boost/type_traits/is_signed.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ is_signed<int> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_signed<int const volatile>::type is the type true_type. +

+

+

+
+
+

+

+

+ is_signed<unsigned int>::value + is an integral constant expression that evaluates to false. +

+

+

+
+
+

+

+

+ is_signed<myclass>::value is an integral constant expression + that evaluates to false. +

+

+

+
+
+

+

+

+ is_signed<char>::value is an integral constant expression + whose value depends upon the signedness of type char. +

+

+

+
+
+

+

+

+ is_signed<long long>::value + is an integral constant expression that evaluates to true. +

+

+

+
+
+

+

+

+ is_signed<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_stateless.html b/doc/html/boost_typetraits/reference/is_stateless.html new file mode 100644 index 0000000..c7d63bf --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_stateless.html @@ -0,0 +1,87 @@ + + + +is_stateless + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_stateless : public true_type-or-false_type {};
+
+

+ Inherits: Ff T is a stateless type then + inherits from true_type, + otherwise from false_type. +

+

+ Type T must be a complete type. +

+

+ A stateless type is a type that has no storage and whose constructors and + destructors are trivial. That means that is_stateless + only inherits from true_type + if the following expression is true: +

+
+::boost::has_trivial_constructor<T>::value
+&& ::boost::has_trivial_copy<T>::value
+&& ::boost::has_trivial_destructor<T>::value
+&& ::boost::is_class<T>::value
+&& ::boost::is_empty<T>::value
+
+

+ C++ Standard Reference: 3.9p10. +

+

+ Header: #include + <boost/type_traits/is_stateless.hpp> + or #include <boost/type_traits.hpp> +

+

+ Compiler Compatibility: 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, 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. +

+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_union.html b/doc/html/boost_typetraits/reference/is_union.html new file mode 100644 index 0000000..a051ae4 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_union.html @@ -0,0 +1,124 @@ + + + +is_union + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_union : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + union type then inherits from true_type, + otherwise inherits from false_type. + Currently requires some kind of compiler support, otherwise unions are identified + as classes. +

+

+ C++ Standard Reference: 3.9.2 and 9.5. +

+

+ Compiler Compatibility: 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. +

+

+ Header: #include + <boost/type_traits/is_union.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ is_union<void> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_union<const void>::type + is the type true_type. +

+

+

+
+
+

+

+

+ is_union<void>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_union<void*>::value is an integral constant expression + that evaluates to false. +

+

+

+
+
+

+

+

+ is_union<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_unsigned.html b/doc/html/boost_typetraits/reference/is_unsigned.html new file mode 100644 index 0000000..d18fdbf --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_unsigned.html @@ -0,0 +1,133 @@ + + + +is_unsigned + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_unsigned : public true_type-or-false_type {};
+
+

+ Inherits: If T is an unsigned integer type + or an enumerated type with an underlying unsigned integer type, then inherits + from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.1, 7.2. +

+

+ Header: #include + <boost/type_traits/is_unsigned.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ is_unsigned<unsigned int> inherits from true_type. +

+

+

+
+
+

+

+

+ is_unsigned<unsigned int + const volatile>::type + is the type true_type. +

+

+

+
+
+

+

+

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

+

+

+
+
+

+

+

+ is_unsigned<myclass>::value is an integral constant expression + that evaluates to false. +

+

+

+
+
+

+

+

+ is_unsigned<char>::value is an integral constant expression + whose value depends upon the signedness of type char. +

+

+

+
+
+

+

+

+ is_unsigned<unsigned long + long>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_unsigned<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_void.html b/doc/html/boost_typetraits/reference/is_void.html new file mode 100644 index 0000000..12b570a --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_void.html @@ -0,0 +1,111 @@ + + + +is_void + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_void : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (possibly cv-qualified) + void type then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.1p9. +

+

+ Header: #include + <boost/type_traits/is_void.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ is_void<void> + inherits from true_type. +

+

+

+
+
+

+

+

+ is_void<const void>::type + is the type true_type. +

+

+

+
+
+

+

+

+ is_void<void>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_void<void*>::value is an integral constant expression + that evaluates to false. +

+

+

+
+
+

+

+

+ is_void<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/is_volatile.html b/doc/html/boost_typetraits/reference/is_volatile.html new file mode 100644 index 0000000..fa1b090 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_volatile.html @@ -0,0 +1,111 @@ + + + +is_volatile + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct is_volatile : public true_type-or-false_type {};
+
+

+ Inherits: If T is a (top level) volatile-qualified + type then inherits from true_type, + otherwise inherits from false_type. +

+

+ C++ Standard Reference: 3.9.3. +

+

+ Header: #include + <boost/type_traits/is_volatile.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ is_volatile<volatile int> inherits from true_type. +

+

+

+
+
+

+

+

+ is_volatile<const volatile + int>::type is the type true_type. +

+

+

+
+
+

+

+

+ is_volatile<int* volatile>::value is an integral constant expression + that evaluates to true. +

+

+

+
+
+

+

+

+ is_volatile<int volatile*>::value + is an integral constant expression that evaluates to false: + the volatile qualifier is not at the top level in this case. +

+

+

+
+
+

+

+

+ is_volatile<T>::value_type is the type bool. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/make_signed.html b/doc/html/boost_typetraits/reference/make_signed.html new file mode 100644 index 0000000..4e856fc --- /dev/null +++ b/doc/html/boost_typetraits/reference/make_signed.html @@ -0,0 +1,157 @@ + + + +make_signed + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct make_signed
+{
+   typedef see-below type;
+};
+
+

+ type: If T is a signed integer type then + the same type as T, if T is an unsigned integer type then the corresponding + signed type. Otherwise if T is an enumerated or character type (char or wchar_t) + then a signed integer type with the same width as T. +

+

+ If T has any cv-qualifiers then these are also present on the result type. +

+

+ Requires: T must be an integer or enumerated + type, and must not be the type bool. +

+

+ C++ Standard Reference: 3.9.1. +

+

+ Header: #include + <boost/type_traits/make_signed.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.15. Examples

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

+ Expression +

+
+

+ Result Type +

+
+

+ make_signed<int>::type +

+
+

+ int +

+
+

+ make_signed<unsigned int + const>::type +

+
+

+ int const +

+
+

+ make_signed<const unsigned + long long>::type +

+
+

+ const long + long +

+
+

+ make_signed<my_enum>::type +

+
+

+ A signed integer type with the same width as the enum. +

+
+

+ make_signed<wchar_t>::type +

+
+

+ A signed integer type with the same width as wchar_t. +

+
+
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/make_unsigned.html b/doc/html/boost_typetraits/reference/make_unsigned.html new file mode 100644 index 0000000..239331b --- /dev/null +++ b/doc/html/boost_typetraits/reference/make_unsigned.html @@ -0,0 +1,158 @@ + + + +make_unsigned + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct make_unsigned
+{
+   typedef see-below type;
+};
+
+

+ type: If T is a unsigned integer type then + the same type as T, if T is an signed integer type then the corresponding + unsigned type. Otherwise if T is an enumerated or character type (char or + wchar_t) then an unsigned integer type with the same width as T. +

+

+ If T has any cv-qualifiers then these are also present on the result type. +

+

+ Requires: T must be an integer or enumerated + type, and must not be the type bool. +

+

+ C++ Standard Reference: 3.9.1. +

+

+ Header: #include + <boost/type_traits/make_unsigned.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.16. Examples

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

+ Expression +

+
+

+ Result Type +

+
+

+ make_signed<int>::type +

+
+

+ unsigned int +

+
+

+ make_signed<unsigned int + const>::type +

+
+

+ unsigned int + const +

+
+

+ make_signed<const unsigned + long long>::type +

+
+

+ const unsigned + long long +

+
+

+ make_signed<my_enum>::type +

+
+

+ An unsigned integer type with the same width as the enum. +

+
+

+ make_signed<wchar_t>::type +

+
+

+ An unsigned integer type with the same width as wchar_t. +

+
+
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/promote.html b/doc/html/boost_typetraits/reference/promote.html new file mode 100644 index 0000000..66d1db9 --- /dev/null +++ b/doc/html/boost_typetraits/reference/promote.html @@ -0,0 +1,127 @@ + + + +promote + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct promote
+{
+   typedef see-below type;
+};
+
+

+ type: If integral or floating point promotion + can be applied to an rvalue of type T, + then applies integral and floating point promotions to T + and keeps cv-qualifiers of T, + otherwise leaves T unchanged. + See also integral_promotion + and floating_point_promotion. +

+

+ C++ Standard Reference: 4.5 except 4.5/3 + (integral bit-field) and 4.6. +

+

+ Header: #include + <boost/type_traits/promote.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.17. Examples

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

+ Expression +

+
+

+ Result Type +

+
+

+ promote<short volatile>::type +

+
+

+ int volatile +

+
+

+ promote<float const>::type +

+
+

+ double const +

+
+

+ promote<short&>::type +

+
+

+ short& +

+
+
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/rank.html b/doc/html/boost_typetraits/reference/rank.html new file mode 100644 index 0000000..b60bfc2 --- /dev/null +++ b/doc/html/boost_typetraits/reference/rank.html @@ -0,0 +1,122 @@ + + + +rank + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+

+ rank +

+
+template <class T>
+struct rank : public integral_constant<std::size_t, RANK(T)> {};
+
+

+ Inherits: Class template rank inherits from + integral_constant<std::size_t, RANK(T)>, + where RANK(T) is the + number of array dimensions in type T. +

+

+ If T is not an array type, + then RANK(T) is zero. +

+

+ Header: #include + <boost/type_traits/rank.hpp> + or #include <boost/type_traits.hpp> +

+

+ Examples: +

+
+

+

+

+ rank<int[]> + inherits from integral_constant<std::size_t, 1>. +

+

+

+
+
+

+

+

+ rank<double[2][3][4]>::type is the type integral_constant<std::size_t, 3>. +

+

+

+
+
+

+

+

+ rank<int[1]>::value + is an integral constant expression that evaluates to 1. +

+

+

+
+
+

+

+

+ rank<int[][2]>::value is an integral constant expression + that evaluates to 2. +

+

+

+
+
+

+

+

+ rank<int*>::value is an integral constant expression + that evaluates to 0. +

+

+

+
+
+

+

+

+ rank<T>::value_type is the type std::size_t. +

+

+

+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/remove_all_extents.html b/doc/html/boost_typetraits/reference/remove_all_extents.html new file mode 100644 index 0000000..a170362 --- /dev/null +++ b/doc/html/boost_typetraits/reference/remove_all_extents.html @@ -0,0 +1,154 @@ + + + +remove_all_extents + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct remove_all_extents
+{
+   typedef see-below type;
+};
+
+

+ type: If T + is an array type, then removes all of the array bounds on T, + otherwise leaves T unchanged. +

+

+ C++ Standard Reference: 8.3.4. +

+

+ Compiler Compatibility: If the compiler + does not support partial specialization of class-templates then this template + will compile, but the member type + will always be the same as type T + except where compiler + workarounds have been applied. +

+

+ Header: #include + <boost/type_traits/remove_all_extents.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.18. Examples

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

+ Expression +

+
+

+ Result Type +

+
+

+ remove_all_extents<int>::type +

+
+

+ int +

+
+

+ remove_all_extents<int const[2]>::type +

+
+

+ int const +

+
+

+ remove_all_extents<int[][2]>::type +

+
+

+ int +

+
+

+ remove_all_extents<int[2][3][4]>::type +

+
+

+ int +

+
+

+ remove_all_extents<int const*>::type +

+
+

+ int const* +

+
+
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/remove_const.html b/doc/html/boost_typetraits/reference/remove_const.html new file mode 100644 index 0000000..a88c258 --- /dev/null +++ b/doc/html/boost_typetraits/reference/remove_const.html @@ -0,0 +1,154 @@ + + + +remove_const + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct remove_const
+{
+   typedef see-below type;
+};
+
+

+ type: The same type as T, + but with any top level const-qualifier removed. +

+

+ C++ Standard Reference: 3.9.3. +

+

+ Compiler Compatibility: If the compiler + does not support partial specialization of class-templates then this template + will compile, but the member type + will always be the same as type T + except where compiler + workarounds have been applied. +

+

+ Header: #include + <boost/type_traits/remove_const.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.19. Examples

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

+ Expression +

+
+

+ Result Type +

+
+

+ remove_const<int>::type +

+
+

+ int +

+
+

+ remove_const<int const>::type +

+
+

+ int +

+
+

+ remove_const<int const + volatile>::type +

+
+

+ int volatile +

+
+

+ remove_const<int const&>::type +

+
+

+ int const& +

+
+

+ remove_const<int const*>::type +

+
+

+ int const* +

+
+
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/remove_cv.html b/doc/html/boost_typetraits/reference/remove_cv.html new file mode 100644 index 0000000..1f7251b --- /dev/null +++ b/doc/html/boost_typetraits/reference/remove_cv.html @@ -0,0 +1,154 @@ + + + +remove_cv + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct remove_cv
+{
+   typedef see-below type;
+};
+
+

+ type: The same type as T, + but with any top level cv-qualifiers removed. +

+

+ C++ Standard Reference: 3.9.3. +

+

+ Compiler Compatibility: If the compiler + does not support partial specialization of class-templates then this template + will compile, but the member type + will always be the same as type T + except where compiler + workarounds have been applied. +

+

+ Header: #include + <boost/type_traits/remove_cv.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.20. Examples

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

+ Expression +

+
+

+ Result Type +

+
+

+ remove_cv<int>::type +

+
+

+ int +

+
+

+ remove_cv<int const>::type +

+
+

+ int +

+
+

+ remove_cv<int const + volatile>::type +

+
+

+ int +

+
+

+ remove_cv<int const&>::type +

+
+

+ int const& +

+
+

+ remove_cv<int const*>::type +

+
+

+ int const* +

+
+
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/remove_extent.html b/doc/html/boost_typetraits/reference/remove_extent.html new file mode 100644 index 0000000..5e0031a --- /dev/null +++ b/doc/html/boost_typetraits/reference/remove_extent.html @@ -0,0 +1,154 @@ + + + +remove_extent + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct remove_extent
+{
+   typedef see-below type;
+};
+
+

+ type: If T + is an array type, then removes the topmost array bound, otherwise leaves + T unchanged. +

+

+ C++ Standard Reference: 8.3.4. +

+

+ Compiler Compatibility: If the compiler + does not support partial specialization of class-templates then this template + will compile, but the member type + will always be the same as type T + except where compiler + workarounds have been applied. +

+

+ Header: #include + <boost/type_traits/remove_extent.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.21. Examples

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

+ Expression +

+
+

+ Result Type +

+
+

+ remove_extent<int>::type +

+
+

+ int +

+
+

+ remove_extent<int const[2]>::type +

+
+

+ int const +

+
+

+ remove_extent<int[2][4]>::type +

+
+

+ int[4] +

+
+

+ remove_extent<int[][2]>::type +

+
+

+ int[2] +

+
+

+ remove_extent<int const*>::type +

+
+

+ int const* +

+
+
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/remove_pointer.html b/doc/html/boost_typetraits/reference/remove_pointer.html new file mode 100644 index 0000000..714c641 --- /dev/null +++ b/doc/html/boost_typetraits/reference/remove_pointer.html @@ -0,0 +1,153 @@ + + + +remove_pointer + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct remove_pointer
+{
+   typedef see-below type;
+};
+
+

+ type: The same type as T, + but with any pointer modifier removed. +

+

+ C++ Standard Reference: 8.3.1. +

+

+ Compiler Compatibility: If the compiler + does not support partial specialization of class-templates then this template + will compile, but the member type + will always be the same as type T + except where compiler + workarounds have been applied. +

+

+ Header: #include + <boost/type_traits/remove_pointer.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.22. Examples

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

+ Expression +

+
+

+ Result Type +

+
+

+ remove_pointer<int>::type +

+
+

+ int +

+
+

+ remove_pointer<int const*>::type +

+
+

+ int const +

+
+

+ remove_pointer<int const**>::type +

+
+

+ int const* +

+
+

+ remove_pointer<int&>::type +

+
+

+ int& +

+
+

+ remove_pointer<int*&>::type +

+
+

+ int*& +

+
+
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/remove_reference.html b/doc/html/boost_typetraits/reference/remove_reference.html new file mode 100644 index 0000000..c029b42 --- /dev/null +++ b/doc/html/boost_typetraits/reference/remove_reference.html @@ -0,0 +1,141 @@ + + + +remove_reference + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct remove_reference
+{
+   typedef see-below type;
+};
+
+

+ type: The same type as T, + but with any reference modifier removed. +

+

+ C++ Standard Reference: 8.3.2. +

+

+ Compiler Compatibility: If the compiler + does not support partial specialization of class-templates then this template + will compile, but the member type + will always be the same as type T + except where compiler + workarounds have been applied. +

+

+ Header: #include + <boost/type_traits/remove_reference.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.23. Examples

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

+ Expression +

+
+

+ Result Type +

+
+

+ remove_reference<int>::type +

+
+

+ int +

+
+

+ remove_reference<int const&>::type +

+
+

+ int const +

+
+

+ remove_reference<int*>::type +

+
+

+ int* +

+
+

+ remove_reference<int*&>::type +

+
+

+ int* +

+
+
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/remove_volatile.html b/doc/html/boost_typetraits/reference/remove_volatile.html new file mode 100644 index 0000000..e450013 --- /dev/null +++ b/doc/html/boost_typetraits/reference/remove_volatile.html @@ -0,0 +1,154 @@ + + + +remove_volatile + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <class T>
+struct remove_volatile
+{
+   typedef see-below type;
+};
+
+

+ type: The same type as T, + but with any top level volatile-qualifier removed. +

+

+ C++ Standard Reference: 3.9.3. +

+

+ Compiler Compatibility: If the compiler + does not support partial specialization of class-templates then this template + will compile, but the member type + will always be the same as type T + except where compiler + workarounds have been applied. +

+

+ Header: #include + <boost/type_traits/remove_volatile.hpp> + or #include <boost/type_traits.hpp> +

+
+

Table 1.24. Examples

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

+ Expression +

+
+

+ Result Type +

+
+

+ remove_volatile<int>::type +

+
+

+ int +

+
+

+ remove_volatile<int volatile>::type +

+
+

+ int +

+
+

+ remove_volatile<int const + volatile>::type +

+
+

+ int const +

+
+

+ remove_volatile<int volatile&>::type +

+
+

+ int const& +

+
+

+ remove_volatile<int volatile*>::type +

+
+

+ int const* +

+
+
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/reference/type_with_alignment.html b/doc/html/boost_typetraits/reference/type_with_alignment.html new file mode 100644 index 0000000..7426a22 --- /dev/null +++ b/doc/html/boost_typetraits/reference/type_with_alignment.html @@ -0,0 +1,58 @@ + + + +type_with_alignment + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+template <std::size_t Align>
+struct type_with_alignment
+{
+   typedef see-below type;
+};
+
+

+ type: a built-in or POD type with an alignment + that is a multiple of Align. +

+

+ Header: #include + <boost/type_traits/type_with_alignment.hpp> + or #include <boost/type_traits.hpp> +

+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_typetraits/user_defined.html b/doc/html/boost_typetraits/user_defined.html new file mode 100644 index 0000000..f52b1fb --- /dev/null +++ b/doc/html/boost_typetraits/user_defined.html @@ -0,0 +1,77 @@ + + + +User Defined Specializations + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Occationally the end user may need to provide their own specialization for + one of the type traits - typically where intrinsic compiler support is required + to implement a specific trait fully. These specializations should derive from + boost::true_type + or boost::false_type + as appropriate: +

+
+#include <boost/type_traits/is_pod.hpp>
+#include <boost/type_traits/is_class.hpp>
+#include <boost/type_traits/is_union.hpp>
+
+struct my_pod{};
+struct my_union
+{
+   char c;
+   int i;
+};
+
+namespace boost
+{
+   template<>
+   struct is_pod<my_pod> : public true_type{};
+      
+   template<>
+   struct is_pod<my_union> : public true_type{};
+   
+   template<>
+   struct is_union<my_union> : public true_type{};
+   
+   template<>
+   struct is_class<my_union> : public false_type{};
+}
+
+
+ + + +
Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, + Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat + Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert + Ramey and Jeremy Siek
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/index.html b/doc/html/index.html new file mode 100644 index 0000000..6f3dc46 --- /dev/null +++ b/doc/html/index.html @@ -0,0 +1,164 @@ + + + +Chapter 1. Boost.TypeTraits + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
Next
+
+
+

+Chapter 1. Boost.TypeTraits

+
+
+

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

+
+
+
+

Table of Contents

+
+
Introduction
+
Background and Tutorial
+
Type Traits by Category
+
+
Type Traits + that Describe the Properties of a Type
+
+
Categorizing + a Type
+
+ General Type Properties
+
Relationships + Between Two Types
+
+
Type Traits that + Transform One Type to Another
+
Synthesizing Types + with Specific Alignments
+
Decomposing Function + Types
+
+
User Defined Specializations
+
Support for Compiler Intrinsics
+
MPL Interoperability
+
Examples
+
+
An Optimized Version + of std::copy
+
An Optimised Version + of std::fill
+
An Example that + Omits Destructor Calls For Types with Trivial Destructors
+
An improved Version + of std::iter_swap
+
Convert Numeric + Types and Enums to double
+
+
Alphabetical Reference
+
+
add_const
+
add_cv
+
add_pointer
+
add_reference
+
add_volatile
+
aligned_storage
+
alignment_of
+
decay
+
extent
+
+ floating_point_promotion
+
function_traits
+
has_nothrow_assign
+
+ has_nothrow_constructor
+
has_nothrow_copy
+
has_nothrow_copy_constructor
+
has_nothrow_default_constructor
+
has_trivial_assign
+
+ has_trivial_constructor
+
has_trivial_copy
+
has_trivial_copy_constructor
+
has_trivial_default_constructor
+
has_trivial_destructor
+
has_virtual_destructor
+
integral_constant
+
integral_promotion
+
is_abstract
+
is_arithmetic
+
is_array
+
is_base_of
+
is_class
+
is_complex
+
is_compound
+
is_const
+
is_convertible
+
is_empty
+
is_enum
+
is_floating_point
+
is_function
+
is_fundamental
+
is_integral
+
+ is_member_function_pointer
+
+ is_member_object_pointer
+
is_member_pointer
+
is_object
+
is_pod
+
is_pointer
+
is_polymorphic
+
is_same
+
is_scalar
+
is_signed
+
is_stateless
+
is_reference
+
is_union
+
is_unsigned
+
is_void
+
is_volatile
+
make_signed
+
make_unsigned
+
promote
+
rank
+
remove_all_extents
+
remove_const
+
remove_cv
+
remove_extent
+
remove_pointer
+
remove_reference
+
remove_volatile
+
type_with_alignment
+
+
Credits
+
+
+
+ + + +

Last revised: , at

+
+
Next
+ + diff --git a/doc/integral_constant.qbk b/doc/integral_constant.qbk new file mode 100644 index 0000000..60bd815 --- /dev/null +++ b/doc/integral_constant.qbk @@ -0,0 +1,18 @@ +[section:integral_constant integral_constant] + template + struct integral_constant + { + typedef integral_constant type; + typedef T value_type; + static const T value = val; + }; + + typedef integral_constant true_type; + typedef integral_constant false_type; + +Class template `integral_constant` is the common base class for all the value-based +type traits. The two typedef's `true_type` and `false_type` are provided for +convenience: most of the value traits are Boolean properties and so will inherit from +one of these. + +[endsect] diff --git a/doc/integral_promotion.qbk b/doc/integral_promotion.qbk new file mode 100644 index 0000000..46a2c37 --- /dev/null +++ b/doc/integral_promotion.qbk @@ -0,0 +1,29 @@ +[section:integral_promotion integral_promotion] + + template + struct integral_promotion + { + typedef __below type; + }; + +__type If integral promotion can be applied to an rvalue of type `T`, then +applies integral promotion to `T` and keeps cv-qualifiers of `T`, +otherwise leaves `T` unchanged. + +__std_ref 4.5 except 4.5/3 (integral bit-field). + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`integral_promotion::type`][`int const`]] + +[[`integral_promotion::type`][`short&`]] + +[[`integral_promotion::type`][`int`]] + +] + +[endsect] diff --git a/doc/intrinsics.qbk b/doc/intrinsics.qbk new file mode 100644 index 0000000..6cc5d8c --- /dev/null +++ b/doc/intrinsics.qbk @@ -0,0 +1,54 @@ +[section:intrinsics Support for Compiler Intrinsics] + +There are some traits that can not be implemented within the current C++ language: +to make these traits "just work" with user defined types, some kind of additional +help from the compiler is required. Currently (May 2005) MWCW 9 and Visual C++ 8 +provide the necessary intrinsics, and other compilers will no doubt follow in due +course. + +The Following traits classes always need compiler support to do the right thing +for all types +(but all have safe fallback positions if this support is unavailable): + +* __is_union +* __is_pod +* __has_trivial_constructor +* __has_trivial_copy +* __has_trivial_assign +* __has_trivial_destructor +* __has_nothrow_constructor +* __has_nothrow_copy +* __has_nothrow_assign +* __has_virtual_destructor + +The following traits classes can't be portably implemented in the C++ language, +although in practice, the implementations do in fact do the right thing on all +the compilers we know about: + +* __is_empty +* __is_polymorphic + +The following traits classes are dependent on one or more of the above: + +* __is_class +* __is_stateless + +The hooks for compiler-intrinsic support are defined in +[@../../boost/type_traits/intrinsics.hpp boost/type_traits/intrinsics.hpp], adding support for new compilers is simply +a matter of defining one of more of the following macros: + +[table Macros for Compiler Intrinsics + [[BOOST_IS_UNION(T)][Should evaluate to true if T is a union type]] + [[BOOST_IS_POD(T)][Should evaluate to true if T is a POD type]] + [[BOOST_IS_EMPTY(T)][Should evaluate to true if T is an empty struct or union]] + [[BOOST_HAS_TRIVIAL_CONSTRUCTOR(T)][Should evaluate to true if the default constructor for T is trivial (i.e. has no effect)]] + [[BOOST_HAS_TRIVIAL_COPY(T)][Should evaluate to true if T has a trivial copy constructor (and can therefore be replaced by a call to memcpy)]] + [[BOOST_HAS_TRIVIAL_ASSIGN(T)][Should evaluate to true if T has a trivial assignment operator (and can therefore be replaced by a call to memcpy)]] + [[BOOST_HAS_TRIVIAL_DESTRUCTOR(T)][Should evaluate to true if T has a trivial destructor (i.e. ~T() has no effect)]] + [[BOOST_HAS_NOTHROW_CONSTRUCTOR(T)][Should evaluate to true if `T x;` can not throw]] + [[BOOST_HAS_NOTHROW_COPY(T)][Should evaluate to true if `T(t)` can not throw]] + [[BOOST_HAS_NOTHROW_ASSIGN(T)][Should evaluate to true if `T t, u; t = u` can not throw]] + [[BOOST_HAS_VIRTUAL_DESTRUCTOR(T)][Should evaluate to true T has a virtual destructor]] +] + +[endsect] diff --git a/doc/is_abstract.qbk b/doc/is_abstract.qbk new file mode 100644 index 0000000..80d4fe8 --- /dev/null +++ b/doc/is_abstract.qbk @@ -0,0 +1,33 @@ +[section:is_abstract is_abstract] + template + struct is_abstract : public __tof {}; + +__inherit If T is a (possibly cv-qualified) abstract type then inherits from +__true_type, otherwise inherits from __false_type. + +__std_ref 10.3. + +__header ` #include ` or ` #include ` + +__compat The compiler must support DR337 (as of April 2005: GCC 3.4, VC++ 7.1 (and later), + Intel C++ 7 (and later), and Comeau 4.3.2). +Otherwise behaves the same as __is_polymorphic; +this is the "safe fallback position" for which polymorphic types are always +regarded as potentially abstract. The macro BOOST_NO_IS_ABSTRACT is used to +signify that the implementation is buggy, users should check for this in their +own code if the "safe fallback" is not suitable for their particular use-case. + +__examples + +[:Given: `class abc{ virtual ~abc() = 0; };` ] + +[:`is_abstract` inherits from `__true_type`.] + +[:`is_abstract::type` is the type `__true_type`.] + +[:`is_abstract::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_abstract::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_arithmetic.qbk b/doc/is_arithmetic.qbk new file mode 100644 index 0000000..68caa53 --- /dev/null +++ b/doc/is_arithmetic.qbk @@ -0,0 +1,24 @@ +[section:is_arithmetic is_arithmetic] + template + struct is_arithmetic : public __tof {}; + +__inherit If T is a (possibly cv-qualified) arithmetic type then inherits from +__true_type, otherwise inherits from __false_type. Arithmetic types include +integral and floating point types (see also __is_integral and __is_floating_point). + +__std_ref 3.9.1p8. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_arithmetic` inherits from `__true_type`.] + +[:`is_arithmetic::type` is the type `__true_type`.] + +[:`is_arithmetic::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_arithmetic::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_array.qbk b/doc/is_array.qbk new file mode 100644 index 0000000..7b0e87d --- /dev/null +++ b/doc/is_array.qbk @@ -0,0 +1,27 @@ +[section:is_array is_array] + template + struct is_array : public __tof {}; + +__inherit If T is a (possibly cv-qualified) array type then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.2 and 8.3.4. + +__header ` #include ` or ` #include ` + +__compat If the compiler does not support +partial-specialization of class templates, then this template +can give the wrong result with function types. + +__examples + +[:`is_array` inherits from `__true_type`.] + +[:`is_array::type` is the type `__true_type`.] + +[:`is_array::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_array::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_base_of.qbk b/doc/is_base_of.qbk new file mode 100644 index 0000000..afe1a3c --- /dev/null +++ b/doc/is_base_of.qbk @@ -0,0 +1,46 @@ +[section:is_base_of is_base_of] + template + struct is_base_of : public __tof {}; + +__inherit If Base is base class of type Derived or if both types are the same +then inherits from __true_type, +otherwise inherits from __false_type. + +This template will detect non-public base classes, and ambiguous base classes. + +Note that `is_base_of` will always inherit from __true_type. [*This is the +case even if `X` is not a class type]. This is a change in behaviour +from Boost-1.33 in order to track the Technical Report on C++ Library Extensions. + +Types `Base` and `Derived` must not be incomplete types. + +__std_ref 10. + +__header ` #include ` or ` #include ` + +__compat If the compiler does not support partial-specialization of class templates, +then this template can not be used with function types. There are some older compilers +which will produce compiler errors if `Base` is a private base class of `Derived`, or if +`Base` is an ambiguous base of `Derived`. These compilers include Borland C++, older +versions of Sun Forte C++, Digital Mars C++, and older versions of EDG based compilers. + +__examples + +[:Given: ` class Base{}; class Derived : public Base{};` ] + +[:`is_base_of` inherits from `__true_type`.] + +[:`is_base_of::type` is the type `__true_type`.] + +[:`is_base_of::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_base_of::value` is an integral constant +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`.] + +[endsect] diff --git a/doc/is_class.qbk b/doc/is_class.qbk new file mode 100644 index 0000000..9ef3b52 --- /dev/null +++ b/doc/is_class.qbk @@ -0,0 +1,37 @@ +[section:is_class is_class] + template + struct is_class : public __tof {}; + +__inherit If T is a (possibly cv-qualified) class type then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.2 and 9.2. + +__header ` #include ` or ` #include ` + +__compat Without (some as 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. + +__examples + +[:Given: `class MyClass;` then:] + +[:`is_class` inherits from `__true_type`.] + +[:`is_class::type` is the type `__true_type`.] + +[:`is_class::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_class::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_class::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_class::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_complex.qbk b/doc/is_complex.qbk new file mode 100644 index 0000000..dae2d8a --- /dev/null +++ b/doc/is_complex.qbk @@ -0,0 +1,13 @@ +[section:is_complex is_complex] + + template + struct is_complex : public __tof {}; + +__inherit If `T` is a complex number type then true (of type `std::complex` for +some type `U`), otherwise false. + +__std_ref 26.2. + +__header ` #include ` or ` #include ` + +[endsect] diff --git a/doc/is_compound.qbk b/doc/is_compound.qbk new file mode 100644 index 0000000..385ac08 --- /dev/null +++ b/doc/is_compound.qbk @@ -0,0 +1,30 @@ +[section:is_compound is_compound] + template + struct is_compound : public __tof {}; + +__inherit If T is a (possibly cv-qualified) compound type then inherits from __true_type, +otherwise inherits from __false_type. Any type that is not a fundamental type is +a compound type (see also __is_fundamental). + +__std_ref 3.9.2. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_compound` inherits from `__true_type`.] + +[:`is_compound::type` is the type `__true_type`.] + +[:`is_compound::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_compound::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_compound::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_compound::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_const.qbk b/doc/is_const.qbk new file mode 100644 index 0000000..934aff1 --- /dev/null +++ b/doc/is_const.qbk @@ -0,0 +1,35 @@ +[section:is_const is_const] + + template + struct is_const : public __tof {}; + +__inherit If T is a (top level) const-qualified type then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.3. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_const` inherits from `__true_type`.] + +[:`is_const::type` is the type `__true_type`.] + +[:`is_const::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_const::value` is an integral constant +expression that evaluates to /false/: the const-qualifier is not +at the top level in this case.] + +[:`is_const::value` is an integral constant +expression that evaluates to /false/: the const-qualifier is not +at the top level in this case.] + +[:`is_const::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_const::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_convertible.qbk b/doc/is_convertible.qbk new file mode 100644 index 0000000..a0cfe4c --- /dev/null +++ b/doc/is_convertible.qbk @@ -0,0 +1,58 @@ +[section:is_convertible is_convertible] + template + struct is_convertible : public __tof {}; + +__inherit If an imaginary lvalue of type `From` is convertible to type `To` then +inherits from __true_type, otherwise inherits from __false_type. + +Type From must not be an incomplete type. + +Type To must not be an incomplete, or function type. + +No types are considered to be convertible to array types or abstract-class types. + +This template can not detect whether a converting-constructor is `public` or not: if +type `To` has a `private` converting constructor from type `From` then instantiating +`is_convertible` will produce a compiler error. For this reason `is_convertible` +can not be used to determine whether a type has a `public` copy-constructor or not. + +This template will also produce compiler errors if the conversion is ambiguous, +for example: + + struct A {}; + struct B : A {}; + struct C : A {}; + struct D : B, C {}; + // This produces a compiler error, the conversion is ambiguous: + bool const y = boost::is_convertible::value; + +__std_ref 4 and 8.5. + +__compat This template is currently broken with Borland C++ Builder 5 (and earlier), +for constructor-based conversions, and for the Metrowerks 7 (and earlier) +compiler in all cases. If the compiler does not support `__is_abstract`, then the +template parameter `To` must not be an abstract type. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_convertible` inherits from `__true_type`.] + +[:`is_convertible::type` is the type `__true_type`.] + +[:`is_convertible::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_convertible::value` is an integral constant +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 +expression that evaluates to /false/.] + +[:`is_convertible::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_empty.qbk b/doc/is_empty.qbk new file mode 100644 index 0000000..adb9b69 --- /dev/null +++ b/doc/is_empty.qbk @@ -0,0 +1,37 @@ +[section:is_empty is_empty] + template + struct is_empty : public __tof {}; + +__inherit If T is an empty class type then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 10p5. + +__header ` #include ` or ` #include ` + +__compat In order to correctly detect empty classes this trait relies on either: + +* the compiler implementing zero sized empty base classes, or +* the compiler providing __intrinsics to detect empty classes. + +Can not be used with incomplete types. + +Can not be used with union types, until is_union can be made to work. + +If the compiler does not support partial-specialization of class templates, +then this template can not be used with abstract types. + +__examples + +[:Given: `struct empty_class {};` ] + +[:`is_empty` inherits from `__true_type`.] + +[:`is_empty::type` is the type `__true_type`.] + +[:`is_empty::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_empty::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_enum.qbk b/doc/is_enum.qbk new file mode 100644 index 0000000..77c54e9 --- /dev/null +++ b/doc/is_enum.qbk @@ -0,0 +1,36 @@ +[section:is_enum is_enum] + template + struct is_enum : public __tof {}; + +__inherit If T is a (possibly cv-qualified) enum type then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.2 and 7.2. + +__header ` #include ` or ` #include ` + +__compat Requires a correctly functioning __is_convertible template; + this means that is_enum is currently broken under Borland C++ Builder 5, + and for the Metrowerks compiler prior to version 8, other compilers + should handle this template just fine. + +__examples + +[:Given: `enum my_enum { one, two };` ] + +[:`is_enum` inherits from `__true_type`.] + +[:`is_enum::type` is the type `__true_type`.] + +[:`is_enum::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_enum::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_enum::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_enum::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_floating_point.qbk b/doc/is_floating_point.qbk new file mode 100644 index 0000000..36fe350 --- /dev/null +++ b/doc/is_floating_point.qbk @@ -0,0 +1,23 @@ +[section:is_floating_point is_floating_point] + template + struct is_floating_point : public __tof {}; + +__inherit If T is a (possibly cv-qualified) floating point type then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.1p8. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_floating_point` inherits from `__true_type`.] + +[:`is_floating_point::type` is the type `__true_type`.] + +[:`is_floating_point::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_floating_point::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_function.qbk b/doc/is_function.qbk new file mode 100644 index 0000000..caa6425 --- /dev/null +++ b/doc/is_function.qbk @@ -0,0 +1,66 @@ +[section:is_function is_function] + + template + struct is_function : public __tof {}; + +__inherit If T is a (possibly cv-qualified) function type then inherits from __true_type, +otherwise inherits from __false_type. Note that this template does not detect /pointers +to functions/, or /references to functions/, these are detected by __is_pointer and +__is_reference respectively: + + typedef int f1(); // f1 is of function type. + typedef int (f2*)(); // f2 is a pointer to a function. + typedef int (f3&)(); // f3 is a reference to a function. + +__std_ref 3.9.2p1 and 8.3.5. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_function` inherits from `__true_type`.] + +[:`is_function::type` is the type `__true_type`.] + +[:`is_function::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_function::value` is an integral constant +expression that evaluates to /false/: the argument in this case is a pointer type, +not a function type.] + +[:`is_function::value` is an integral constant +expression that evaluates to /false/: the argument in this case is a +reference to a function, not a function type.] + +[:`is_function::value` is an integral constant +expression that evaluates to /false/: the argument in this case is a pointer +to a member function.] + +[:`is_function::value_type` is the type `bool`.] + +[tip Don't confuse function-types with pointers to functions: + +`typedef int f(double);` + +defines a function type, + +`f foo;` + +declares a prototype for a function of type `f`, + +`f* pf = foo;` + +`f& fr = foo;` + +declares a pointer and a reference to the function `foo`. + +If you want to detect whether some type is a pointer-to-function then use: + +`__is_function<__remove_pointer::type>::value && __is_pointer::value` + +or for pointers to member functions you can just use +__is_member_function_pointer directly. +] + +[endsect] diff --git a/doc/is_fundamental.qbk b/doc/is_fundamental.qbk new file mode 100644 index 0000000..724e130 --- /dev/null +++ b/doc/is_fundamental.qbk @@ -0,0 +1,24 @@ +[section:is_fundamental is_fundamental] + template + struct is_fundamental : public __tof {}; + +__inherit If T is a (possibly cv-qualified) fundamental type then inherits from __true_type, +otherwise inherits from __false_type. Fundamental types include integral, floating +point and void types (see also __is_integral, __is_floating_point and __is_void) + +__std_ref 3.9.1. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_fundamental` inherits from `__true_type`.] + +[:`is_fundamental::type` is the type `__true_type`.] + +[:`is_fundamental::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_fundamental::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_integral.qbk b/doc/is_integral.qbk new file mode 100644 index 0000000..439dd6b --- /dev/null +++ b/doc/is_integral.qbk @@ -0,0 +1,23 @@ +[section:is_integral is_integral] + template + struct is_integral : public __tof {}; + +__inherit If T is a (possibly cv-qualified) integral type then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.1p7. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_integral` inherits from `__true_type`.] + +[:`is_integral::type` is the type `__true_type`.] + +[:`is_integral::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_integral::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_member_function_pointer.qbk b/doc/is_member_function_pointer.qbk new file mode 100644 index 0000000..c992f8e --- /dev/null +++ b/doc/is_member_function_pointer.qbk @@ -0,0 +1,29 @@ +[section:is_member_function_pointer is_member_function_pointer] + template + struct is_member_function_pointer : public __tof {}; + +__inherit If T is a (possibly cv-qualified) pointer to a member function +then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.2 and 8.3.3. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_member_function_pointer` inherits from `__true_type`.] + +[:`is_member_function_pointer::type` is the type `__true_type`.] + +[:`is_member_function_pointer::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_member_function_pointer::value` is an integral constant +expression that evaluates to /false/: the argument in this case is a pointer to +a data member and not a member function, see __is_member_object_pointer +and __is_member_pointer] + +[:`is_member_function_pointer::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_member_object_pointer.qbk b/doc/is_member_object_pointer.qbk new file mode 100644 index 0000000..f2471ad --- /dev/null +++ b/doc/is_member_object_pointer.qbk @@ -0,0 +1,29 @@ +[section:is_member_object_pointer is_member_object_pointer] + template + struct is_member_object_pointer : public __tof {}; + +__inherit If T is a (possibly cv-qualified) pointer to a member object (a data member) +then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.2 and 8.3.3. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_member_object_pointer` inherits from `__true_type`.] + +[:`is_member_object_pointer::type` is the type `__true_type`.] + +[:`is_member_object_pointer::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_member_object_pointer::value` is an integral constant +expression that evaluates to /false/: the argument in this case is a pointer to +a member function and not a member object, see __is_member_function_pointer +and __is_member_pointer] + +[:`is_member_object_pointer::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_member_pointer.qbk b/doc/is_member_pointer.qbk new file mode 100644 index 0000000..62cdf59 --- /dev/null +++ b/doc/is_member_pointer.qbk @@ -0,0 +1,25 @@ +[section:is_member_pointer is_member_pointer] + template + struct is_member_pointer : public __tof {}; + +__inherit If T is a (possibly cv-qualified) pointer to a member (either a function +or a data member) +then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.2 and 8.3.3. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_member_pointer` inherits from `__true_type`.] + +[:`is_member_pointer::type` is the type `__true_type`.] + +[:`is_member_pointer::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_member_pointer::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_object.qbk b/doc/is_object.qbk new file mode 100644 index 0000000..5f1049a --- /dev/null +++ b/doc/is_object.qbk @@ -0,0 +1,37 @@ +[section:is_object is_object] + template + struct is_object : public __tof {}; + +__inherit If T is a (possibly cv-qualified) object type +then inherits from __true_type, +otherwise inherits from __false_type. All types are object types except +references, void, and function types. + +__std_ref 3.9p9. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_object` inherits from `__true_type`.] + +[:`is_object::type` is the type `__true_type`.] + +[:`is_object::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_object::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_object::value` is an integral constant +expression that evaluates to /false/: reference types are not objects] + +[:`is_object::value` is an integral constant +expression that evaluates to /false/: function types are not objects] + +[:`is_object::value` is an integral constant +expression that evaluates to /false/: void is not an object type] + +[:`is_object::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_pod.qbk b/doc/is_pod.qbk new file mode 100644 index 0000000..9105cb2 --- /dev/null +++ b/doc/is_pod.qbk @@ -0,0 +1,43 @@ +[section:is_pod is_pod] + template + struct is_pod : public __tof {}; + +__inherit If T is a (possibly cv-qualified) POD type then inherits from __true_type, +otherwise inherits from __false_type. + +POD stands for "Plain old data". +Arithmetic types, and enumeration types, +a pointers and pointer to members are all PODs. Classes and unions can also +be POD's if they have no non-static data members that are of reference or +non-POD type, no user defined constructors, no user defined assignment +operators, no private or protected non-static data members, +no virtual functions and no base classes. Finally, a cv-qualified POD is +still a POD, as is an array of PODs. + +__std_ref 3.9p10 and 9p4 (Note that POD's are also aggregates, see 8.5.1). + +__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, is_pod 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. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_pod` inherits from `__true_type`.] + +[:`is_pod::type` is the type `__true_type`.] + +[:`is_pod::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_pod::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_pod::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_pointer.qbk b/doc/is_pointer.qbk new file mode 100644 index 0000000..3587a5b --- /dev/null +++ b/doc/is_pointer.qbk @@ -0,0 +1,37 @@ +[section:is_pointer is_pointer] + template + struct is_pointer : public __tof {}; + +__inherit If T is a (possibly cv-qualified) pointer type (includes function pointers, +but excludes pointers to members) then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.2p2 and 8.3.1. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_pointer` inherits from `__true_type`.] + +[:`is_pointer::type` is the type `__true_type`.] + +[:`is_pointer::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_pointer::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_pointer::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_pointer::value_type` is the type `bool`.] + +[important `is_pointer` detects "real" pointer types only, and /not/ smart pointers. +Users should not specialise `is_pointer` for smart pointer types, as doing so may cause +Boost (and other third party) code to fail to function correctly. +Users wanting a trait to detect smart pointers should create their own. +However, note that there is no way in general to auto-magically detect smart pointer types, +so such a trait would have to be partially specialised for each supported smart pointer type.] + +[endsect] diff --git a/doc/is_polymorphic.qbk b/doc/is_polymorphic.qbk new file mode 100644 index 0000000..d2994ac --- /dev/null +++ b/doc/is_polymorphic.qbk @@ -0,0 +1,29 @@ +[section:is_polymorphic is_polymorphic] + template + struct is_polymorphic : public __tof {}; + +__inherit If T is a (possibly cv-qualified) polymorphic type +then inherits from __true_type, +otherwise inherits from __false_type. Type `T` must be a complete type. + +__std_ref 10.3. + +__compat The implementation requires some knowledge of the compilers ABI, +it does actually seem to work with the majority of compilers though. + +__header ` #include ` or ` #include ` + +__examples + +[: Given: `class poly{ virtual ~poly(); };` ] + +[:`is_polymorphic` inherits from `__true_type`.] + +[:`is_polymorphic::type` is the type `__true_type`.] + +[:`is_polymorphic::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_polymorphic::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_reference.qbk b/doc/is_reference.qbk new file mode 100644 index 0000000..5767a77 --- /dev/null +++ b/doc/is_reference.qbk @@ -0,0 +1,29 @@ +[section:is_reference is_reference] + template + struct is_reference : public __tof {}; + +__inherit If T is a reference pointer type then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.2 and 8.3.2. + +__compat If the compiler does not +support partial-specialization of class templates, +then this template may report the wrong result for function types, +and for types that are both const and volatile qualified. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_reference` inherits from `__true_type`.] + +[:`is_reference::type` is the type `__true_type`.] + +[:`is_reference::value` is an integral constant +expression that evaluates to /true/ (the argument in this case is +a reference to a function).] + +[:`is_reference::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_same.qbk b/doc/is_same.qbk new file mode 100644 index 0000000..39273d4 --- /dev/null +++ b/doc/is_same.qbk @@ -0,0 +1,30 @@ +[section:is_same is_same] + template + struct is_same : public __tof {}; + +__inherit If T and U are the same types then inherits from +__true_type, otherwise inherits from __false_type. + +__header ` #include ` or ` #include ` + +__compat If the compiler does not support partial-specialization of class templates, +then this template can not be used with abstract, incomplete or function types. + +__examples + +[:`is_same` inherits from `__true_type`.] + +[:`is_same::type` is the type `__true_type`.] + +[:`is_same::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_same::value` is an integral constant +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`.] + +[endsect] diff --git a/doc/is_scalar.qbk b/doc/is_scalar.qbk new file mode 100644 index 0000000..7e7b4a5 --- /dev/null +++ b/doc/is_scalar.qbk @@ -0,0 +1,36 @@ +[section:is_scalar is_scalar] + template + struct is_scalar : public __tof {}; + +__inherit If T is a (possibly cv-qualified) scalar type then inherits from +__true_type, otherwise inherits from __false_type. Scalar types include +integral, floating point, enumeration, pointer, and pointer-to-member types. + +__std_ref 3.9p10. + +__header ` #include ` or ` #include ` + +__compat If the compiler does not support partial-specialization of class templates, +then this template can not be used with function types. + +__examples + +[:`is_scalar` inherits from `__true_type`.] + +[:`is_scalar::type` is the type `__true_type`.] + +[:`is_scalar::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_scalar::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_scalar::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_scalar::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_scalar::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_signed.qbk b/doc/is_signed.qbk new file mode 100644 index 0000000..1b0ad56 --- /dev/null +++ b/doc/is_signed.qbk @@ -0,0 +1,34 @@ +[section:is_signed is_signed] + + template + struct is_signed : public __tof {}; + +__inherit If T is an signed integer type or an enumerated type with an +underlying signed integer type, then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.1, 7.2. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_signed` inherits from `__true_type`.] + +[:`is_signed::type` is the type `__true_type`.] + +[:`is_signed::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_signed::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_signed::value` is an integral constant +expression whose value depends upon the signedness of type `char`.] + +[:`is_signed::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_signed::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_stateless.qbk b/doc/is_stateless.qbk new file mode 100644 index 0000000..f63856e --- /dev/null +++ b/doc/is_stateless.qbk @@ -0,0 +1,32 @@ +[section:is_stateless is_stateless] + template + struct is_stateless : public __tof {}; + +__inherit Ff T is a stateless type then inherits from __true_type, otherwise +from __false_type. + +Type T must be a complete type. + +A stateless type is a type that has no storage and whose constructors and +destructors are trivial. That means that `is_stateless` only inherits from +__true_type if the following expression is `true`: + + ::boost::has_trivial_constructor::value + && ::boost::has_trivial_copy::value + && ::boost::has_trivial_destructor::value + && ::boost::is_class::value + && ::boost::is_empty::value + +__std_ref 3.9p10. + +__header ` #include ` or ` #include ` + +__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, 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. + +[endsect] diff --git a/doc/is_union.qbk b/doc/is_union.qbk new file mode 100644 index 0000000..8da752f --- /dev/null +++ b/doc/is_union.qbk @@ -0,0 +1,35 @@ +[section:is_union is_union] + template + struct is_union : public __tof {}; + +__inherit If T is a (possibly cv-qualified) union type then inherits from __true_type, +otherwise inherits from __false_type. Currently requires some kind of compiler +support, otherwise unions are identified as classes. + +__std_ref 3.9.2 and 9.5. + +__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. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_union` inherits from `__true_type`.] + +[:`is_union::type` is the type `__true_type`.] + +[:`is_union::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_union::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_union::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_unsigned.qbk b/doc/is_unsigned.qbk new file mode 100644 index 0000000..84a5f62 --- /dev/null +++ b/doc/is_unsigned.qbk @@ -0,0 +1,34 @@ +[section:is_unsigned is_unsigned] + + template + struct is_unsigned : public __tof {}; + +__inherit If T is an unsigned integer type or an enumerated type with an +underlying unsigned integer type, then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.1, 7.2. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_unsigned` inherits from `__true_type`.] + +[:`is_unsigned::type` is the type `__true_type`.] + +[:`is_unsigned::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_unsigned::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_unsigned::value` is an integral constant +expression whose value depends upon the signedness of type `char`.] + +[:`is_unsigned::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_unsigned::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_void.qbk b/doc/is_void.qbk new file mode 100644 index 0000000..c5e62ce --- /dev/null +++ b/doc/is_void.qbk @@ -0,0 +1,26 @@ +[section:is_void is_void] + template + struct is_void : public __tof {}; + +__inherit If T is a (possibly cv-qualified) void type then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.1p9. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_void` inherits from `__true_type`.] + +[:`is_void::type` is the type `__true_type`.] + +[:`is_void::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_void::value` is an integral constant +expression that evaluates to /false/.] + +[:`is_void::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/is_volatile.qbk b/doc/is_volatile.qbk new file mode 100644 index 0000000..95a3f66 --- /dev/null +++ b/doc/is_volatile.qbk @@ -0,0 +1,27 @@ +[section:is_volatile is_volatile] + template + struct is_volatile : public __tof {}; + +__inherit If T is a (top level) volatile-qualified type then inherits from __true_type, +otherwise inherits from __false_type. + +__std_ref 3.9.3. + +__header ` #include ` or ` #include ` + +__examples + +[:`is_volatile` inherits from `__true_type`.] + +[:`is_volatile::type` is the type `__true_type`.] + +[:`is_volatile::value` is an integral constant +expression that evaluates to /true/.] + +[:`is_volatile::value` is an integral constant +expression that evaluates to /false/: the volatile qualifier is not +at the top level in this case.] + +[:`is_volatile::value_type` is the type `bool`.] + +[endsect] diff --git a/doc/make_signed.qbk b/doc/make_signed.qbk new file mode 100644 index 0000000..08ae175 --- /dev/null +++ b/doc/make_signed.qbk @@ -0,0 +1,39 @@ +[section:make_signed make_signed] + + template + struct make_signed + { + typedef __below type; + }; + +__type If T is a signed integer type then the same type as T, if T is an +unsigned integer type then the corresponding signed type. +Otherwise if T is an enumerated or +character type (char or wchar_t) then a signed integer type with the same +width as T. + +If T has any cv-qualifiers then these are also present on the result type. + +[*Requires:] T must be an integer or enumerated type, and must not be the type +bool. + +__std_ref 3.9.1. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`make_signed::type`][`int`]] + +[[`make_signed::type`] [`int const`]] + +[[`make_signed::type`] [`const long long`]] + +[[`make_signed::type`] [A signed integer type with the same width as the enum.]] +[[`make_signed::type`] [A signed integer type with the same width as wchar_t.]] + +] + +[endsect] diff --git a/doc/make_unsigned.qbk b/doc/make_unsigned.qbk new file mode 100644 index 0000000..f62fd92 --- /dev/null +++ b/doc/make_unsigned.qbk @@ -0,0 +1,39 @@ +[section:make_unsigned make_unsigned] + + template + struct make_unsigned + { + typedef __below type; + }; + +__type If T is a unsigned integer type then the same type as T, if T is an +signed integer type then the corresponding unsigned type. +Otherwise if T is an enumerated or +character type (char or wchar_t) then an unsigned integer type with the same +width as T. + +If T has any cv-qualifiers then these are also present on the result type. + +[*Requires:] T must be an integer or enumerated type, and must not be the type +bool. + +__std_ref 3.9.1. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`make_signed::type`][`unsigned int`]] + +[[`make_signed::type`] [`unsigned int const`]] + +[[`make_signed::type`] [`const unsigned long long`]] + +[[`make_signed::type`] [An unsigned integer type with the same width as the enum.]] +[[`make_signed::type`] [An unsigned integer type with the same width as wchar_t.]] + +] + +[endsect] diff --git a/doc/mpl.qbk b/doc/mpl.qbk new file mode 100644 index 0000000..c5da529 --- /dev/null +++ b/doc/mpl.qbk @@ -0,0 +1,12 @@ +[section:mpl MPL Interoperability] + +All the value based traits in this library conform to MPL's requirements +for an [@../../libs/mpl/doc/refmanual/integral-constant.html Integral Constant type]: that includes a number of rather intrusive +workarounds for broken compilers. + +Purely as an implementation detail, this +means that `__true_type` inherits from [@../../libs/mpl/doc/refmanual/bool.html `boost::mpl::true_`], `__false_type` inherits +from [@../../libs/mpl/doc/refmanual/bool.html `boost::mpl::false_`], and `__integral_constant` inherits from +[@../../libs/mpl/doc/refmanual/integral-c.html `boost::mpl::integral_c`] (provided `T` is not `bool`) + +[endsect] diff --git a/doc/promote.qbk b/doc/promote.qbk new file mode 100644 index 0000000..08cc45f --- /dev/null +++ b/doc/promote.qbk @@ -0,0 +1,30 @@ +[section:promote promote] + + template + struct promote + { + typedef __below type; + }; + +__type If integral or floating point promotion can be applied to an rvalue +of type `T`, then applies integral and floating point promotions to `T` and +keeps cv-qualifiers of `T`, otherwise leaves `T` unchanged. See also +__integral_promotion and __floating_point_promotion. + +__std_ref 4.5 except 4.5/3 (integral bit-field) and 4.6. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`promote::type`][`int volatile`]] + +[[`promote::type`][`double const`]] + +[[`promote::type`][`short&`]] + +] + +[endsect] diff --git a/doc/rank.qbk b/doc/rank.qbk new file mode 100644 index 0000000..bcbf248 --- /dev/null +++ b/doc/rank.qbk @@ -0,0 +1,29 @@ +[section:rank rank] + template + struct rank : public __integral_constant {}; + +__inherit Class template rank inherits from `__integral_constant`, +where `RANK(T)` is the number of array dimensions in type `T`. + +If `T` is not an array type, then `RANK(T)` is zero. + +__header ` #include ` or ` #include ` + +__examples + +[:`rank` inherits from `__integral_constant`.] + +[:`rank::type` is the type `__integral_constant`.] + +[:`rank::value` is an integral constant +expression that evaluates to /1/.] + +[:`rank::value` is an integral constant +expression that evaluates to /2/.] + +[:`rank::value` is an integral constant +expression that evaluates to /0/.] + +[:`rank::value_type` is the type `std::size_t`.] + +[endsect] diff --git a/doc/remove_all_extents.qbk b/doc/remove_all_extents.qbk new file mode 100644 index 0000000..e9b3dfb --- /dev/null +++ b/doc/remove_all_extents.qbk @@ -0,0 +1,36 @@ +[section:remove_all_extents remove_all_extents] + + template + struct remove_all_extents + { + typedef __below type; + }; + +__type If `T` is an array type, then removes all of the array bounds on `T`, otherwise +leaves `T` unchanged. + +__std_ref 8.3.4. + +__compat If the compiler does not support partial specialization of class-templates +then this template will compile, but the member `type` will always be the same as +type `T` except where __transform_workaround have been applied. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`remove_all_extents::type`][`int`]] + +[[`remove_all_extents::type`] [`int const`]] + +[[`remove_all_extents::type`] [`int`]] + +[[`remove_all_extents::type`] [`int`]] + +[[`remove_all_extents::type`] [`int const*`]] + +] + +[endsect] diff --git a/doc/remove_const.qbk b/doc/remove_const.qbk new file mode 100644 index 0000000..4a97499 --- /dev/null +++ b/doc/remove_const.qbk @@ -0,0 +1,35 @@ +[section:remove_const remove_const] + + template + struct remove_const + { + typedef __below type; + }; + +__type The same type as `T`, but with any /top level/ const-qualifier removed. + +__std_ref 3.9.3. + +__compat If the compiler does not support partial specialization of class-templates +then this template will compile, but the member `type` will always be the same as +type `T` except where __transform_workaround have been applied. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`remove_const::type`][`int`]] + +[[`remove_const::type`] [`int`]] + +[[`remove_const::type`] [`int volatile`]] + +[[`remove_const::type`] [`int const&`]] + +[[`remove_const::type`] [`int const*`]] + +] + +[endsect] diff --git a/doc/remove_cv.qbk b/doc/remove_cv.qbk new file mode 100644 index 0000000..f75f8ed --- /dev/null +++ b/doc/remove_cv.qbk @@ -0,0 +1,35 @@ +[section:remove_cv remove_cv] + + template + struct remove_cv + { + typedef __below type; + }; + +__type The same type as `T`, but with any /top level/ cv-qualifiers removed. + +__std_ref 3.9.3. + +__compat If the compiler does not support partial specialization of class-templates +then this template will compile, but the member `type` will always be the same as +type `T` except where __transform_workaround have been applied. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`remove_cv::type`][`int`]] + +[[`remove_cv::type`] [`int`]] + +[[`remove_cv::type`] [`int`]] + +[[`remove_cv::type`] [`int const&`]] + +[[`remove_cv::type`] [`int const*`]] + +] + +[endsect] diff --git a/doc/remove_extent.qbk b/doc/remove_extent.qbk new file mode 100644 index 0000000..f977392 --- /dev/null +++ b/doc/remove_extent.qbk @@ -0,0 +1,36 @@ +[section:remove_extent remove_extent] + + template + struct remove_extent + { + typedef __below type; + }; + +__type If `T` is an array type, then removes the topmost array bound, +otherwise leaves `T` unchanged. + +__std_ref 8.3.4. + +__compat If the compiler does not support partial specialization of class-templates +then this template will compile, but the member `type` will always be the same as +type `T` except where __transform_workaround have been applied. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`remove_extent::type`][`int`]] + +[[`remove_extent::type`] [`int const`]] + +[[`remove_extent::type`] [`int[4]`]] + +[[`remove_extent::type`] [`int[2]`]] + +[[`remove_extent::type`] [`int const*`]] + +] + +[endsect] diff --git a/doc/remove_pointer.qbk b/doc/remove_pointer.qbk new file mode 100644 index 0000000..a947fd0 --- /dev/null +++ b/doc/remove_pointer.qbk @@ -0,0 +1,35 @@ +[section:remove_pointer remove_pointer] + + template + struct remove_pointer + { + typedef __below type; + }; + +__type The same type as `T`, but with any pointer modifier removed. + +__std_ref 8.3.1. + +__compat If the compiler does not support partial specialization of class-templates +then this template will compile, but the member `type` will always be the same as +type `T` except where __transform_workaround have been applied. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`remove_pointer::type`][`int`]] + +[[`remove_pointer::type`] [`int const`]] + +[[`remove_pointer::type`] [`int const*`]] + +[[`remove_pointer::type`] [`int&`]] + +[[`remove_pointer::type`] [`int*&`]] + +] + +[endsect] diff --git a/doc/remove_reference.qbk b/doc/remove_reference.qbk new file mode 100644 index 0000000..a626b27 --- /dev/null +++ b/doc/remove_reference.qbk @@ -0,0 +1,33 @@ +[section:remove_reference remove_reference] + + template + struct remove_reference + { + typedef __below type; + }; + +__type The same type as `T`, but with any reference modifier removed. + +__std_ref 8.3.2. + +__compat If the compiler does not support partial specialization of class-templates +then this template will compile, but the member `type` will always be the same as +type `T` except where __transform_workaround have been applied. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`remove_reference::type`][`int`]] + +[[`remove_reference::type`] [`int const`]] + +[[`remove_reference::type`] [`int*`]] + +[[`remove_reference::type`] [`int*`]] + +] + +[endsect] diff --git a/doc/remove_volatile.qbk b/doc/remove_volatile.qbk new file mode 100644 index 0000000..77386d6 --- /dev/null +++ b/doc/remove_volatile.qbk @@ -0,0 +1,35 @@ +[section:remove_volatile remove_volatile] + + template + struct remove_volatile + { + typedef __below type; + }; + +__type The same type as `T`, but with any /top level/ volatile-qualifier removed. + +__std_ref 3.9.3. + +__compat If the compiler does not support partial specialization of class-templates +then this template will compile, but the member `type` will always be the same as +type `T` except where __transform_workaround have been applied. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`remove_volatile::type`][`int`]] + +[[`remove_volatile::type`] [`int`]] + +[[`remove_volatile::type`] [`int const`]] + +[[`remove_volatile::type`] [`int const&`]] + +[[`remove_volatile::type`] [`int const*`]] + +] + +[endsect] diff --git a/doc/transform_traits.qbk b/doc/transform_traits.qbk new file mode 100644 index 0000000..0b6f56e --- /dev/null +++ b/doc/transform_traits.qbk @@ -0,0 +1,110 @@ +[section:transform Type Traits that Transform One Type to Another] + +The following templates transform one type to another, +based upon some well-defined rule. +Each template has a single member called `type` that is the +result of applying the transformation to the template argument `T`. + +[*Synopsis:] + + template + struct __add_const; + + template + struct __add_cv; + + template + struct __add_pointer; + + template + struct __add_reference; + + template + struct __add_volatile; + + template + struct __decay; + + template + struct __floating_point_promotion; + + template + struct __integral_promotion; + + template + struct __make_signed; + + template + struct __make_unsigned; + + template + struct __promote; + + template + struct __remove_all_extents; + + template + struct __remove_const; + + template + struct __remove_cv; + + template + struct __remove_extent; + + template + struct __remove_pointer; + + template + struct __remove_reference; + + template + struct __remove_volatile; + +[h4 Broken Compiler Workarounds:] + +For all of these templates support for partial specialization of class templates is +required to correctly implement the transformation. +On the other hand, practice shows that many of the templates from this +category are very useful, and often essential for implementing some +generic libraries. Lack of these templates is often one of the major +limiting factors in porting those libraries to compilers that do not yet +support this language feature. As some of these compilers are going to be +around for a while, and at least one of them is very wide-spread, +it was decided that the library should provide workarounds where possible. + +The basic idea behind the workaround is to manually define full +specializations of all type transformation templates for all fundamental types, +and all their 1st and 2nd rank cv-[un]qualified derivative pointer types, and to +provide a user-level macro that will define all the explicit specializations needed +for any user-defined type T. + +The first part guarantees the successful compilation of something like this: + + BOOST_STATIC_ASSERT((is_same::type>::value)); + BOOST_STATIC_ASSERT((is_same::type>::value)); + BOOST_STATIC_ASSERT((is_same::type>::value)); + BOOST_STATIC_ASSERT((is_same::type>::value)); + BOOST_STATIC_ASSERT((is_same::type>::value)); + BOOST_STATIC_ASSERT((is_same::type>::value)); + ... + BOOST_STATIC_ASSERT((is_same::type>::value)); + +and the second part provides the library's users with a mechanism to make the +above code work not only for `char`, `int` or other built-in type, +but for their own types as well: + + namespace myspace{ + struct MyClass {}; + } + // declare this at global scope: + BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(myspace::MyClass) + // transformations on myspace::MyClass now work: + BOOST_STATIC_ASSERT((is_same::type>::value)); + BOOST_STATIC_ASSERT((is_same::type>::value)); + // etc. + +Note that the macro BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION evaluates +to nothing on those compilers that *do* support partial specialization. + +[endsect] diff --git a/doc/type_traits.qbk b/doc/type_traits.qbk index c7b7233..8d188d7 100644 --- a/doc/type_traits.qbk +++ b/doc/type_traits.qbk @@ -1,4 +1,5 @@ [library Boost.TypeTraits + [quickbook 1.4] [copyright 2000 2006 Adobe Systems Inc, David Abrahams, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, @@ -14,89 +15,101 @@ [authors [authors, various]] [category template] [category generic] - [last-revision $Date$] + [last-revision $LastChangedDate$] ] + [def __boost_root ../../../../] -[def __tof '''true_type-or-false_type'''] +[def __tof '''true_type-or-false_type'''] [def __below '''see-below'''] -[def __true_type [link boost_typetraits.integral_constant true_type]] -[def __false_type [link boost_typetraits.integral_constant false_type]] -[def __integral_constant [link boost_typetraits.integral_constant integral_constant]] +[def __true_type [link boost_typetraits.reference.integral_constant true_type]] +[def __false_type [link boost_typetraits.reference.integral_constant false_type]] +[def __integral_constant [link boost_typetraits.reference.integral_constant integral_constant]] [def __inherit [*Inherits:]] [def __std_ref [*C++ Standard Reference:]] [def __header [*Header:]] [def __compat [*Compiler Compatibility:]] [def __examples [*Examples:]] [def __type [*type:]] -[def __transform_workaround [link transform.broken_compiler_workarounds_ compiler workarounds]] +[def __transform_workaround [link boost_typetraits.category.transform.broken_compiler_workarounds_ compiler workarounds]] [def __intrinsics [link boost_typetraits.intrinsics intrinsics]] -[def __is_void [link boost_typetraits.is_void is_void]] -[def __is_integral [link boost_typetraits.is_integral is_integral]] -[def __is_floating_point [link boost_typetraits.is_floating_point is_floating_point]] -[def __is_pointer [link boost_typetraits.is_pointer is_pointer]] -[def __is_reference [link boost_typetraits.is_reference is_reference]] -[def __is_member_pointer [link boost_typetraits.is_member_pointer is_member_pointer]] -[def __is_array [link boost_typetraits.is_array is_array]] -[def __is_union [link boost_typetraits.is_union is_union]] -[def __is_class [link boost_typetraits.is_class is_class]] -[def __is_enum [link boost_typetraits.is_enum is_enum]] -[def __is_enum [link boost_typetraits.is_enum is_enum]] -[def __is_function [link boost_typetraits.is_function is_function]] +[def __is_void [link boost_typetraits.reference.is_void is_void]] +[def __is_integral [link boost_typetraits.reference.is_integral is_integral]] +[def __is_floating_point [link boost_typetraits.reference.is_floating_point is_floating_point]] +[def __is_pointer [link boost_typetraits.reference.is_pointer is_pointer]] +[def __is_reference [link boost_typetraits.reference.is_reference is_reference]] +[def __is_member_pointer [link boost_typetraits.reference.is_member_pointer is_member_pointer]] +[def __is_array [link boost_typetraits.reference.is_array is_array]] +[def __is_union [link boost_typetraits.reference.is_union is_union]] +[def __is_class [link boost_typetraits.reference.is_class is_class]] +[def __is_enum [link boost_typetraits.reference.is_enum is_enum]] +[def __is_enum [link boost_typetraits.reference.is_enum is_enum]] +[def __is_function [link boost_typetraits.reference.is_function is_function]] -[def __is_arithmetic [link boost_typetraits.is_arithmetic is_arithmetic]] -[def __is_fundamental [link boost_typetraits.is_fundamental is_fundamental]] -[def __is_object [link boost_typetraits.is_object is_object]] -[def __is_scalar [link boost_typetraits.is_scalar is_scalar]] -[def __is_compound [link boost_typetraits.is_compound is_compound]] -[def __is_member_function_pointer [link boost_typetraits.is_member_function_pointer is_member_function_pointer]] -[def __is_member_object_pointer [link boost_typetraits.is_member_object_pointer is_member_object_pointer]] +[def __is_arithmetic [link boost_typetraits.reference.is_arithmetic is_arithmetic]] +[def __is_fundamental [link boost_typetraits.reference.is_fundamental is_fundamental]] +[def __is_object [link boost_typetraits.reference.is_object is_object]] +[def __is_scalar [link boost_typetraits.reference.is_scalar is_scalar]] +[def __is_compound [link boost_typetraits.reference.is_compound is_compound]] +[def __is_member_function_pointer [link boost_typetraits.reference.is_member_function_pointer is_member_function_pointer]] +[def __is_member_object_pointer [link boost_typetraits.reference.is_member_object_pointer is_member_object_pointer]] -[def __alignment_of [link boost_typetraits.alignment_of alignment_of]] -[def __rank [link boost_typetraits.rank rank]] -[def __extent [link boost_typetraits.extent extent]] -[def __is_empty [link boost_typetraits.is_empty is_empty]] -[def __is_const [link boost_typetraits.is_const is_const]] -[def __is_volatile [link boost_typetraits.is_volatile is_volatile]] -[def __is_abstract [link boost_typetraits.is_abstract is_abstract]] -[def __is_polymorphic [link boost_typetraits.is_polymorphic is_polymorphic]] -[def __has_virtual_destructor [link boost_typetraits.has_virtual_destructor has_virtual_destructor]] -[def __is_pod [link boost_typetraits.is_pod is_pod]] -[def __has_trivial_constructor [link boost_typetraits.has_trivial_constructor has_trivial_constructor]] -[def __has_trivial_copy [link boost_typetraits.has_trivial_copy has_trivial_copy]] -[def __has_trivial_assign [link boost_typetraits.has_trivial_assign has_trivial_assign]] -[def __has_trivial_destructor [link boost_typetraits.has_trivial_destructor has_trivial_destructor]] -[def __is_stateless [link boost_typetraits.is_stateless is_stateless]] -[def __has_nothrow_constructor [link boost_typetraits.has_nothrow_constructor has_nothrow_constructor]] -[def __has_nothrow_copy [link boost_typetraits.has_nothrow_copy has_nothrow_copy]] -[def __has_nothrow_assign [link boost_typetraits.has_nothrow_assign has_nothrow_assign]] +[def __alignment_of [link boost_typetraits.reference.alignment_of alignment_of]] +[def __rank [link boost_typetraits.reference.rank rank]] +[def __extent [link boost_typetraits.reference.extent extent]] +[def __is_empty [link boost_typetraits.reference.is_empty is_empty]] +[def __is_const [link boost_typetraits.reference.is_const is_const]] +[def __is_volatile [link boost_typetraits.reference.is_volatile is_volatile]] +[def __is_abstract [link boost_typetraits.reference.is_abstract is_abstract]] +[def __is_polymorphic [link boost_typetraits.reference.is_polymorphic is_polymorphic]] +[def __is_signed [link boost_typetraits.reference.is_signed is_signed]] +[def __is_unsigned [link boost_typetraits.reference.is_unsigned is_unsigned]] +[def __has_virtual_destructor [link boost_typetraits.reference.has_virtual_destructor has_virtual_destructor]] +[def __is_pod [link boost_typetraits.reference.is_pod is_pod]] +[def __has_trivial_constructor [link boost_typetraits.reference.has_trivial_constructor has_trivial_constructor]] +[def __has_trivial_copy [link boost_typetraits.reference.has_trivial_copy has_trivial_copy]] +[def __has_trivial_default_constructor [link boost_typetraits.reference.has_trivial_constructor has_trivial_default_constructor]] +[def __has_trivial_copy_constructor [link boost_typetraits.reference.has_trivial_copy has_trivial_copy_constructor]] +[def __has_trivial_assign [link boost_typetraits.reference.has_trivial_assign has_trivial_assign]] +[def __has_trivial_destructor [link boost_typetraits.reference.has_trivial_destructor has_trivial_destructor]] +[def __is_stateless [link boost_typetraits.reference.is_stateless is_stateless]] +[def __has_nothrow_constructor [link boost_typetraits.reference.has_nothrow_constructor has_nothrow_constructor]] +[def __has_nothrow_copy [link boost_typetraits.reference.has_nothrow_copy has_nothrow_copy]] +[def __has_nothrow_default_constructor [link boost_typetraits.reference.has_nothrow_constructor has_nothrow_default_constructor]] +[def __has_nothrow_copy_constructor [link boost_typetraits.reference.has_nothrow_copy has_nothrow_copy_constructor]] +[def __has_nothrow_assign [link boost_typetraits.reference.has_nothrow_assign has_nothrow_assign]] -[def __is_base_of [link boost_typetraits.is_base_of is_base_of]] -[def __is_convertible [link boost_typetraits.is_convertible is_convertible]] -[def __is_same [link boost_typetraits.is_same is_same]] +[def __is_base_of [link boost_typetraits.reference.is_base_of is_base_of]] +[def __is_convertible [link boost_typetraits.reference.is_convertible is_convertible]] +[def __is_same [link boost_typetraits.reference.is_same is_same]] -[def __remove_const [link boost_typetraits.remove_const remove_const]] -[def __remove_volatile [link boost_typetraits.remove_volatile remove_volatile]] -[def __remove_cv [link boost_typetraits.remove_cv remove_cv]] -[def __remove_reference [link boost_typetraits.remove_reference remove_reference]] -[def __remove_extent [link boost_typetraits.remove_extent remove_extent]] -[def __remove_all_extents [link boost_typetraits.remove_all_extents remove_all_extents]] -[def __remove_pointer [link boost_typetraits.remove_pointer remove_pointer]] -[def __add_reference [link boost_typetraits.add_reference add_reference]] -[def __add_pointer [link boost_typetraits.add_pointer add_pointer]] -[def __add_const [link boost_typetraits.add_const add_const]] -[def __add_volatile [link boost_typetraits.add_volatile add_volatile]] -[def __add_cv [link boost_typetraits.add_cv add_cv]] +[def __remove_const [link boost_typetraits.reference.remove_const remove_const]] +[def __remove_volatile [link boost_typetraits.reference.remove_volatile remove_volatile]] +[def __remove_cv [link boost_typetraits.reference.remove_cv remove_cv]] +[def __remove_reference [link boost_typetraits.reference.remove_reference remove_reference]] +[def __remove_extent [link boost_typetraits.reference.remove_extent remove_extent]] +[def __remove_all_extents [link boost_typetraits.reference.remove_all_extents remove_all_extents]] +[def __remove_pointer [link boost_typetraits.reference.remove_pointer remove_pointer]] +[def __add_reference [link boost_typetraits.reference.add_reference add_reference]] +[def __add_pointer [link boost_typetraits.reference.add_pointer add_pointer]] +[def __add_const [link boost_typetraits.reference.add_const add_const]] +[def __add_volatile [link boost_typetraits.reference.add_volatile add_volatile]] +[def __add_cv [link boost_typetraits.reference.add_cv add_cv]] -[def __type_with_alignment [link boost_typetraits.type_with_alignment type_with_alignment]] -[def __aligned_storage [link boost_typetraits.aligned_storage aligned_storage]] +[def __type_with_alignment [link boost_typetraits.reference.type_with_alignment type_with_alignment]] +[def __aligned_storage [link boost_typetraits.reference.aligned_storage aligned_storage]] -[def __function_traits [link boost_typetraits.function_traits function_traits]] +[def __function_traits [link boost_typetraits.reference.function_traits function_traits]] -[def __promote [link boost_typetraits.promote promote]] -[def __integral_promotion [link boost_typetraits.integral_promotion integral_promotion]] -[def __floating_point_promotion [link boost_typetraits.floating_point_promotion floating_point_promotion]] +[def __promote [link boost_typetraits.reference.promote promote]] +[def __integral_promotion [link boost_typetraits.reference.integral_promotion integral_promotion]] +[def __floating_point_promotion [link boost_typetraits.reference.floating_point_promotion floating_point_promotion]] + +[def __make_signed [link boost_typetraits.reference.make_signed make_signed]] +[def __make_unsigned [link boost_typetraits.reference.make_unsigned make_unsigned]] +[def __decay [link boost_typetraits.reference.decay decay]] +[def __is_complex [link boost_typetraits.reference.is_complex is_complex]] [section:intro Introduction] @@ -117,2882 +130,110 @@ that is the result of the transformation. [endsect] -[section:background Background and Tutorial] - -The following is an updated version of the article "C++ Type traits" -by John Maddock and Steve Cleary that appeared in the October 2000 -issue of [@http://www.ddj.com Dr Dobb's Journal]. - -Generic programming (writing code which works with any data type meeting a -set of requirements) has become the method of choice for providing reusable code. -However, there are times in generic programming when "generic" just isn't -good enough - sometimes the differences between types are too large for an -efficient generic implementation. This is when the traits technique -becomes important - by encapsulating those properties that need to be -considered on a type by type basis inside a traits class, we can -minimize the amount of code that has to differ from one type to another, -and maximize the amount of generic code. - -Consider an example: when working with character strings, one common operation is -to determine the length of a null terminated string. Clearly it's possible to -write generic code that can do this, but it turns out that there are much more -efficient methods available: for example, the C library functions `strlen` and -`wcslen` are usually written in assembler, and with suitable hardware support -can be considerably faster than a generic version written in C++. -The authors of the C++ standard library realized this, and abstracted the -properties of `char` and `wchar_t` into the class `char_traits`. Generic code -that works with character strings can simply use `char_traits<>::length` to -determine the length of a null terminated string, safe in the knowledge -that specializations of `char_traits` will use the most appropriate method -available to them. - -[h4 Type Traits] - -Class `char_traits` is a classic example of a collection of type specific -properties wrapped up in a single class - what Nathan Myers termed a -/baggage class/[link background.references \[1\]]. In the Boost type-traits library, we[link background.references \[2\]] have written a -set of very specific traits classes, each of which encapsulate a single trait -from the C++ type system; for example, is a type a pointer or a reference type? -Or does a type have a trivial constructor, or a const-qualifier? -The type-traits classes share a unified design: each class inherits from a -the type __true_type if the type has the specified property and inherits from -__false_type otherwise. As we will show, these classes can be used in -generic programming to determine the properties of a given type and introduce -optimizations that are appropriate for that case. - -The type-traits library also contains a set of classes that perform a -specific transformation on a type; for example, they can remove a -top-level const or volatile qualifier from a type. Each class that -performs a transformation defines a single typedef-member `type` -that is the result of the transformation. All of the type-traits -classes are defined inside namespace `boost`; for brevity, namespace-qualification -is omitted in most of the code samples given. - -[h4 Implementation] - -There are far too many separate classes contained in the type-traits library -to give a full implementation here - see the source code in the Boost library -for the full details - however, most of the implementation is fairly repetitive -anyway, so here we will just give you a flavor for how some of the classes are -implemented. Beginning with possibly the simplest class in the library, -`is_void` inherits from `__true_type` only if `T` is `void`. - - template - struct __is_void : public __false_type{}; - - template <> - struct __is_void : public __true_type{}; - -Here we define a primary version of the template class `__is_void`, and -provide a full-specialization when `T` is `void`. While full specialization -of a template class is an important technique, sometimes we need a -solution that is halfway between a fully generic solution, and a full -specialization. This is exactly the situation for which the standards committee -defined partial template-class specialization. As an example, consider the -class `boost::is_pointer`: here we needed a primary version that handles -all the cases where T is not a pointer, and a partial specialization to -handle all the cases where T is a pointer: - - template - struct __is_pointer : public __false_type{}; - - template - struct __is_pointer : public __true_type{}; - -The syntax for partial specialization is somewhat arcane and could easily -occupy an article in its own right; like full specialization, in order to -write a partial specialization for a class, you must first declare the -primary template. The partial specialization contains an extra <...> after the -class name that contains the partial specialization parameters; these define -the types that will bind to that partial specialization rather than the -default template. The rules for what can appear in a partial specialization -are somewhat convoluted, but as a rule of thumb if you can legally write two -function overloads of the form: - - void foo(T); - void foo(U); - -Then you can also write a partial specialization of the form: - - template - class c{ /*details*/ }; - - template - class c{ /*details*/ }; - -This rule is by no means foolproof, but it is reasonably simple to remember -and close enough to the actual rule to be useful for everyday use. - -As a more complex example of partial specialization consider the class -`remove_extent`. This class defines a single typedef-member `type` that -is the same type as T but with any top-level array bounds removed; -this is an example of a traits class that performs a transformation on a type: - - template - struct __remove_extent - { typedef T type; }; - - template - struct __remove_extent - { typedef T type; }; - -The aim of `__remove_extent` is this: imagine a generic algorithm that is -passed an array type as a template parameter, `__remove_extent` provides a -means of determining the underlying type of the array. For example -`remove_extent::type` would evaluate to the type `int[5]`. -This example also shows that the number of template parameters in a -partial specialization does not have to match the number in the -default template. However, the number of parameters that appear after the -class name do have to match the number and type of the parameters in the -default template. - -[h4 Optimized copy] - -As an example of how the type traits classes can be used, consider the -standard library algorithm copy: - - template - Iter2 copy(Iter1 first, Iter1 last, Iter2 out); - -Obviously, there's no problem writing a generic version of copy that works -for all iterator types `Iter1` and `Iter2`; however, there are some -circumstances when the copy operation can best be performed by a call to -`memcpy`. In order to implement copy in terms of `memcpy` all of the -following conditions need to be met: - -* Both of the iterator types `Iter1` and `Iter2` must be pointers. -* Both `Iter1` and `Iter2` must point to the same type - excluding const and -volatile-qualifiers. -* The type pointed to by `Iter1` must have a trivial assignment operator. - -By trivial assignment operator we mean that the type is either a scalar type[link background.references \[3\]] or: - -* The type has no user defined assignment operator. -* The type does not have any data members that are references. -* All base classes, and all data member objects must have trivial assignment operators. - -If all these conditions are met then a type can be copied using `memcpy` -rather than using a compiler generated assignment operator. The type-traits -library provides a class `__has_trivial_assign`, such that -`has_trivial_assign::value` is true only if T has a trivial assignment operator. -This class "just works" for scalar types, but has to be explicitly -specialised for class/struct types that also happen to have a trivial assignment -operator. In other words if __has_trivial_assign gives the wrong answer, -it will give the "safe" wrong answer - that trivial assignment is not allowable. - -The code for an optimized version of copy that uses `memcpy` where appropriate is -given in [link boost_typetraits.copy the examples]. The code begins by defining a template -function `do_copy` that performs a "slow but safe" copy. The last parameter passed -to this function may be either a `__true_type` or a `__false_type`. Following that -there is an overload of do_copy that uses `memcpy`: this time the iterators are required -to actually be pointers to the same type, and the final parameter must be a -`__true_type`. Finally, the version of `copy` calls `do_copy`, passing -`__has_trivial_assign()` as the final parameter: this will dispatch -to the optimized version where appropriate, otherwise it will call the -"slow but safe version". - -[h4 Was it worth it?] - -It has often been repeated in these columns that "premature optimization is the -root of all evil" [link background.references \[4\]]. So the question must be asked: was our optimization -premature? To put this in perspective the timings for our version of copy -compared a conventional generic copy[link background.references \[5\]] are shown in table 1. - -Clearly the optimization makes a difference in this case; but, to be fair, -the timings are loaded to exclude cache miss effects - without this -accurate comparison between algorithms becomes difficult. However, perhaps -we can add a couple of caveats to the premature optimization rule: - -*If you use the right algorithm for the job in the first place then optimization -will not be required; in some cases, memcpy is the right algorithm. -*If a component is going to be reused in many places by many people then -optimizations may well be worthwhile where they would not be so for a single -case - in other words, the likelihood that the optimization will be -absolutely necessary somewhere, sometime is that much higher. -Just as importantly the perceived value of the stock implementation will be -higher: there is no point standardizing an algorithm if users reject it on -the grounds that there are better, more heavily optimized versions available. - -[table Time taken to copy 1000 elements using `copy` (times in micro-seconds) - -[[Version] [T] [Time]] -[["Optimized" copy] [char] [0.99]] -[[Conventional copy] [char] [8.07]] -[["Optimized" copy] [int] [2.52]] -[[Conventional copy] [int] [8.02]] -] - -[h4 Pair of References] -The optimized copy example shows how type traits may be used to perform -optimization decisions at compile-time. Another important usage of type traits -is to allow code to compile that otherwise would not do so unless excessive -partial specialization is used. This is possible by delegating partial -specialization to the type traits classes. Our example for this form of -usage is a pair that can hold references [link background.references \[6\]]. - -First, let us examine the definition of `std::pair`, omitting the -comparison operators, default constructor, and template copy constructor for -simplicity: - - template - struct pair - { - typedef T1 first_type; - typedef T2 second_type; - - T1 first; - T2 second; - - pair(const T1 & nfirst, const T2 & nsecond) - :first(nfirst), second(nsecond) { } - }; - -Now, this "pair" cannot hold references as it currently stands, because the -constructor would require taking a reference to a reference, which is -currently illegal [link background.references \[7\]]. Let us consider what the constructor's parameters -would have to be in order to allow "pair" to hold non-reference types, -references, and constant references: - -[table Required Constructor Argument Types -[[Type of `T1`] [Type of parameter to initializing constructor]] -[[T] [const T &]] -[[T &] [T &]] -[[const T &] [const T &]] -] - -A little familiarity with the type traits classes allows us to construct a -single mapping that allows us to determine the type of parameter from the -type of the contained class. The type traits classes provide a -transformation __add_reference, which adds a reference to its type, -unless it is already a reference. - -[table Using add_reference to synthesize the correct constructor type -[[Type of `T1`] [Type of `const T1`] [Type of `add_reference::type`]] -[[T] [const T] [const T &]] -[[T &] [T & \[8\]] [T &]] -[[const T &] [const T &] [const T &]] -] - -This allows us to build a primary template definition for `pair` that can -contain non-reference types, reference types, and constant reference types: - - template - struct pair - { - typedef T1 first_type; - typedef T2 second_type; - - T1 first; - T2 second; - - pair(boost::__add_reference::type nfirst, - boost::__add_reference::type nsecond) - :first(nfirst), second(nsecond) { } - }; - -Add back in the standard comparison operators, default constructor, -and template copy constructor (which are all the same), and you have a -`std::pair` that can hold reference types! - -This same extension could have been done using partial template specialization -of `pair`, but to specialize `pair` in this way would require three partial -specializations, plus the primary template. Type traits allows us to -define a single primary template that adjusts itself auto-magically to -any of these partial specializations, instead of a brute-force partial -specialization approach. Using type traits in this fashion allows -programmers to delegate partial specialization to the type traits classes, -resulting in code that is easier to maintain and easier to understand. - -[h4 Conclusion] - -We hope that in this article we have been able to give you some idea of -what type-traits are all about. A more complete listing of the available -classes are in the boost documentation, along with further examples using -type traits. Templates have enabled C++ uses to take the advantage of the -code reuse that generic programming brings; hopefully this article has -shown that generic programming does not have to sink to the lowest common -denominator, and that templates can be optimal as well as generic. - -[h4 Acknowledgements] - -The authors would like to thank Beman Dawes and Howard Hinnant for their -helpful comments when preparing this article. - -[h4 References] - -# Nathan C. Myers, C++ Report, June 1995. -# The type traits library is based upon contributions by Steve Cleary, Beman Dawes, Howard Hinnant and John Maddock: it can be found at www.boost.org. -# A scalar type is an arithmetic type (i.e. a built-in integer or floating point type), an enumeration type, a pointer, a pointer to member, or a const- or volatile-qualified version of one of these types. -# This quote is from Donald Knuth, ACM Computing Surveys, December 1974, pg 268. -# The test code is available as part of the boost utility library (see algo_opt_examples.cpp), the code was compiled with gcc 2.95 with all optimisations turned on, tests were conducted on a 400MHz Pentium II machine running Microsoft Windows 98. -# John Maddock and Howard Hinnant have submitted a "compressed_pair" library to Boost, which uses a technique similar to the one described here to hold references. Their pair also uses type traits to determine if any of the types are empty, and will derive instead of contain to conserve space -- hence the name "compressed". -# This is actually an issue with the C++ Core Language Working Group (issue #106), submitted by Bjarne Stroustrup. The tentative resolution is to allow a "reference to a reference to T" to mean the same thing as a "reference to T", but only in template instantiation, in a method similar to multiple cv-qualifiers. -# For those of you who are wondering why this shouldn't be const-qualified, remember that references are always implicitly constant (for example, you can't re-assign a reference). Remember also that "const T &" is something completely different. For this reason, cv-qualifiers on template type arguments that are references are ignored. - -[endsect] +[include background.qbk] [section:category Type Traits by Category] -[section:value_traits Type Traits that Describe the Properties of a Type] -These traits are all /value traits/, which is to say the traits classes all -inherit from __integral_constant, and are used to access some numerical -property of a type. Often this is a simple true or false Boolean value, -but in a few cases may be some other integer value (for example when dealing -with type alignments, or array bounds: see `__alignment_of`, `__rank` and `__extent`). - -[section:primary Categorizing a Type] - -These traits identify what "kind" of type some type `T` is. These are split into -two groups: primary traits which are all mutually exclusive, and composite traits -that are compositions of one or more primary traits. - -For any given type, exactly one primary type trait will inherit from -__true_type, and all the others will inherit from __false_type, in other -words these traits are mutually exclusive. - -This means that `__is_integral::value` and `__is_floating_point::value` -will only ever be true for built-in types; if you want to check for a -user-defined class type that behaves "as if" it is an integral or floating point type, -then use the `std::numeric_limits template` instead. - -[*Synopsis:] - - template - struct __is_array; - - template - struct __is_class; - - template - struct __is_enum; - - template - struct __is_floating_point; - - template - struct __is_function; - - template - struct __is_integral; - - template - struct __is_member_function_pointer; - - template - struct __is_member_object_pointer; - - template - struct __is_pointer; - - template - struct __is_reference; - - template - struct __is_union; - - template - struct __is_void; - -The following traits are made up of the union of one or more type -categorizations. A type may belong to more than one of these categories, -in addition to one of the primary categories. - - template - struct __is_arithmetic; - - template - struct __is_compound; - - template - struct __is_fundamental; - - template - struct __is_member_pointer; - - template - struct __is_object; - - template - struct __is_scalar; - -[endsect] - -[section:properties General Type Properties] - -The following templates describe the general properties of a type. - -[*Synopsis:] - - template - struct __alignment_of; - - template - struct __has_nothrow_assign; - - template - struct __has_nothrow_constructor; - - template - struct __has_nothrow_copy; - - template - struct __has_trivial_assign; - - template - struct __has_trivial_constructor; - - template - struct __has_trivial_copy; - - template - struct __has_trivial_destructor; - - template - struct __has_virtual_destructor; - - template - struct __is_abstract; - - template - struct __is_const; - - template - struct __is_empty; - - template - struct __is_stateless; - - template - struct __is_pod; - - template - struct __is_polymorphic; - - template - struct __is_volatile; - - template - struct __extent; - - template - struct __rank; +[include value_traits.qbk] +[include transform_traits.qbk] +[include alignment_traits.qbk] +[include decomposing_func.qbk] [endsect] -[section:relate Relationships Between Two Types] - -These templates determine the whether there is a relationship -between two types: - -[*Synopsis:] - - template - struct __is_base_of; - - template - struct __is_convertible; - - template - struct __is_same; - -[endsect] - -[endsect] -[section:transform Type Traits that Transform One Type to Another] - -The following templates transform one type to another, -based upon some well-defined rule. -Each template has a single member called `type` that is the -result of applying the transformation to the template argument `T`. - -[*Synopsis:] - - template - struct __add_const; - - template - struct __add_cv; - - template - struct __add_pointer; - - template - struct __add_reference; - - template - struct __add_volatile; - - template - struct __floating_point_promotion; - - template - struct __integral_promotion; - - template - struct __promote; - - template - struct __remove_all_extents; - - template - struct __remove_const; - - template - struct __remove_cv; - - template - struct __remove_extent; - - template - struct __remove_pointer; - - template - struct __remove_reference; - - template - struct __remove_volatile; - -[h4 Broken Compiler Workarounds:] - -For all of these templates support for partial specialization of class templates is -required to correctly implement the transformation. -On the other hand, practice shows that many of the templates from this -category are very useful, and often essential for implementing some -generic libraries. Lack of these templates is often one of the major -limiting factors in porting those libraries to compilers that do not yet -support this language feature. As some of these compilers are going to be -around for a while, and at least one of them is very wide-spread, -it was decided that the library should provide workarounds where possible. - -The basic idea behind the workaround is to manually define full -specializations of all type transformation templates for all fundamental types, -and all their 1st and 2nd rank cv-[un]qualified derivative pointer types, and to -provide a user-level macro that will define all the explicit specializations needed -for any user-defined type T. - -The first part guarantees the successful compilation of something like this: - - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - ... - BOOST_STATIC_ASSERT((is_same::type>::value)); - -and the second part provides the library's users with a mechanism to make the -above code work not only for `char`, `int` or other built-in type, -but for their own types as well: - - namespace myspace{ - struct MyClass {}; - } - // declare this at global scope: - BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(myspace::MyClass) - // transformations on myspace::MyClass now work: - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - // etc. - -Note that the macro BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION evaluates -to nothing on those compilers that *do* support partial specialization. - -[endsect] - -[section:alignment Synthesizing Types with Specific Alignments] - -Some low level memory management routines need to synthesize a POD type with -specific alignment properties. The template `__type_with_alignment` finds the smallest -type with a specified alignment, while template `__aligned_storage` creates a type -with a specific size and alignment. - -[*Synopsis] - - template - struct __type_with_alignment; - - template - struct __aligned_storage; - -[endsect] - -[section:function Decomposing Function Types] - -The class template __function_traits extracts information from function types -(see also __is_function). This traits class allows you to tell how many arguments -a function takes, what those argument types are, and what the return type is. - -[*Synopsis] - - template - struct __function_traits; - -[endsect] - -[endsect] - -[section:user_defined User Defined Specializations] - -Occationally the end user may need to provide their own specialization -for one of the type traits - typically where intrinsic compiler support -is required to implement a specific trait fully. -These specializations should derive from boost::__true_type or boost::__false_type -as appropriate: - - #include - #include - #include - - struct my_pod{}; - struct my_union - { - char c; - int i; - }; - - namespace boost - { - template<> - struct __is_pod : public __true_type{}; - - template<> - struct __is_pod : public __true_type{}; - - template<> - struct __is_union : public __true_type{}; - - template<> - struct __is_class : public __false_type{}; - } - -[endsect] - -[section:intrinsics Support for Compiler Intrinsics] - -There are some traits that can not be implemented within the current C++ language: -to make these traits "just work" with user defined types, some kind of additional -help from the compiler is required. Currently (May 2005) MWCW 9 and Visual C++ 8 -provide the necessary intrinsics, and other compilers will no doubt follow in due -course. - -The Following traits classes always need compiler support to do the right thing -for all types -(but all have safe fallback positions if this support is unavailable): - -* __is_union -* __is_pod -* __has_trivial_constructor -* __has_trivial_copy -* __has_trivial_assign -* __has_trivial_destructor -* __has_nothrow_constructor -* __has_nothrow_copy -* __has_nothrow_assign -* __has_virtual_destructor - -The following traits classes can't be portably implemented in the C++ language, -although in practice, the implementations do in fact do the right thing on all -the compilers we know about: - -* __is_empty -* __is_polymorphic - -The following traits classes are dependent on one or more of the above: - -* __is_class -* __is_stateless - -The hooks for compiler-intrinsic support are defined in -[@../../boost/type_traits/intrinsics.hpp boost/type_traits/intrinsics.hpp], adding support for new compilers is simply -a matter of defining one of more of the following macros: - -[table Macros for Compiler Intrinsics - [[BOOST_IS_UNION(T)][Should evaluate to true if T is a union type]] - [[BOOST_IS_POD(T)][Should evaluate to true if T is a POD type]] - [[BOOST_IS_EMPTY(T)][Should evaluate to true if T is an empty struct or union]] - [[BOOST_HAS_TRIVIAL_CONSTRUCTOR(T)][Should evaluate to true if the default constructor for T is trivial (i.e. has no effect)]] - [[BOOST_HAS_TRIVIAL_COPY(T)][Should evaluate to true if T has a trivial copy constructor (and can therefore be replaced by a call to memcpy)]] - [[BOOST_HAS_TRIVIAL_ASSIGN(T)][Should evaluate to true if T has a trivial assignment operator (and can therefore be replaced by a call to memcpy)]] - [[BOOST_HAS_TRIVIAL_DESTRUCTOR(T)][Should evaluate to true if T has a trivial destructor (i.e. ~T() has no effect)]] - [[BOOST_HAS_NOTHROW_CONSTRUCTOR(T)][Should evaluate to true if `T x;` can not throw]] - [[BOOST_HAS_NOTHROW_COPY(T)][Should evaluate to true if `T(t)` can not throw]] - [[BOOST_HAS_NOTHROW_ASSIGN(T)][Should evaluate to true if `T t, u; t = u` can not throw]] - [[BOOST_HAS_VIRTUAL_DESTRUCTOR(T)][Should evaluate to true T has a virtual destructor]] -] - -[endsect] - -[section:mpl MPL Interoperability] - -All the value based traits in this library conform to MPL's requirements -for an [@../../libs/mpl/doc/refmanual/integral-constant.html Integral Constant type]: that includes a number of rather intrusive -workarounds for broken compilers. - -Purely as an implementation detail, this -means that `__true_type` inherits from [@../../libs/mpl/doc/refmanual/bool.html `boost::mpl::true_`], `__false_type` inherits -from [@../../libs/mpl/doc/refmanual/bool.html `boost::mpl::false_`], and `__integral_constant` inherits from -[@../../libs/mpl/doc/refmanual/integral-c.html `boost::mpl::integral_c`] (provided `T` is not `bool`) - -[endsect] - -[section:examples Examples] - -[section:copy An Optimized Version of std::copy] - -Demonstrates a version of `std::copy` that uses `__has_trivial_assign` to -determine whether to use `memcpy` to optimise the copy operation -(see [@../../libs/type_traits/examples/copy_example.cpp copy_example.cpp]): - - // - // opt::copy - // same semantics as std::copy - // calls memcpy where appropriate. - // - - namespace detail{ - - template - I2 copy_imp(I1 first, I1 last, I2 out, const boost::__integral_constant&) - { - while(first != last) - { - *out = *first; - ++out; - ++first; - } - return out; - } - - template - T* copy_imp(const T* first, const T* last, T* out, const boost::__true_type&) - { - memcpy(out, first, (last-first)*sizeof(T)); - return out+(last-first); - } - - - } - - template - inline I2 copy(I1 first, I1 last, I2 out) - { - // - // We can copy with memcpy if T has a trivial assignment operator, - // and if the iterator arguments are actually pointers (this last - // requirement we detect with overload resolution): - // - typedef typename std::iterator_traits::value_type value_type; - return detail::copy_imp(first, last, out, boost::__has_trivial_assign()); - } - - -[endsect] - -[section:fill An Optimised Version of std::fill] - -Demonstrates a version of `std::fill` that uses `__has_trivial_assign` to -determine whether to use `memset` to optimise the fill operation -(see [@../../libs/type_traits/examples/fill_example.cpp fill_example.cpp]): - - // - // fill - // same as std::fill, but uses memset where appropriate - // - namespace detail{ - - template - void do_fill(I first, I last, const T& val, const boost::__integral_constant&) - { - while(first != last) - { - *first = val; - ++first; - } - } - - template - void do_fill(T* first, T* last, const T& val, const boost::__true_type&) - { - std::memset(first, val, last-first); - } - - } - - template - inline void fill(I first, I last, const T& val) - { - // - // We can do an optimised fill if T has a trivial assignment - // operator and if it's size is one: - // - typedef boost::__integral_constant::value && (sizeof(T) == 1)> truth_type; - detail::do_fill(first, last, val, truth_type()); - } - - -[endsect] - -[section:destruct An Example that Omits Destructor Calls For Types with Trivial Destructors] - -Demonstrates a simple algorithm that uses `__has_trivial_destruct` to -determine whether to destructors need to be called -(see [@../../libs/type_traits/examples/trivial_destructor_example.cpp trivial_destructor_example.cpp]): - - // - // algorithm destroy_array: - // The reverse of std::unitialized_copy, takes a block of - // initialized memory and calls destructors on all objects therein. - // - - namespace detail{ - - template - void do_destroy_array(T* first, T* last, const boost::__false_type&) - { - while(first != last) - { - first->~T(); - ++first; - } - } - - template - inline void do_destroy_array(T* first, T* last, const boost::__true_type&) - { - } - - } // namespace detail - - template - inline void destroy_array(T* p1, T* p2) - { - detail::do_destroy_array(p1, p2, ::boost::__has_trivial_destructor()); - } - - -[endsect] - -[section:iter An improved Version of std::iter_swap] - -Demonstrates a version of `std::iter_swap` that use type traits to -determine whether an it's arguments are proxying iterators or not, -if they're not then it just does a `std::swap` of it's dereferenced -arguments (the -same as `std::iter_swap` does), however if they are proxying iterators -then takes special care over the swap to ensure that the algorithm -works correctly for both proxying iterators, and even iterators of -different types -(see [@../../libs/type_traits/examples/iter_swap_example.cpp iter_swap_example.cpp]): - - // - // iter_swap: - // tests whether iterator is a proxying iterator or not, and - // uses optimal form accordingly: - // - namespace detail{ - - template - static void do_swap(I one, I two, const boost::__false_type&) - { - typedef typename std::iterator_traits::value_type v_t; - v_t v = *one; - *one = *two; - *two = v; - } - template - static void do_swap(I one, I two, const boost::__true_type&) - { - using std::swap; - swap(*one, *two); - } - - } - - template - inline void iter_swap(I1 one, I2 two) - { - // - // See is both arguments are non-proxying iterators, - // and if both iterator the same type: - // - typedef typename std::iterator_traits::reference r1_t; - typedef typename std::iterator_traits::reference r2_t; - - typedef boost::__integral_constant::value - && ::boost::__is_reference::value - && ::boost::__is_same::value> truth_type; - - detail::do_swap(one, two, truth_type()); - } - - -[endsect] - -[section:to_double Convert Numeric Types and Enums to double] - -Demonstrates a conversion of -[@../../libs/numeric/conversion/doc/definitions.html#numtypes Numeric Types] -and enum types to double: - - template - inline double to_double(T const& value) - { - typedef typename boost::promote::type promoted; - return boost::numeric::converter::convert(value); - } - -[endsect] - -[endsect] +[include user_defined.qbk] +[include intrinsics.qbk] +[include mpl.qbk] +[include examples.qbk] [section:reference Alphabetical Reference] -[section:add_const add_const] +[include add_const.qbk] +[include add_cv.qbk] +[include add_pointer.qbk] +[include add_reference.qbk] +[include add_volatile.qbk] +[include aligned_storage.qbk] +[include alignment_of.qbk] +[include decay.qbk] +[include extent.qbk] +[include floating_point_promotion.qbk] +[include function_traits.qbk] - template - struct add_const - { - typedef __below type; - }; - -__type The same type as `T const` for all `T`. +[include has_nothrow_assign.qbk] +[include has_nothrow_constructor.qbk] +[include has_nothrow_copy.qbk] +[section:has_nothrow_cp_cons has_nothrow_copy_constructor] +See __has_nothrow_copy. +[endsect] +[section:has_no_throw_def_cons has_nothrow_default_constructor] +See __has_nothrow_constructor. +[endsect] +[include has_trivial_assign.qbk] +[include has_trivial_constructor.qbk] +[include has_trivial_copy.qbk] +[section:has_trivial_cp_cons has_trivial_copy_constructor] +See __has_trivial_copy. +[endsect] +[section:has_trivial_def_cons has_trivial_default_constructor] +See __has_trivial_constructor. +[endsect] +[include has_trivial_destructor.qbk] +[include has_virtual_destructor.qbk] -__std_ref 3.9.3. +[include integral_constant.qbk] +[include integral_promotion.qbk] -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. +[include is_abstract.qbk] +[include is_arithmetic.qbk] +[include is_array.qbk] +[include is_base_of.qbk] +[include is_class.qbk] +[include is_complex.qbk] +[include is_compound.qbk] +[include is_const.qbk] +[include is_convertible.qbk] +[include is_empty.qbk] +[include is_enum.qbk] +[include is_floating_point.qbk] +[include is_function.qbk] +[include is_fundamental.qbk] +[include is_integral.qbk] +[include is_member_function_pointer.qbk] +[include is_member_object_pointer.qbk] +[include is_member_pointer.qbk] +[include is_object.qbk] +[include is_pod.qbk] +[include is_pointer.qbk] +[include is_polymorphic.qbk] +[include is_same.qbk] +[include is_scalar.qbk] +[include is_signed.qbk] +[include is_stateless.qbk] +[include is_reference.qbk] +[include is_union.qbk] +[include is_unsigned.qbk] +[include is_void.qbk] +[include is_volatile.qbk] -__header ` #include ` or ` #include ` +[include make_signed.qbk] +[include make_unsigned.qbk] -[table Examples +[include promote.qbk] +[include rank.qbk] -[ [Expression] [Result Type]] - -[[`add_const::type`][`int const`]] - -[[`add_const::type`] [`int&`]] - -[[`add_const::type`] [`int* const`]] - -[[`add_const::type`] [`int const`]] - -] - -[endsect] - -[section:add_cv add_cv] - - template - struct add_cv - { - typedef __below type; - }; - -__type The same type as `T const volatile` for all `T`. - -__std_ref 3.9.3. - -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. - -__header ` #include ` or ` #include ` - -[table Examples - -[ [Expression] [Result Type]] - -[[`add_cv::type`][`int const volatile`]] - -[[`add_cv::type`] [`int&`]] - -[[`add_cv::type`] [`int* const volatile`]] - -[[`add_cv::type`] [`int const volatile`]] - -] - -[endsect] - -[section:add_pointer add_pointer] - - template - struct add_pointer - { - typedef __below type; - }; - -__type The same type as `remove_reference::type*`. - -The rationale for this template -is that it produces the same type as `TYPEOF(&t)`, -where `t` is an object of type `T`. - -__std_ref 8.3.1. - -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. - -__header ` #include ` or ` #include ` - -[table Examples - -[ [Expression] [Result Type]] - -[[`add_pointer::type`][`int*`]] - -[[`add_pointer::type`] [`int const*`]] - -[[`add_pointer::type`] [`int**`]] - -[[`add_pointer::type`] [`int**`]] - -] - -[endsect] - -[section:add_reference add_reference] - - template - struct add_reference - { - typedef __below type; - }; - -__type If `T` is not a reference type then `T&`, otherwise `T`. - -__std_ref 8.3.2. - -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. - -__header ` #include ` or ` #include ` - -[table Examples - -[ [Expression] [Result Type]] - -[[`add_reference::type`][`int&`]] - -[[`add_reference::type`] [`int const&`]] - -[[`add_reference::type`] [`int*&`]] - -[[`add_reference::type`] [`int*&`]] - -] - -[endsect] - -[section:add_volatile add_volatile] - - template - struct add_volatile - { - typedef __below type; - }; - -__type The same type as `T volatile` for all `T`. - -__std_ref 3.9.3. - -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. - -__header ` #include ` or ` #include ` - -[table Examples - -[ [Expression] [Result Type]] - -[[`add_volatile::type`][`int volatile`]] - -[[`add_volatile::type`] [`int&`]] - -[[`add_volatile::type`] [`int* volatile`]] - -[[`add_volatile::type`] [`int const volatile`]] - -] - -[endsect] - -[section:aligned_storage aligned_storage] - - template - struct aligned_storage - { - typedef __below type; - }; - -__type a built-in or POD type with size `Size` and an alignment -that is a multiple of `Align`. - -__header ` #include ` or ` #include ` - -[endsect] - -[section:alignment_of alignment_of] - template - struct alignment_of : public __integral_constant {}; - -__inherit Class template alignment_of inherits from -`__integral_constant`, where `ALIGNOF(T)` is the -alignment of type T. - -['Note: strictly speaking you should only rely on -the value of `ALIGNOF(T)` being a multiple of the true alignment of T, although -in practice it does compute the correct value in all the cases we know about.] - -__header ` #include ` or ` #include ` - -__examples - -[:`alignment_of` inherits from `__integral_constant`.] - -[:`alignment_of::type` is the type `__integral_constant`.] - -[:`alignment_of::value` is an integral constant -expression with value `ALIGNOF(double)`.] - -[:`alignment_of::value_type` is the type `std::size_t`.] - -[endsect] - -[section:extent extent] - template - struct extent : public __integral_constant {}; - -__inherit Class template extent inherits from `__integral_constant`, -where `EXTENT(T,N)` is the number of elements in the N'th array dimention of type `T`. - -If `T` is not an array type, or if `N > __rank::value`, or if the N'th array bound -is incomplete, then `EXTENT(T,N)` is zero. - -__header ` #include ` or ` #include ` - -__examples - -[:`extent` inherits from `__integral_constant`.] - -[:`extent::type` is the type `__integral_constant`.] - -[:`extent::value` is an integral constant -expression that evaluates to /4/.] - -[:`extent::value` is an integral constant -expression that evaluates to /0/.] - -[:`extent::value` is an integral constant -expression that evaluates to /2/.] - -[:`extent::value` is an integral constant -expression that evaluates to /0/.] - -[:`extent::value_type` is the type `std::size_t`.] - -[endsect] - -[section:floating_point_promotion floating_point_promotion] - - template - struct floating_point_promotion - { - typedef __below type; - }; - -__type If floating point promotion can be applied to an rvalue of type `T`, -then applies floating point promotion to `T` and keeps cv-qualifiers of `T`, -otherwise leaves `T` unchanged. - -__std_ref 4.6. - -__header ` #include ` or ` #include ` - -[table Examples - -[ [Expression] [Result Type]] - -[[`floating_point_promotion::type`][`double const`]] - -[[`floating_point_promotion::type`][`float&`]] - -[[`floating_point_promotion::type`][`short`]] - -] - -[endsect] - -[section:function_traits function_traits] -[def __argN '''argN_type'''] - - template - struct function_traits - { - static const std::size_t arity = __below; - typedef __below result_type; - typedef __below __argN; - }; - -The class template function_traits will only compile if: - -* The compiler supports partial specialization of class templates. -* The template argument `T` is a /function type/, note that this ['[*is not]] -the same thing as a /pointer to a function/. - -[table Function Traits Members -[[Member] [Description]] -[[`function_traits::arity`] - [An integral constant expression that gives the number of arguments accepted by the function type `F`.]] -[[`function_traits::result_type`] - [The type returned by function type `F`.]] -[[`function_traits::__argN`] - [The '''Nth''' argument type of function type `F`, where `1 <= N <= arity` of `F`.]] -] - -[table Examples -[[Expression] [Result]] -[[`function_traits::arity`] [An integral constant expression that has the value 0.]] -[[`function_traits::arity`] [An integral constant expression that has the value 1.]] -[[`function_traits::arity`] [An integral constant expression that has the value 4.]] -[[`function_traits::result_type`] [The type `void`.]] -[[`function_traits::result_type`] [The type `long`.]] -[[`function_traits::arg1_type`] [The type `int`.]] -[[`function_traits::arg4_type`] [The type `void*`.]] -[[`function_traits::arg5_type`] [A compiler error: there is no `arg4_type` since there are only three arguments.]] -[[`function_traits::arity`] [A compiler error: argument type is a /function pointer/, and not a /function type/.]] - -] - -[endsect] - -[section:has_nothrow_assign has_nothrow_assign] - - template - struct has_nothrow_assign : public __tof {}; - -__inherit If T is a (possibly cv-qualified) type with a non-throwing assignment-operator -then inherits from __true_type, otherwise inherits from __false_type. Type `T` -must be a complete type. - -__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, -`has_nothrow_assign` will never report that a class or struct has a -non-throwing assignment-operator; this is always safe, if possibly sub-optimal. -Currently (May 2005) only Visual C++ 8 has the necessary compiler support to ensure that this -trait "just works". - -__header ` #include ` or ` #include ` - -[endsect] - -[section:has_nothrow_constructor has_nothrow_constructor] - template - struct has_nothrow_constructor : public __tof {}; - -__inherit If T is a (possibly cv-qualified) type with a non-throwing default-constructor -then inherits from __true_type, otherwise inherits from __false_type. Type `T` -must be a complete type. - -__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, -`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". - -__header ` #include ` or ` #include ` - -[endsect] - -[section:has_nothrow_copy has_nothrow_copy] - template - struct has_nothrow_copy : public __tof {}; - -__inherit If T is a (possibly cv-qualified) type with a non-throwing copy-constructor -then inherits from __true_type, otherwise inherits from __false_type. Type `T` -must be a complete type. - -__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, -`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". - -__header ` #include ` or ` #include ` - -[endsect] - -[section:has_trivial_assign has_trivial_assign] - template - struct has_trivial_assign : public __tof {}; - -__inherit If T is a (possibly cv-qualified) type with a trivial assignment-operator -then inherits from __true_type, otherwise inherits from __false_type. - -If a type has a trivial assignment-operator then the operator has the same effect -as copying the bits of one object to the other: -calls to the operator can be safely replaced with a call to `memcpy`. - -__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, -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. - -__std_ref 12.8p11. - -__header ` #include ` or ` #include ` - -__examples - -[:`has_trivial_assign` inherits from `__true_type`.] - -[:`has_trivial_assign::type` is the type `__true_type`.] - -[:`has_trivial_assign::value` is an integral constant -expression that evaluates to /true/.] - -[:`has_trivial_assign::value` is an integral constant -expression that evaluates to /false/.] - -[:`has_trivial_assign::value_type` is the type `bool`.] - -[endsect] - -[section:has_trivial_constructor has_trivial_constructor] - template - struct has_trivial_constructor : public __tof {}; - -__inherit If T is a (possibly cv-qualified) type with a trivial default-constructor -then inherits from __true_type, otherwise inherits from __false_type. - -If a type has a trivial default-constructor then the constructor have no effect: -calls to the constructor can be safely omitted. Note that using meta-programming -to omit a call to a single trivial-constructor call is of no benefit whatsoever. -However, if loops and/or exception handling code can also be omitted, then some -benefit in terms of code size and speed can be obtained. - -__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, -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. - -__std_ref 12.1p6. - -__header ` #include ` or ` #include ` - -__examples - -[:`has_trivial_constructor` inherits from `__true_type`.] - -[:`has_trivial_constructor::type` is the type `__true_type`.] - -[:`has_trivial_constructor::value` is an integral constant -expression that evaluates to /true/.] - -[:`has_trivial_constructor::value` is an integral constant -expression that evaluates to /false/.] - -[:`has_trivial_constructor::value_type` is the type `bool`.] - -[endsect] - -[section:has_trivial_copy has_trivial_copy] - template - struct has_trivial_copy : public __tof {}; - -__inherit If T is a (possibly cv-qualified) type with a trivial copy-constructor -then inherits from __true_type, otherwise inherits from __false_type. - -If a type has a trivial copy-constructor then the constructor has the same effect -as copying the bits of one object to the other: -calls to the constructor can be safely replaced with a call to `memcpy`. - -__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, -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. - -__std_ref 12.8p6. - -__header ` #include ` or ` #include ` - -__examples - -[:`has_trivial_copy` inherits from `__true_type`.] - -[:`has_trivial_copy::type` is the type `__true_type`.] - -[:`has_trivial_copy::value` is an integral constant -expression that evaluates to /true/.] - -[:`has_trivial_copy::value` is an integral constant -expression that evaluates to /false/.] - -[:`has_trivial_copy::value_type` is the type `bool`.] - -[endsect] - -[section:has_trivial_destructor has_trivial_destructor] - template - struct has_trivial_destructor : public __tof {}; - -__inherit If T is a (possibly cv-qualified) type with a trivial destructor -then inherits from __true_type, otherwise inherits from __false_type. - -If a type has a trivial destructor then the destructor has no effect: -calls to the destructor can be safely omitted. Note that using meta-programming -to omit a call to a single trivial-constructor call is of no benefit whatsoever. -However, if loops and/or exception handling code can also be omitted, then some -benefit in terms of code size and speed can be obtained. - -__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, -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. - -__std_ref 12.4p3. - -__header ` #include ` or ` #include ` - -__examples - -[:`has_trivial_destructor` inherits from `__true_type`.] - -[:`has_trivial_destructor::type` is the type `__true_type`.] - -[:`has_trivial_destructor::value` is an integral constant -expression that evaluates to /true/.] - -[:`has_trivial_destructor::value` is an integral constant -expression that evaluates to /false/.] - -[:`has_trivial_destructor::value_type` is the type `bool`.] - -[endsect] - -[section:has_virtual_destructor has_virtual_destructor] - template - struct has_virtual_destructor : public __tof {}; - -__inherit If T is a (possibly cv-qualified) type with a virtual destructor -then inherits from __true_type, otherwise inherits from __false_type. - -__compat This trait is provided for completeness, since it's part of the -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 has the necessary __intrinsics. - -__std_ref 12.4. - -__header ` #include ` or ` #include ` - -[endsect] - -[section:integral_constant integral_constant] - template - struct integral_constant - { - typedef integral_constant type; - typedef T value_type; - static const T value = val; - }; - - typedef integral_constant true_type; - typedef integral_constant false_type; - -Class template `integral_constant` is the common base class for all the value-based -type traits. The two typedef's `true_type` and `false_type` are provided for -convenience: most of the value traits are Boolean properties and so will inherit from -one of these. - -[endsect] - -[section:integral_promotion integral_promotion] - - template - struct integral_promotion - { - typedef __below type; - }; - -__type If integral promotion can be applied to an rvalue of type `T`, then -applies integral promotion to `T` and keeps cv-qualifiers of `T`, -otherwise leaves `T` unchanged. - -__std_ref 4.5 except 4.5/3 (integral bit-field). - -__header ` #include ` or ` #include ` - -[table Examples - -[ [Expression] [Result Type]] - -[[`integral_promotion::type`][`int const`]] - -[[`integral_promotion::type`][`short&`]] - -[[`integral_promotion::type`][`int`]] - -] - -[endsect] - -[section:is_abstract is_abstract] - template - struct is_abstract : public __tof {}; - -__inherit If T is a (possibly cv-qualified) abstract type then inherits from -__true_type, otherwise inherits from __false_type. - -__std_ref 10.3. - -__header ` #include ` or ` #include ` - -__compat The compiler must support DR337 (as of April 2005: GCC 3.4, VC++ 7.1 (and later), - Intel C++ 7 (and later), and Comeau 4.3.2). -Otherwise behaves the same as __is_polymorphic; -this is the "safe fallback position" for which polymorphic types are always -regarded as potentially abstract. The macro BOOST_NO_IS_ABSTRACT is used to -signify that the implementation is buggy, users should check for this in their -own code if the "safe fallback" is not suitable for their particular use-case. - -__examples - -[:Given: `class abc{ virtual ~abc() = 0; };` ] - -[:`is_abstract` inherits from `__true_type`.] - -[:`is_abstract::type` is the type `__true_type`.] - -[:`is_abstract::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_abstract::value_type` is the type `bool`.] - -[endsect] - -[section:is_arithmetic is_arithmetic] - template - struct is_arithmetic : public __tof {}; - -__inherit If T is a (possibly cv-qualified) arithmetic type then inherits from -__true_type, otherwise inherits from __false_type. Arithmetic types include -integral and floating point types (see also __is_integral and __is_floating_point). - -__std_ref 3.9.1p8. - -__header ` #include ` or ` #include ` - -__examples - -[:`is_arithmetic` inherits from `__true_type`.] - -[:`is_arithmetic::type` is the type `__true_type`.] - -[:`is_arithmetic::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_arithmetic::value_type` is the type `bool`.] - -[endsect] - -[section:is_array is_array] - template - struct is_array : public __tof {}; - -__inherit If T is a (possibly cv-qualified) array type then inherits from __true_type, -otherwise inherits from __false_type. - -__std_ref 3.9.2 and 8.3.4. - -__header ` #include ` or ` #include ` - -__compat If the compiler does not support -partial-specialization of class templates, then this template -can give the wrong result with function types. - -__examples - -[:`is_array` inherits from `__true_type`.] - -[:`is_array::type` is the type `__true_type`.] - -[:`is_array::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_array::value_type` is the type `bool`.] - -[endsect] - -[section:is_base_of is_base_of] - template - struct is_base_of : public __tof {}; - -__inherit If Base is base class of type Derived or if both types are the same -then inherits from __true_type, -otherwise inherits from __false_type. - -This template will detect non-public base classes, and ambiguous base classes. - -Note that `is_base_of` will always inherit from __true_type. [*This is the -case even if `X` is not a class type]. This is a change in behaviour -from Boost-1.33 in order to track the Technical Report on C++ Library Extensions. - -Types `Base` and `Derived` must not be incomplete types. - -__std_ref 10. - -__header ` #include ` or ` #include ` - -__compat If the compiler does not support partial-specialization of class templates, -then this template can not be used with function types. There are some older compilers -which will produce compiler errors if `Base` is a private base class of `Derived`, or if -`Base` is an ambiguous base of `Derived`. These compilers include Borland C++, older -versions of Sun Forte C++, Digital Mars C++, and older versions of EDG based compilers. - -__examples - -[:Given: ` class Base{}; class Derived : public Base{};` ] - -[:`is_base_of` inherits from `__true_type`.] - -[:`is_base_of::type` is the type `__true_type`.] - -[:`is_base_of::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_base_of::value` is an integral constant -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`.] - -[endsect] - -[section:is_class is_class] - template - struct is_class : public __tof {}; - -__inherit If T is a (possibly cv-qualified) class type then inherits from __true_type, -otherwise inherits from __false_type. - -__std_ref 3.9.2 and 9.2. - -__header ` #include ` or ` #include ` - -__compat Without (some as 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. - -__examples - -[:Given: `class MyClass;` then:] - -[:`is_class` inherits from `__true_type`.] - -[:`is_class::type` is the type `__true_type`.] - -[:`is_class::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_class::value` is an integral constant -expression that evaluates to /false/.] - -[:`is_class::value` is an integral constant -expression that evaluates to /false/.] - -[:`is_class::value_type` is the type `bool`.] - -[endsect] - -[section:is_compound is_compound] - template - struct is_compound : public __tof {}; - -__inherit If T is a (possibly cv-qualified) compound type then inherits from __true_type, -otherwise inherits from __false_type. Any type that is not a fundamental type is -a compound type (see also __is_fundamental). - -__std_ref 3.9.2. - -__header ` #include ` or ` #include ` - -__examples - -[:`is_compound` inherits from `__true_type`.] - -[:`is_compound::type` is the type `__true_type`.] - -[:`is_compound::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_compound::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_compound::value` is an integral constant -expression that evaluates to /false/.] - -[:`is_compound::value_type` is the type `bool`.] - -[endsect] - -[section:is_const is_const] - template - struct is_const : public __tof {}; - -__inherit If T is a (top level) const-qualified type then inherits from __true_type, -otherwise inherits from __false_type. - -__std_ref 3.9.3. - -__header ` #include ` or ` #include ` - -__examples - -[:`is_const` inherits from `__true_type`.] - -[:`is_const::type` is the type `__true_type`.] - -[:`is_const::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_const::value` is an integral constant -expression that evaluates to /false/: the const-qualifier is not -at the top level in this case.] - -[:`is_const::value` is an integral constant -expression that evaluates to /false/: the const-qualifier is not -at the top level in this case.] - -[:`is_const::value` is an integral constant -expression that evaluates to /false/.] - -[:`is_const::value_type` is the type `bool`.] - -[endsect] - -[section:is_convertible is_convertible] - template - struct is_convertible : public __tof {}; - -__inherit If an imaginary lvalue of type `From` is convertible to type `To` then -inherits from __true_type, otherwise inherits from __false_type. - -Type From must not be an incomplete type. - -Type To must not be an incomplete, or function type. - -No types are considered to be convertible to array types or abstract-class types. - -This template can not detect whether a converting-constructor is `public` or not: if -type `To` has a `private` converting constructor from type `From` then instantiating -`is_convertible` will produce a compiler error. For this reason `is_convertible` -can not be used to determine whether a type has a `public` copy-constructor or not. - -This template will also produce compiler errors if the conversion is ambiguous, -for example: - - struct A {}; - struct B : A {}; - struct C : A {}; - struct D : B, C {}; - // This produces a compiler error, the conversion is ambiguous: - bool const y = boost::is_convertible::value; - -__std_ref 4 and 8.5. - -__compat This template is currently broken with Borland C++ Builder 5 (and earlier), -for constructor-based conversions, and for the Metrowerks 7 (and earlier) -compiler in all cases. If the compiler does not support `__is_abstract`, then the -template parameter `To` must not be an abstract type. - -__header ` #include ` or ` #include ` - -__examples - -[:`is_convertible` inherits from `__true_type`.] - -[:`is_convertible::type` is the type `__true_type`.] - -[:`is_convertible::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_convertible::value` is an integral constant -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 -expression that evaluates to /false/.] - -[:`is_convertible::value_type` is the type `bool`.] - -[endsect] - -[section:is_empty is_empty] - template - struct is_empty : public __tof {}; - -__inherit If T is an empty class type then inherits from __true_type, -otherwise inherits from __false_type. - -__std_ref 10p5. - -__header ` #include ` or ` #include ` - -__compat In order to correctly detect empty classes this trait relies on either: - -* the compiler implementing zero sized empty base classes, or -* the compiler providing __intrinsics to detect empty classes. - -Can not be used with incomplete types. - -Can not be used with union types, until is_union can be made to work. - -If the compiler does not support partial-specialization of class templates, -then this template can not be used with abstract types. - -__examples - -[:Given: `struct empty_class {};` ] - -[:`is_empty` inherits from `__true_type`.] - -[:`is_empty::type` is the type `__true_type`.] - -[:`is_empty::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_empty::value_type` is the type `bool`.] - -[endsect] - -[section:is_enum is_enum] - template - struct is_enum : public __tof {}; - -__inherit If T is a (possibly cv-qualified) enum type then inherits from __true_type, -otherwise inherits from __false_type. - -__std_ref 3.9.2 and 7.2. - -__header ` #include ` or ` #include ` - -__compat Requires a correctly functioning __is_convertible template; - this means that is_enum is currently broken under Borland C++ Builder 5, - and for the Metrowerks compiler prior to version 8, other compilers - should handle this template just fine. - -__examples - -[:Given: `enum my_enum { one, two };` ] - -[:`is_enum` inherits from `__true_type`.] - -[:`is_enum::type` is the type `__true_type`.] - -[:`is_enum::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_enum::value` is an integral constant -expression that evaluates to /false/.] - -[:`is_enum::value` is an integral constant -expression that evaluates to /false/.] - -[:`is_enum::value_type` is the type `bool`.] - -[endsect] - -[section:is_floating_point is_floating_point] - template - struct is_floating_point : public __tof {}; - -__inherit If T is a (possibly cv-qualified) floating point type then inherits from __true_type, -otherwise inherits from __false_type. - -__std_ref 3.9.1p8. - -__header ` #include ` or ` #include ` - -__examples - -[:`is_floating_point` inherits from `__true_type`.] - -[:`is_floating_point::type` is the type `__true_type`.] - -[:`is_floating_point::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_floating_point::value_type` is the type `bool`.] - -[endsect] - -[section:is_function is_function] - - template - struct is_function : public __tof {}; - -__inherit If T is a (possibly cv-qualified) function type then inherits from __true_type, -otherwise inherits from __false_type. Note that this template does not detect /pointers -to functions/, or /references to functions/, these are detected by __is_pointer and -__is_reference respectively: - - typedef int f1(); // f1 is of function type. - typedef int (f2*)(); // f2 is a pointer to a function. - typedef int (f3&)(); // f3 is a reference to a function. - -__std_ref 3.9.2p1 and 8.3.5. - -__header ` #include ` or ` #include ` - -__examples - -[:`is_function` inherits from `__true_type`.] - -[:`is_function::type` is the type `__true_type`.] - -[:`is_function::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_function::value` is an integral constant -expression that evaluates to /false/: the argument in this case is a pointer type, -not a function type.] - -[:`is_function::value` is an integral constant -expression that evaluates to /false/: the argument in this case is a -reference to a function, not a function type.] - -[:`is_function::value` is an integral constant -expression that evaluates to /false/: the argument in this case is a pointer -to a member function.] - -[:`is_function::value_type` is the type `bool`.] - -[tip Don't confuse function-types with pointers to functions:\n\n -`typedef int f(double);`\n\n -defines a function type,\n\n -`f foo;`\n\n -declares a prototype for a function of type `f`,\n\n -`f* pf = foo;`\n -`f& fr = foo;`\n\n -declares a pointer and a reference to the function `foo`.\n\n -If you want to detect whether some type is a pointer-to-function then use:\n\n -`__is_function<__remove_pointer::type>::value && __is_pointer::value`\n\n -or for pointers to member functions you can just use __is_member_function_pointer directly.] - -[endsect] - -[section:is_fundamental is_fundamental] - template - struct is_fundamental : public __tof {}; - -__inherit If T is a (possibly cv-qualified) fundamental type then inherits from __true_type, -otherwise inherits from __false_type. Fundamental types include integral, floating -point and void types (see also __is_integral, __is_floating_point and __is_void) - -__std_ref 3.9.1. - -__header ` #include ` or ` #include ` - -__examples - -[:`is_fundamental` inherits from `__true_type`.] - -[:`is_fundamental::type` is the type `__true_type`.] - -[:`is_fundamental::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_fundamental::value_type` is the type `bool`.] - -[endsect] - -[section:is_integral is_integral] - template - struct is_integral : public __tof {}; - -__inherit If T is a (possibly cv-qualified) integral type then inherits from __true_type, -otherwise inherits from __false_type. - -__std_ref 3.9.1p7. - -__header ` #include ` or ` #include ` - -__examples - -[:`is_integral` inherits from `__true_type`.] - -[:`is_integral::type` is the type `__true_type`.] - -[:`is_integral::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_integral::value_type` is the type `bool`.] - -[endsect] - -[section:is_member_function_pointer is_member_function_pointer] - template - struct is_member_function_pointer : public __tof {}; - -__inherit If T is a (possibly cv-qualified) pointer to a member function -then inherits from __true_type, -otherwise inherits from __false_type. - -__std_ref 3.9.2 and 8.3.3. - -__header ` #include ` or ` #include ` - -__examples - -[:`is_member_function_pointer` inherits from `__true_type`.] - -[:`is_member_function_pointer::type` is the type `__true_type`.] - -[:`is_member_function_pointer::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_member_function_pointer::value` is an integral constant -expression that evaluates to /false/: the argument in this case is a pointer to -a data member and not a member function, see __is_member_object_pointer -and __is_member_pointer] - -[:`is_member_function_pointer::value_type` is the type `bool`.] - -[endsect] - -[section:is_member_object_pointer is_member_object_pointer] - template - struct is_member_object_pointer : public __tof {}; - -__inherit If T is a (possibly cv-qualified) pointer to a member object (a data member) -then inherits from __true_type, -otherwise inherits from __false_type. - -__std_ref 3.9.2 and 8.3.3. - -__header ` #include ` or ` #include ` - -__examples - -[:`is_member_object_pointer` inherits from `__true_type`.] - -[:`is_member_object_pointer::type` is the type `__true_type`.] - -[:`is_member_object_pointer::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_member_object_pointer::value` is an integral constant -expression that evaluates to /false/: the argument in this case is a pointer to -a member function and not a member object, see __is_member_function_pointer -and __is_member_pointer] - -[:`is_member_object_pointer::value_type` is the type `bool`.] - -[endsect] - -[section:is_member_pointer is_member_pointer] - template - struct is_member_pointer : public __tof {}; - -__inherit If T is a (possibly cv-qualified) pointer to a member (either a function -or a data member) -then inherits from __true_type, -otherwise inherits from __false_type. - -__std_ref 3.9.2 and 8.3.3. - -__header ` #include ` or ` #include ` - -__examples - -[:`is_member_pointer` inherits from `__true_type`.] - -[:`is_member_pointer::type` is the type `__true_type`.] - -[:`is_member_pointer::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_member_pointer::value_type` is the type `bool`.] - -[endsect] - -[section:is_object is_object] - template - struct is_object : public __tof {}; - -__inherit If T is a (possibly cv-qualified) object type -then inherits from __true_type, -otherwise inherits from __false_type. All types are object types except -references, void, and function types. - -__std_ref 3.9p9. - -__header ` #include ` or ` #include ` - -__examples - -[:`is_object` inherits from `__true_type`.] - -[:`is_object::type` is the type `__true_type`.] - -[:`is_object::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_object::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_object::value` is an integral constant -expression that evaluates to /false/: reference types are not objects] - -[:`is_object::value` is an integral constant -expression that evaluates to /false/: function types are not objects] - -[:`is_object::value` is an integral constant -expression that evaluates to /false/: void is not an object type] - -[:`is_object::value_type` is the type `bool`.] - -[endsect] - -[section:is_pod is_pod] - template - struct is_pod : public __tof {}; - -__inherit If T is a (possibly cv-qualified) POD type then inherits from __true_type, -otherwise inherits from __false_type. - -POD stands for "Plain old data". -Arithmetic types, and enumeration types, -a pointers and pointer to members are all PODs. Classes and unions can also -be POD's if they have no non-static data members that are of reference or -non-POD type, no user defined constructors, no user defined assignment -operators, no private or protected non-static data members, -no virtual functions and no base classes. Finally, a cv-qualified POD is -still a POD, as is an array of PODs. - -__std_ref 3.9p10 and 9p4 (Note that POD's are also aggregates, see 8.5.1). - -__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, is_pod 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. - -__header ` #include ` or ` #include ` - -__examples - -[:`is_pod` inherits from `__true_type`.] - -[:`is_pod::type` is the type `__true_type`.] - -[:`is_pod::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_pod::value` is an integral constant -expression that evaluates to /false/.] - -[:`is_pod::value_type` is the type `bool`.] - -[endsect] - -[section:is_pointer is_pointer] - template - struct is_pointer : public __tof {}; - -__inherit If T is a (possibly cv-qualified) pointer type (includes function pointers, -but excludes pointers to members) then inherits from __true_type, -otherwise inherits from __false_type. - -__std_ref 3.9.2p2 and 8.3.1. - -__header ` #include ` or ` #include ` - -__examples - -[:`is_pointer` inherits from `__true_type`.] - -[:`is_pointer::type` is the type `__true_type`.] - -[:`is_pointer::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_pointer::value` is an integral constant -expression that evaluates to /false/.] - -[:`is_pointer::value` is an integral constant -expression that evaluates to /false/.] - -[:`is_pointer::value_type` is the type `bool`.] - -[important `is_pointer` detects "real" pointer types only, and /not/ smart pointers. -Users should not specialise `is_pointer` for smart pointer types, as doing so may cause -Boost (and other third party) code to fail to function correctly. -Users wanting a trait to detect smart pointers should create their own. -However, note that there is no way in general to auto-magically detect smart pointer types, -so such a trait would have to be partially specialised for each supported smart pointer type.] - -[endsect] - -[section:is_polymorphic is_polymorphic] - template - struct is_polymorphic : public __tof {}; - -__inherit If T is a (possibly cv-qualified) polymorphic type -then inherits from __true_type, -otherwise inherits from __false_type. Type `T` must be a complete type. - -__std_ref 10.3. - -__compat The implementation requires some knowledge of the compilers ABI, -it does actually seem to work with the majority of compilers though. - -__header ` #include ` or ` #include ` - -__examples - -[: Given: `class poly{ virtual ~poly(); };` ] - -[:`is_polymorphic` inherits from `__true_type`.] - -[:`is_polymorphic::type` is the type `__true_type`.] - -[:`is_polymorphic::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_polymorphic::value_type` is the type `bool`.] - -[endsect] - -[section:is_same is_same] - template - struct is_same : public __tof {}; - -__inherit If T and U are the same types then inherits from -__true_type, otherwise inherits from __false_type. - -__header ` #include ` or ` #include ` - -__compat If the compiler does not support partial-specialization of class templates, -then this template can not be used with abstract, incomplete or function types. - -__examples - -[:`is_same` inherits from `__true_type`.] - -[:`is_same::type` is the type `__true_type`.] - -[:`is_same::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_same::value` is an integral constant -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`.] - -[endsect] - -[section:is_scalar is_scalar] - template - struct is_scalar : public __tof {}; - -__inherit If T is a (possibly cv-qualified) scalar type then inherits from -__true_type, otherwise inherits from __false_type. Scalar types include -integral, floating point, enumeration, pointer, and pointer-to-member types. - -__std_ref 3.9p10. - -__header ` #include ` or ` #include ` - -__compat If the compiler does not support partial-specialization of class templates, -then this template can not be used with function types. - -__examples - -[:`is_scalar` inherits from `__true_type`.] - -[:`is_scalar::type` is the type `__true_type`.] - -[:`is_scalar::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_scalar::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_scalar::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_scalar::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_scalar::value_type` is the type `bool`.] - -[endsect] - -[section:is_stateless is_stateless] - template - struct is_stateless : public __tof {}; - -__inherit Ff T is a stateless type then inherits from __true_type, otherwise -from __false_type. - -Type T must be a complete type. - -A stateless type is a type that has no storage and whose constructors and -destructors are trivial. That means that `is_stateless` only inherits from -__true_type if the following expression is `true`: - - ::boost::has_trivial_constructor::value - && ::boost::has_trivial_copy::value - && ::boost::has_trivial_destructor::value - && ::boost::is_class::value - && ::boost::is_empty::value - -__std_ref 3.9p10. - -__header ` #include ` or ` #include ` - -__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, 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. - -[endsect] - -[section:is_reference is_reference] - template - struct is_reference : public __tof {}; - -__inherit If T is a reference pointer type then inherits from __true_type, -otherwise inherits from __false_type. - -__std_ref 3.9.2 and 8.3.2. - -__compat If the compiler does not -support partial-specialization of class templates, -then this template may report the wrong result for function types, -and for types that are both const and volatile qualified. - -__header ` #include ` or ` #include ` - -__examples - -[:`is_reference` inherits from `__true_type`.] - -[:`is_reference::type` is the type `__true_type`.] - -[:`is_reference::value` is an integral constant -expression that evaluates to /true/ (the argument in this case is -a reference to a function).] - -[:`is_reference::value_type` is the type `bool`.] - -[endsect] - -[section:is_union is_union] - template - struct is_union : public __tof {}; - -__inherit If T is a (possibly cv-qualified) union type then inherits from __true_type, -otherwise inherits from __false_type. Currently requires some kind of compiler -support, otherwise unions are identified as classes. - -__std_ref 3.9.2 and 9.5. - -__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. - -__header ` #include ` or ` #include ` - -__examples - -[:`is_union` inherits from `__true_type`.] - -[:`is_union::type` is the type `__true_type`.] - -[:`is_union::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_union::value` is an integral constant -expression that evaluates to /false/.] - -[:`is_union::value_type` is the type `bool`.] - -[endsect] - -[section:is_void is_void] - template - struct is_void : public __tof {}; - -__inherit If T is a (possibly cv-qualified) void type then inherits from __true_type, -otherwise inherits from __false_type. - -__std_ref 3.9.1p9. - -__header ` #include ` or ` #include ` - -__examples - -[:`is_void` inherits from `__true_type`.] - -[:`is_void::type` is the type `__true_type`.] - -[:`is_void::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_void::value` is an integral constant -expression that evaluates to /false/.] - -[:`is_void::value_type` is the type `bool`.] - -[endsect] - -[section:is_volatile is_volatile] - template - struct is_volatile : public __tof {}; - -__inherit If T is a (top level) volatile-qualified type then inherits from __true_type, -otherwise inherits from __false_type. - -__std_ref 3.9.3. - -__header ` #include ` or ` #include ` - -__examples - -[:`is_volatile` inherits from `__true_type`.] - -[:`is_volatile::type` is the type `__true_type`.] - -[:`is_volatile::value` is an integral constant -expression that evaluates to /true/.] - -[:`is_volatile::value` is an integral constant -expression that evaluates to /false/: the volatile qualifier is not -at the top level in this case.] - -[:`is_volatile::value_type` is the type `bool`.] - -[endsect] - -[section:promote promote] - - template - struct promote - { - typedef __below type; - }; - -__type If integral or floating point promotion can be applied to an rvalue -of type `T`, then applies integral and floating point promotions to `T` and -keeps cv-qualifiers of `T`, otherwise leaves `T` unchanged. See also -__integral_promotion and __floating_point_promotion. - -__std_ref 4.5 except 4.5/3 (integral bit-field) and 4.6. - -__header ` #include ` or ` #include ` - -[table Examples - -[ [Expression] [Result Type]] - -[[`promote::type`][`int volatile`]] - -[[`promote::type`][`double const`]] - -[[`promote::type`][`short&`]] - -] - -[endsect] - -[section:rank rank] - template - struct rank : public __integral_constant {}; - -__inherit Class template rank inherits from `__integral_constant`, -where `RANK(T)` is the number of array dimensions in type `T`. - -If `T` is not an array type, then `RANK(T)` is zero. - -__header ` #include ` or ` #include ` - -__examples - -[:`rank` inherits from `__integral_constant`.] - -[:`rank::type` is the type `__integral_constant`.] - -[:`rank::value` is an integral constant -expression that evaluates to /1/.] - -[:`rank::value` is an integral constant -expression that evaluates to /2/.] - -[:`rank::value` is an integral constant -expression that evaluates to /0/.] - -[:`rank::value_type` is the type `std::size_t`.] - -[endsect] - -[section:remove_all_extents remove_all_extents] - - template - struct remove_all_extents - { - typedef __below type; - }; - -__type If `T` is an array type, then removes all of the array bounds on `T`, otherwise -leaves `T` unchanged. - -__std_ref 8.3.4. - -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. - -__header ` #include ` or ` #include ` - -[table Examples - -[ [Expression] [Result Type]] - -[[`remove_all_extents::type`][`int`]] - -[[`remove_all_extents::type`] [`int const`]] - -[[`remove_all_extents::type`] [`int`]] - -[[`remove_all_extents::type`] [`int`]] - -[[`remove_all_extents::type`] [`int const*`]] - -] - -[endsect] - -[section:remove_const remove_const] - - template - struct remove_const - { - typedef __below type; - }; - -__type The same type as `T`, but with any /top level/ const-qualifier removed. - -__std_ref 3.9.3. - -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. - -__header ` #include ` or ` #include ` - -[table Examples - -[ [Expression] [Result Type]] - -[[`remove_const::type`][`int`]] - -[[`remove_const::type`] [`int`]] - -[[`remove_const::type`] [`int volatile`]] - -[[`remove_const::type`] [`int const&`]] - -[[`remove_const::type`] [`int const*`]] - -] - -[endsect] - -[section:remove_cv remove_cv] - - template - struct remove_cv - { - typedef __below type; - }; - -__type The same type as `T`, but with any /top level/ cv-qualifiers removed. - -__std_ref 3.9.3. - -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. - -__header ` #include ` or ` #include ` - -[table Examples - -[ [Expression] [Result Type]] - -[[`remove_cv::type`][`int`]] - -[[`remove_cv::type`] [`int`]] - -[[`remove_cv::type`] [`int`]] - -[[`remove_cv::type`] [`int const&`]] - -[[`remove_cv::type`] [`int const*`]] - -] - -[endsect] - -[section:remove_extent remove_extent] - - template - struct remove_extent - { - typedef __below type; - }; - -__type If `T` is an array type, then removes the topmost array bound, -otherwise leaves `T` unchanged. - -__std_ref 8.3.4. - -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. - -__header ` #include ` or ` #include ` - -[table Examples - -[ [Expression] [Result Type]] - -[[`remove_extent::type`][`int`]] - -[[`remove_extent::type`] [`int const`]] - -[[`remove_extent::type`] [`int[4]`]] - -[[`remove_extent::type`] [`int[2]`]] - -[[`remove_extent::type`] [`int const*`]] - -] - -[endsect] - -[section:remove_pointer remove_pointer] - - template - struct remove_pointer - { - typedef __below type; - }; - -__type The same type as `T`, but with any pointer modifier removed. - -__std_ref 8.3.1. - -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. - -__header ` #include ` or ` #include ` - -[table Examples - -[ [Expression] [Result Type]] - -[[`remove_pointer::type`][`int`]] - -[[`remove_pointer::type`] [`int const`]] - -[[`remove_pointer::type`] [`int const*`]] - -[[`remove_pointer::type`] [`int&`]] - -[[`remove_pointer::type`] [`int*&`]] - -] - -[endsect] - -[section:remove_reference remove_reference] - - template - struct remove_reference - { - typedef __below type; - }; - -__type The same type as `T`, but with any reference modifier removed. - -__std_ref 8.3.2. - -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. - -__header ` #include ` or ` #include ` - -[table Examples - -[ [Expression] [Result Type]] - -[[`remove_reference::type`][`int`]] - -[[`remove_reference::type`] [`int const`]] - -[[`remove_reference::type`] [`int*`]] - -[[`remove_reference::type`] [`int*`]] - -] - -[endsect] - -[section:remove_volatile remove_volatile] - - template - struct remove_volatile - { - typedef __below type; - }; - -__type The same type as `T`, but with any /top level/ volatile-qualifier removed. - -__std_ref 3.9.3. - -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. - -__header ` #include ` or ` #include ` - -[table Examples - -[ [Expression] [Result Type]] - -[[`remove_volatile::type`][`int`]] - -[[`remove_volatile::type`] [`int`]] - -[[`remove_volatile::type`] [`int const`]] - -[[`remove_volatile::type`] [`int const&`]] - -[[`remove_volatile::type`] [`int const*`]] - -] - -[endsect] - -[section:type_with_alignment type_with_alignment] - - template - struct type_with_alignment - { - typedef __below type; - }; - -__type a built-in or POD type with an alignment -that is a multiple of `Align`. - -__header ` #include ` or ` #include ` - -[endsect] - -[endsect] - -[section:credits Credits] - -This documentation was pulled together by John Maddock, using -[@../../tools/quickbook/doc/html/index.html Boost.Quickbook] -and [@boostbook.html Boost.DocBook]. - -The original version of this library was created by Steve Cleary, -Beman Dawes, Howard Hinnant, and John Maddock. John Maddock is the -current maintainer of the library. - -This version of type traits library is based on contributions by -Adobe Systems Inc, David Abrahams, Steve Cleary, -Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat Marcus, -Itay Maman, John Maddock, Thorsten Ottosen, Robert Ramey and Jeremy Siek. - -Mat Marcus and Jesse Jones invented, and -[@http://opensource.adobe.com/project4/project.shtml published a paper describing], -the partial specialization workarounds used in this library. - -Aleksey Gurtovoy added MPL integration to the library. - -The __is_convertible template is based on code originally devised by -Andrei Alexandrescu, see -"[@http://www.cuj.com/experts/1810/alexandr.htm?topic=experts -Generic: Mappings between Types and Values]". - -The latest version of this library and documentation can be found at -[@http://www.boost.org www.boost.org]. Bugs, suggestions and discussion -should be directed to boost@lists.boost.org -(see [@http://www.boost.org/more/mailing_lists.htm#main -www.boost.org/more/mailing_lists.htm#main] for subscription details). +[include remove_all_extents.qbk] +[include remove_const.qbk] +[include remove_cv.qbk] +[include remove_extent.qbk] +[include remove_pointer.qbk] +[include remove_reference.qbk] +[include remove_volatile.qbk] +[include type_with_alignment.qbk] [endsect] +[include credits.qbk] diff --git a/doc/type_with_alignment.qbk b/doc/type_with_alignment.qbk new file mode 100644 index 0000000..565a7de --- /dev/null +++ b/doc/type_with_alignment.qbk @@ -0,0 +1,14 @@ +[section:type_with_alignment type_with_alignment] + + template + struct type_with_alignment + { + typedef __below type; + }; + +__type a built-in or POD type with an alignment +that is a multiple of `Align`. + +__header ` #include ` or ` #include ` + +[endsect] diff --git a/doc/user_defined.qbk b/doc/user_defined.qbk new file mode 100644 index 0000000..020f06b --- /dev/null +++ b/doc/user_defined.qbk @@ -0,0 +1,35 @@ +[section:user_defined User Defined Specializations] + +Occationally the end user may need to provide their own specialization +for one of the type traits - typically where intrinsic compiler support +is required to implement a specific trait fully. +These specializations should derive from boost::__true_type or boost::__false_type +as appropriate: + + #include + #include + #include + + struct my_pod{}; + struct my_union + { + char c; + int i; + }; + + namespace boost + { + template<> + struct __is_pod : public __true_type{}; + + template<> + struct __is_pod : public __true_type{}; + + template<> + struct __is_union : public __true_type{}; + + template<> + struct __is_class : public __false_type{}; + } + +[endsect] diff --git a/doc/value_traits.qbk b/doc/value_traits.qbk new file mode 100644 index 0000000..a8bc197 --- /dev/null +++ b/doc/value_traits.qbk @@ -0,0 +1,187 @@ +[section:value_traits Type Traits that Describe the Properties of a Type] + +These traits are all /value traits/, which is to say the traits classes all +inherit from __integral_constant, and are used to access some numerical +property of a type. Often this is a simple true or false Boolean value, +but in a few cases may be some other integer value (for example when dealing +with type alignments, or array bounds: see `__alignment_of`, `__rank` and `__extent`). + +[section:primary Categorizing a Type] + +These traits identify what "kind" of type some type `T` is. These are split into +two groups: primary traits which are all mutually exclusive, and composite traits +that are compositions of one or more primary traits. + +For any given type, exactly one primary type trait will inherit from +__true_type, and all the others will inherit from __false_type, in other +words these traits are mutually exclusive. + +This means that `__is_integral::value` and `__is_floating_point::value` +will only ever be true for built-in types; if you want to check for a +user-defined class type that behaves "as if" it is an integral or floating point type, +then use the `std::numeric_limits template` instead. + +[*Synopsis:] + + template + struct __is_array; + + template + struct __is_class; + + template + struct __is_complex; + + template + struct __is_enum; + + template + struct __is_floating_point; + + template + struct __is_function; + + template + struct __is_integral; + + template + struct __is_member_function_pointer; + + template + struct __is_member_object_pointer; + + template + struct __is_pointer; + + template + struct __is_reference; + + template + struct __is_union; + + template + struct __is_void; + +The following traits are made up of the union of one or more type +categorizations. A type may belong to more than one of these categories, +in addition to one of the primary categories. + + template + struct __is_arithmetic; + + template + struct __is_compound; + + template + struct __is_fundamental; + + template + struct __is_member_pointer; + + template + struct __is_object; + + template + struct __is_scalar; + +[endsect] + +[section:properties General Type Properties] + +The following templates describe the general properties of a type. + +[*Synopsis:] + + template + struct __alignment_of; + + template + struct __has_nothrow_assign; + + template + struct __has_nothrow_constructor; + + template + struct __has_nothrow_default_constructor; + + template + struct __has_nothrow_copy; + + template + struct __has_nothrow_copy_constructor; + + template + struct __has_trivial_assign; + + template + struct __has_trivial_constructor; + + template + struct __has_trivial_default_constructor; + + template + struct __has_trivial_copy; + + template + struct __has_trivial_copy_constructor; + + template + struct __has_trivial_destructor; + + template + struct __has_virtual_destructor; + + template + struct __is_abstract; + + template + struct __is_const; + + template + struct __is_empty; + + template + struct __is_stateless; + + template + struct __is_pod; + + template + struct __is_polymorphic; + + template + struct __is_signed; + + template + struct __is_unsigned; + + template + struct __is_volatile; + + template + struct __extent; + + template + struct __rank; + +[endsect] + +[section:relate Relationships Between Two Types] + +These templates determine the whether there is a relationship +between two types: + +[*Synopsis:] + + template + struct __is_base_of; + + template + struct __is_convertible; + + template + struct __is_same; + +[endsect] + +[endsect] \ No newline at end of file diff --git a/include/boost/type_traits.hpp b/include/boost/type_traits.hpp index afba2ea..0c313b8 100644 --- a/include/boost/type_traits.hpp +++ b/include/boost/type_traits.hpp @@ -75,6 +75,10 @@ #include "boost/type_traits/integral_promotion.hpp" #include "boost/type_traits/promote.hpp" #endif +#include +#include +#include +#include #include "boost/type_traits/ice.hpp" diff --git a/include/boost/type_traits/has_nothrow_constructor.hpp b/include/boost/type_traits/has_nothrow_constructor.hpp index 4f2cb36..e807fd4 100644 --- a/include/boost/type_traits/has_nothrow_constructor.hpp +++ b/include/boost/type_traits/has_nothrow_constructor.hpp @@ -30,6 +30,7 @@ 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) } // namespace boost diff --git a/include/boost/type_traits/has_nothrow_copy.hpp b/include/boost/type_traits/has_nothrow_copy.hpp index 6a66c8b..c06b4a3 100644 --- a/include/boost/type_traits/has_nothrow_copy.hpp +++ b/include/boost/type_traits/has_nothrow_copy.hpp @@ -30,6 +30,7 @@ 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) } // namespace boost diff --git a/include/boost/type_traits/has_trivial_constructor.hpp b/include/boost/type_traits/has_trivial_constructor.hpp index 5f9616d..f9ade5d 100644 --- a/include/boost/type_traits/has_trivial_constructor.hpp +++ b/include/boost/type_traits/has_trivial_constructor.hpp @@ -34,6 +34,7 @@ struct has_trivial_ctor_impl } // namespace detail BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_constructor,T,::boost::detail::has_trivial_ctor_impl::value) +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_default_constructor,T,::boost::detail::has_trivial_ctor_impl::value) } // namespace boost diff --git a/include/boost/type_traits/has_trivial_copy.hpp b/include/boost/type_traits/has_trivial_copy.hpp index 96b2148..8c75361 100644 --- a/include/boost/type_traits/has_trivial_copy.hpp +++ b/include/boost/type_traits/has_trivial_copy.hpp @@ -40,6 +40,7 @@ struct has_trivial_copy_impl } // namespace detail 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) } // namespace boost diff --git a/include/boost/type_traits/is_complex.hpp b/include/boost/type_traits/is_complex.hpp new file mode 100644 index 0000000..9ccc333 --- /dev/null +++ b/include/boost/type_traits/is_complex.hpp @@ -0,0 +1,34 @@ +// (C) Copyright John Maddock 2007. +// 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). +// +// See http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_IS_COMPLEX_HPP +#define BOOST_TT_IS_COMPLEX_HPP + +#include +#include +// should be the last #include +#include + + +namespace boost { +namespace detail{ + +struct is_convertible_from_tester +{ + template + is_convertible_from_tester(const std::complex&); +}; + +} + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_complex,T,(::boost::is_convertible::value)) + +} // namespace boost + +#include + +#endif //BOOST_TT_IS_COMPLEX_HPP diff --git a/include/boost/type_traits/is_signed.hpp b/include/boost/type_traits/is_signed.hpp index 9c780b5..1360b11 100755 --- a/include/boost/type_traits/is_signed.hpp +++ b/include/boost/type_traits/is_signed.hpp @@ -11,6 +11,7 @@ #define BOOST_TT_IS_SIGNED_HPP_INCLUDED #include +#include #include #include @@ -26,7 +27,8 @@ namespace detail{ template struct is_signed_helper { - BOOST_STATIC_CONSTANT(bool, value = (static_cast(-1) < 0)); + typedef typename remove_cv::type no_cv_t; + BOOST_STATIC_CONSTANT(bool, value = (static_cast(-1) < 0)); }; template diff --git a/include/boost/type_traits/is_unsigned.hpp b/include/boost/type_traits/is_unsigned.hpp index 7a9f891..67cedc1 100755 --- a/include/boost/type_traits/is_unsigned.hpp +++ b/include/boost/type_traits/is_unsigned.hpp @@ -12,6 +12,7 @@ #include #include +#include #include // should be the last #include @@ -26,7 +27,8 @@ namespace detail{ template struct is_ununsigned_helper { - BOOST_STATIC_CONSTANT(bool, value = (static_cast(-1) > 0)); + typedef typename remove_cv::type no_cv_t; + BOOST_STATIC_CONSTANT(bool, value = (static_cast(-1) > 0)); }; template diff --git a/include/boost/type_traits/make_signed.hpp b/include/boost/type_traits/make_signed.hpp new file mode 100644 index 0000000..aefd7f3 --- /dev/null +++ b/include/boost/type_traits/make_signed.hpp @@ -0,0 +1,136 @@ + +// (C) John Maddock 2007. +// 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). +// +// See http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_MAKE_SIGNED_HPP_INCLUDED +#define BOOST_TT_MAKE_SIGNED_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// should be the last #include +#include + +namespace boost { + +namespace detail { + +template +struct make_signed_imp +{ + BOOST_STATIC_ASSERT( + (::boost::type_traits::ice_or< ::boost::is_integral::value, ::boost::is_enum::value>::value)); +#if !BOOST_WORKAROUND(BOOST_MSVC, <=1300) + BOOST_STATIC_ASSERT( + (::boost::type_traits::ice_not< ::boost::is_same< + typename remove_cv::type, bool>::value>::value)); +#endif + + typedef typename remove_cv::type t_no_cv; + typedef typename mpl::if_c< + (::boost::type_traits::ice_and< + ::boost::is_signed::value, + ::boost::is_integral::value, + ::boost::type_traits::ice_not< ::boost::is_same::value>::value, + ::boost::type_traits::ice_not< ::boost::is_same::value>::value, + ::boost::type_traits::ice_not< ::boost::is_same::value>::value >::value), + T, + typename mpl::if_c< + (::boost::type_traits::ice_and< + ::boost::is_integral::value, + ::boost::type_traits::ice_not< ::boost::is_same::value>::value, + ::boost::type_traits::ice_not< ::boost::is_same::value>::value, + ::boost::type_traits::ice_not< ::boost::is_same::value>::value> + ::value), + typename mpl::if_< + is_same, + signed char, + typename mpl::if_< + is_same, + signed short, + typename mpl::if_< + is_same, + int, + typename mpl::if_< + is_same, + long, +#if defined(BOOST_HAS_LONG_LONG) + long long +#elif defined(BOOST_HAS_MS_INT64) + __int64 +#else + long +#endif + >::type + >::type + >::type + >::type, + // Not a regular integer type: + typename mpl::if_c< + sizeof(t_no_cv) == sizeof(unsigned char), + signed char, + typename mpl::if_c< + sizeof(t_no_cv) == sizeof(unsigned short), + signed short, + typename mpl::if_c< + sizeof(t_no_cv) == sizeof(unsigned int), + int, + typename mpl::if_c< + sizeof(t_no_cv) == sizeof(unsigned long), + long, +#if defined(BOOST_HAS_LONG_LONG) + long long +#elif defined(BOOST_HAS_MS_INT64) + __int64 +#else + long +#endif + >::type + >::type + >::type + >::type + >::type + >::type base_integer_type; + + // Add back any const qualifier: + typedef typename mpl::if_< + is_const, + typename add_const::type, + base_integer_type + >::type const_base_integer_type; + + // Add back any volatile qualifier: + typedef typename mpl::if_< + is_volatile, + typename add_volatile::type, + const_base_integer_type + >::type type; +}; + + +} // namespace detail + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(make_signed,T,typename boost::detail::make_signed_imp::type) + +} // namespace boost + +#include + +#endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED diff --git a/include/boost/type_traits/make_unsigned.hpp b/include/boost/type_traits/make_unsigned.hpp new file mode 100644 index 0000000..cd04b67 --- /dev/null +++ b/include/boost/type_traits/make_unsigned.hpp @@ -0,0 +1,136 @@ + +// (C) John Maddock 2007. +// 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). +// +// See http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_MAKE_UNSIGNED_HPP_INCLUDED +#define BOOST_TT_MAKE_UNSIGNED_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// should be the last #include +#include + +namespace boost { + +namespace detail { + +template +struct make_unsigned_imp +{ + BOOST_STATIC_ASSERT( + (::boost::type_traits::ice_or< ::boost::is_integral::value, ::boost::is_enum::value>::value)); +#if !BOOST_WORKAROUND(BOOST_MSVC, <=1300) + BOOST_STATIC_ASSERT( + (::boost::type_traits::ice_not< ::boost::is_same< + typename remove_cv::type, bool>::value>::value)); +#endif + + typedef typename remove_cv::type t_no_cv; + typedef typename mpl::if_c< + (::boost::type_traits::ice_and< + ::boost::is_unsigned::value, + ::boost::is_integral::value, + ::boost::type_traits::ice_not< ::boost::is_same::value>::value, + ::boost::type_traits::ice_not< ::boost::is_same::value>::value, + ::boost::type_traits::ice_not< ::boost::is_same::value>::value >::value), + T, + typename mpl::if_c< + (::boost::type_traits::ice_and< + ::boost::is_integral::value, + ::boost::type_traits::ice_not< ::boost::is_same::value>::value, + ::boost::type_traits::ice_not< ::boost::is_same::value>::value, + ::boost::type_traits::ice_not< ::boost::is_same::value>::value> + ::value), + typename mpl::if_< + is_same, + unsigned char, + typename mpl::if_< + is_same, + unsigned short, + typename mpl::if_< + is_same, + unsigned int, + typename mpl::if_< + is_same, + unsigned long, +#if defined(BOOST_HAS_LONG_LONG) + unsigned long long +#elif defined(BOOST_HAS_MS_INT64) + unsigned __int64 +#else + unsigned long +#endif + >::type + >::type + >::type + >::type, + // Not a regular integer type: + typename mpl::if_c< + sizeof(t_no_cv) == sizeof(unsigned char), + unsigned char, + typename mpl::if_c< + sizeof(t_no_cv) == sizeof(unsigned short), + unsigned short, + typename mpl::if_c< + sizeof(t_no_cv) == sizeof(unsigned int), + unsigned int, + typename mpl::if_c< + sizeof(t_no_cv) == sizeof(unsigned long), + unsigned long, +#if defined(BOOST_HAS_LONG_LONG) + unsigned long long +#elif defined(BOOST_HAS_MS_INT64) + unsigned __int64 +#else + unsigned long +#endif + >::type + >::type + >::type + >::type + >::type + >::type base_integer_type; + + // Add back any const qualifier: + typedef typename mpl::if_< + is_const, + typename add_const::type, + base_integer_type + >::type const_base_integer_type; + + // Add back any volatile qualifier: + typedef typename mpl::if_< + is_volatile, + typename add_volatile::type, + const_base_integer_type + >::type type; +}; + + +} // namespace detail + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(make_unsigned,T,typename boost::detail::make_unsigned_imp::type) + +} // namespace boost + +#include + +#endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED diff --git a/index.html b/index.html index def0f22..0307420 100644 --- a/index.html +++ b/index.html @@ -1,13 +1,11 @@ - + - Automatic redirection failed, please go to - ../../doc/html/boost_typetraits.html - or view the online version at - http://www.boost.org/regression-logs/cs-win32_metacomm/doc/html/boost_typetraits.html +

Automatic redirection failed, please go to + doc/html/index.html.

Copyright John Maddock 2001

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

@@ -17,3 +15,5 @@ + + diff --git a/test/is_complex_test.cpp b/test/is_complex_test.cpp new file mode 100644 index 0000000..f47c641 --- /dev/null +++ b/test/is_complex_test.cpp @@ -0,0 +1,45 @@ + +// (C) Copyright John Maddock 2007. +// 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 +#else +# include +#endif +#include + +struct bad_struct +{ + operator std::complex ()const; +}; + +struct derived_complex : public std::complex +{ +}; + +TT_TEST_BEGIN(is_complex) + + BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex::value, false); + BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex::value, false); + BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex::value, false); + BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex::value, false); + //BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex::value, false); + BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex >::value, true); + BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex >::value, true); + BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex >::value, true); + +TT_TEST_END + + + + + + + + + diff --git a/test/make_signed_test.cpp b/test/make_signed_test.cpp new file mode 100644 index 0000000..b76852f --- /dev/null +++ b/test/make_signed_test.cpp @@ -0,0 +1,107 @@ + +// (C) Copyright John Maddock 2007. +// 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.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +TT_TEST_BEGIN(make_signed) +// signed types: +BOOST_CHECK_TYPE(::tt::make_signed::type, signed char); +BOOST_CHECK_TYPE(::tt::make_signed::type, short); +BOOST_CHECK_TYPE(::tt::make_signed::type, int); +BOOST_CHECK_TYPE(::tt::make_signed::type, long); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK_TYPE(::tt::make_signed::type, long long); +#elif defined(BOOST_HAS_MS_INT64) +BOOST_CHECK_TYPE(::tt::make_signed<__int64>::type, __int64); +#endif +// const signed types: +BOOST_CHECK_TYPE(::tt::make_signed::type, const signed char); +BOOST_CHECK_TYPE(::tt::make_signed::type, const short); +BOOST_CHECK_TYPE(::tt::make_signed::type, const int); +BOOST_CHECK_TYPE(::tt::make_signed::type, const long); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK_TYPE(::tt::make_signed::type, const long long); +#elif defined(BOOST_HAS_MS_INT64) +BOOST_CHECK_TYPE(::tt::make_signed::type, const __int64); +#endif +// volatile signed types: +BOOST_CHECK_TYPE(::tt::make_signed::type, volatile signed char); +BOOST_CHECK_TYPE(::tt::make_signed::type, volatile short); +BOOST_CHECK_TYPE(::tt::make_signed::type, volatile int); +BOOST_CHECK_TYPE(::tt::make_signed::type, volatile long); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK_TYPE(::tt::make_signed::type, volatile long long); +#elif defined(BOOST_HAS_MS_INT64) +BOOST_CHECK_TYPE(::tt::make_signed::type, volatile __int64); +#endif +// const volatile signed types: +BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile signed char); +BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile short); +BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile int); +BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile long); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile long long); +#elif defined(BOOST_HAS_MS_INT64) +BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile __int64); +#endif + +// unsigned types: +BOOST_CHECK_TYPE(::tt::make_signed::type, signed char); +BOOST_CHECK_TYPE(::tt::make_signed::type, short); +BOOST_CHECK_TYPE(::tt::make_signed::type, int); +BOOST_CHECK_TYPE(::tt::make_signed::type, long); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK_TYPE(::tt::make_signed::type, long long); +#elif defined(BOOST_HAS_MS_INT64) +BOOST_CHECK_TYPE(::tt::make_signed::type, __int64); +#endif +// const unsigned types: +BOOST_CHECK_TYPE(::tt::make_signed::type, const signed char); +BOOST_CHECK_TYPE(::tt::make_signed::type, const short); +BOOST_CHECK_TYPE(::tt::make_signed::type, const int); +BOOST_CHECK_TYPE(::tt::make_signed::type, const long); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK_TYPE(::tt::make_signed::type, const long long); +#elif defined(BOOST_HAS_MS_INT64) +BOOST_CHECK_TYPE(::tt::make_signed::type, const __int64); +#endif +// volatile unsigned types: +BOOST_CHECK_TYPE(::tt::make_signed::type, volatile signed char); +BOOST_CHECK_TYPE(::tt::make_signed::type, volatile short); +BOOST_CHECK_TYPE(::tt::make_signed::type, volatile int); +BOOST_CHECK_TYPE(::tt::make_signed::type, volatile long); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK_TYPE(::tt::make_signed::type, volatile long long); +#elif defined(BOOST_HAS_MS_INT64) +BOOST_CHECK_TYPE(::tt::make_signed::type, volatile __int64); +#endif +// const volatile unsigned types: +BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile signed char); +BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile short); +BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile int); +BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile long); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile long long); +#elif defined(BOOST_HAS_MS_INT64) +BOOST_CHECK_TYPE(::tt::make_signed::type, const volatile __int64); +#endif + +// character types: +BOOST_CHECK_TYPE(::tt::make_signed::type, signed char); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral< ::tt::make_signed::type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed< ::tt::make_signed::type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral< ::tt::make_signed::type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed< ::tt::make_signed::type>::value, true); +TT_TEST_END + + diff --git a/test/make_unsigned_test.cpp b/test/make_unsigned_test.cpp new file mode 100644 index 0000000..548828e --- /dev/null +++ b/test/make_unsigned_test.cpp @@ -0,0 +1,107 @@ + +// (C) Copyright John Maddock 2007. +// 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.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +TT_TEST_BEGIN(make_unsigned) +// signed types: +BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned char); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned short); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned int); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned long); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned long long); +#elif defined(BOOST_HAS_MS_INT64) +BOOST_CHECK_TYPE(::tt::make_unsigned<__int64>::type, unsigned __int64); +#endif +// const signed types: +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned char); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned short); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned int); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned long); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned long long); +#elif defined(BOOST_HAS_MS_INT64) +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned __int64); +#endif +// volatile signed types: +BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned char); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned short); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned int); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned long); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned long long); +#elif defined(BOOST_HAS_MS_INT64) +BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned __int64); +#endif +// const volatile signed types: +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned char); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned short); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned int); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned long); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned long long); +#elif defined(BOOST_HAS_MS_INT64) +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned __int64); +#endif + +// unsigned types: +BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned char); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned short); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned int); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned long); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned long long); +#elif defined(BOOST_HAS_MS_INT64) +BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned __int64); +#endif +// const unsigned types: +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned char); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned short); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned int); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned long); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned long long); +#elif defined(BOOST_HAS_MS_INT64) +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const unsigned __int64); +#endif +// volatile unsigned types: +BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned char); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned short); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned int); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned long); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned long long); +#elif defined(BOOST_HAS_MS_INT64) +BOOST_CHECK_TYPE(::tt::make_unsigned::type, volatile unsigned __int64); +#endif +// const volatile unsigned types: +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned char); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned short); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned int); +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned long); +#ifdef BOOST_HAS_LONG_LONG +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned long long); +#elif defined(BOOST_HAS_MS_INT64) +BOOST_CHECK_TYPE(::tt::make_unsigned::type, const volatile unsigned __int64); +#endif + +// character types: +BOOST_CHECK_TYPE(::tt::make_unsigned::type, unsigned char); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral< ::tt::make_unsigned::type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned< ::tt::make_unsigned::type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral< ::tt::make_unsigned::type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned< ::tt::make_unsigned::type>::value, true); +TT_TEST_END + + From e20cc9b29422dc72d8e5dee9daf21d1aa0e9f5d3 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 10 Sep 2007 11:24:53 +0000 Subject: [PATCH 36/56] Try and force a date update. [SVN r39178] --- doc/type_traits.qbk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/type_traits.qbk b/doc/type_traits.qbk index 8d188d7..cc76f1d 100644 --- a/doc/type_traits.qbk +++ b/doc/type_traits.qbk @@ -15,7 +15,7 @@ [authors [authors, various]] [category template] [category generic] - [last-revision $LastChangedDate$] + [last-revision $Date$] ] @@ -237,3 +237,4 @@ See __has_trivial_constructor. + From fe60c9c994a5e5e0246c055281b3e219b41a6f87 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 10 Sep 2007 11:27:31 +0000 Subject: [PATCH 37/56] OK finally got date modified set right. [SVN r39179] --- doc/html/boost_typetraits/background.html | 22 +++++++++---------- .../boost_typetraits/category/transform.html | 2 +- doc/html/boost_typetraits/intrinsics.html | 2 +- .../boost_typetraits/reference/add_const.html | 2 +- .../boost_typetraits/reference/add_cv.html | 2 +- .../reference/add_pointer.html | 2 +- .../reference/add_reference.html | 2 +- .../reference/add_volatile.html | 2 +- .../boost_typetraits/reference/decay.html | 2 +- .../reference/floating_point_promotion.html | 2 +- .../reference/function_traits.html | 4 ++-- .../reference/integral_promotion.html | 2 +- .../reference/make_signed.html | 2 +- .../reference/make_unsigned.html | 2 +- .../boost_typetraits/reference/promote.html | 2 +- .../reference/remove_all_extents.html | 2 +- .../reference/remove_const.html | 2 +- .../boost_typetraits/reference/remove_cv.html | 2 +- .../reference/remove_extent.html | 2 +- .../reference/remove_pointer.html | 2 +- .../reference/remove_reference.html | 2 +- .../reference/remove_volatile.html | 2 +- doc/html/index.html | 4 ++-- 23 files changed, 35 insertions(+), 35 deletions(-) diff --git a/doc/html/boost_typetraits/background.html b/doc/html/boost_typetraits/background.html index e305212..762b544 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

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

- + Optimized copy

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

- + Was it worth it?

@@ -286,7 +286,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)

@@ -385,7 +385,7 @@

- + Pair of References

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

-

Table 1.2. Required Constructor Argument Types

+

Table 1.2. Required Constructor Argument Types

@@ -488,7 +488,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

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

- + Conclusion

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

- + Acknowledgements

@@ -627,7 +627,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 179d9e8..e7095bb 100644 --- a/doc/html/boost_typetraits/category/transform.html +++ b/doc/html/boost_typetraits/category/transform.html @@ -92,7 +92,7 @@ struct remove_volatile;
    - + Broken Compiler Workarounds:
    diff --git a/doc/html/boost_typetraits/intrinsics.html b/doc/html/boost_typetraits/intrinsics.html index c781597..2935470 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 bef56cf..2a2c437 100644 --- a/doc/html/boost_typetraits/reference/add_const.html +++ b/doc/html/boost_typetraits/reference/add_const.html @@ -54,7 +54,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 9ea2387..44a0fb4 100644 --- a/doc/html/boost_typetraits/reference/add_cv.html +++ b/doc/html/boost_typetraits/reference/add_cv.html @@ -55,7 +55,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 fe72730..c69c8e6 100644 --- a/doc/html/boost_typetraits/reference/add_pointer.html +++ b/doc/html/boost_typetraits/reference/add_pointer.html @@ -57,7 +57,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 fad698d..5e96e6a 100644 --- a/doc/html/boost_typetraits/reference/add_reference.html +++ b/doc/html/boost_typetraits/reference/add_reference.html @@ -54,7 +54,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 31e6828..17e8fc7 100644 --- a/doc/html/boost_typetraits/reference/add_volatile.html +++ b/doc/html/boost_typetraits/reference/add_volatile.html @@ -54,7 +54,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 c2fc62f..4887e29 100644 --- a/doc/html/boost_typetraits/reference/decay.html +++ b/doc/html/boost_typetraits/reference/decay.html @@ -49,7 +49,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 b245f82..f0817f1 100644 --- a/doc/html/boost_typetraits/reference/floating_point_promotion.html +++ b/doc/html/boost_typetraits/reference/floating_point_promotion.html @@ -50,7 +50,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 39f012d..5b30ef0 100644 --- a/doc/html/boost_typetraits/reference/function_traits.html +++ b/doc/html/boost_typetraits/reference/function_traits.html @@ -49,7 +49,7 @@
-

Table 1.12. Function Traits Members

+

Table 1.12. Function Traits Members

@@ -112,7 +112,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 e18cb0b..fe27f79 100644 --- a/doc/html/boost_typetraits/reference/integral_promotion.html +++ b/doc/html/boost_typetraits/reference/integral_promotion.html @@ -50,7 +50,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.14. Examples

+

Table 1.14. Examples

diff --git a/doc/html/boost_typetraits/reference/make_signed.html b/doc/html/boost_typetraits/reference/make_signed.html index 4e856fc..5bd6469 100644 --- a/doc/html/boost_typetraits/reference/make_signed.html +++ b/doc/html/boost_typetraits/reference/make_signed.html @@ -55,7 +55,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 239331b..a42cab5 100644 --- a/doc/html/boost_typetraits/reference/make_unsigned.html +++ b/doc/html/boost_typetraits/reference/make_unsigned.html @@ -55,7 +55,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 66d1db9..048075e 100644 --- a/doc/html/boost_typetraits/reference/promote.html +++ b/doc/html/boost_typetraits/reference/promote.html @@ -52,7 +52,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 a170362..c3c734f 100644 --- a/doc/html/boost_typetraits/reference/remove_all_extents.html +++ b/doc/html/boost_typetraits/reference/remove_all_extents.html @@ -55,7 +55,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 a88c258..983d8c4 100644 --- a/doc/html/boost_typetraits/reference/remove_const.html +++ b/doc/html/boost_typetraits/reference/remove_const.html @@ -54,7 +54,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 1f7251b..9b25477 100644 --- a/doc/html/boost_typetraits/reference/remove_cv.html +++ b/doc/html/boost_typetraits/reference/remove_cv.html @@ -54,7 +54,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 5e0031a..48dcb37 100644 --- a/doc/html/boost_typetraits/reference/remove_extent.html +++ b/doc/html/boost_typetraits/reference/remove_extent.html @@ -55,7 +55,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 714c641..107d1a9 100644 --- a/doc/html/boost_typetraits/reference/remove_pointer.html +++ b/doc/html/boost_typetraits/reference/remove_pointer.html @@ -54,7 +54,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 c029b42..d90e787 100644 --- a/doc/html/boost_typetraits/reference/remove_reference.html +++ b/doc/html/boost_typetraits/reference/remove_reference.html @@ -54,7 +54,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 e450013..3c76cd1 100644 --- a/doc/html/boost_typetraits/reference/remove_volatile.html +++ b/doc/html/boost_typetraits/reference/remove_volatile.html @@ -54,7 +54,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 6f3dc46..de9bb82 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -27,7 +27,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> http:/www.boost.org/LICENSE_1_0.txt </ulink>) @@ -155,7 +155,7 @@

- +

Last revised: , at

Last revised: September 10, 2007 at 12:24:53 +0100


From 60963a5d21b0560f79e7a88cf1af9b428c065dd3 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 12 Sep 2007 16:44:16 +0000 Subject: [PATCH 38/56] Fixed is_base_of/is_base_and_derived so that you get a compiler error if you try and use them with an incomplete class type. [SVN r39219] --- include/boost/type_traits/is_base_and_derived.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/boost/type_traits/is_base_and_derived.hpp b/include/boost/type_traits/is_base_and_derived.hpp index a3157f7..23b9727 100644 --- a/include/boost/type_traits/is_base_and_derived.hpp +++ b/include/boost/type_traits/is_base_and_derived.hpp @@ -15,6 +15,7 @@ #include #include #include +#include // should be the last #include #include @@ -128,6 +129,13 @@ struct bd_helper template struct is_base_and_derived_impl2 { + // + // May silently do the wrong thing with incomplete types + // unless we trap them here: + // + BOOST_STATIC_ASSERT(sizeof(B)); + BOOST_STATIC_ASSERT(sizeof(D)); + struct Host { #if !BOOST_WORKAROUND(BOOST_MSVC, == 1310) From bb151449f710a30fdb1984bebdb858ec79da8507 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sun, 16 Sep 2007 08:50:09 +0000 Subject: [PATCH 39/56] Fix msvc warnings. [SVN r39307] --- include/boost/type_traits/is_base_and_derived.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/type_traits/is_base_and_derived.hpp b/include/boost/type_traits/is_base_and_derived.hpp index 23b9727..2cff64e 100644 --- a/include/boost/type_traits/is_base_and_derived.hpp +++ b/include/boost/type_traits/is_base_and_derived.hpp @@ -133,8 +133,8 @@ struct is_base_and_derived_impl2 // May silently do the wrong thing with incomplete types // unless we trap them here: // - BOOST_STATIC_ASSERT(sizeof(B)); - BOOST_STATIC_ASSERT(sizeof(D)); + BOOST_STATIC_ASSERT(sizeof(B) != 0); + BOOST_STATIC_ASSERT(sizeof(D) != 0); struct Host { From 4f323d984525c2288a99920df517fa95a2daba1e Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 1 Oct 2007 08:29:15 +0000 Subject: [PATCH 40/56] Disable test for Intel-10. [SVN r39633] --- test/promote_enum_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/promote_enum_test.cpp b/test/promote_enum_test.cpp index c3d3f59..60b087e 100755 --- a/test/promote_enum_test.cpp +++ b/test/promote_enum_test.cpp @@ -91,7 +91,7 @@ void test_promote_to_int_or_uint() } #if (defined(BOOST_MSVC) && BOOST_MSVC <= 1400 ) || \ - (defined(BOOST_INTEL_WIN) && BOOST_INTEL_WIN <= 900) + (defined(BOOST_INTEL_WIN) && BOOST_INTEL_WIN <= 1000) // Don't test UIntEnum on VC++ 8.0 and Intel for Windows 9.0, // they are broken. More info is on top of this file. #else From 97e7ce2abf8ffb4a9dd0f944ecb8eef0f686b373 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 1 Oct 2007 09:38:05 +0000 Subject: [PATCH 41/56] Almost get things building with Borland. [SVN r39634] --- test/promote_util.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/promote_util.hpp b/test/promote_util.hpp index 1aa8d55..9d16de6 100755 --- a/test/promote_util.hpp +++ b/test/promote_util.hpp @@ -22,10 +22,10 @@ inline void test_no_cv() template inline void test_cv() { - typedef BOOST_DEDUCED_TYPENAME ::boost::promote::type promoted; - typedef BOOST_DEDUCED_TYPENAME ::boost::promote::type promoted_c; - typedef BOOST_DEDUCED_TYPENAME ::boost::promote::type promoted_v; - typedef BOOST_DEDUCED_TYPENAME ::boost::promote::type promoted_cv; + typedef BOOST_DEDUCED_TYPENAME boost::promote::type promoted; + typedef BOOST_DEDUCED_TYPENAME boost::promote::type promoted_c; + typedef BOOST_DEDUCED_TYPENAME boost::promote::type promoted_v; + typedef BOOST_DEDUCED_TYPENAME boost::promote::type promoted_cv; BOOST_STATIC_ASSERT(( ::boost::is_same< promoted , Promoted >::value )); BOOST_STATIC_ASSERT(( ::boost::is_same< promoted_c , Promoted const >::value )); From 293d1cb9008ec0f105ac40191966d73fafb917d4 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 1 Oct 2007 09:39:07 +0000 Subject: [PATCH 42/56] Added workarounds for broken WCHAR_MAX. [SVN r39635] --- test/promote_basic_test.cpp | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/test/promote_basic_test.cpp b/test/promote_basic_test.cpp index c770433..4b65807 100755 --- a/test/promote_basic_test.cpp +++ b/test/promote_basic_test.cpp @@ -57,11 +57,33 @@ int main() // Version prior to VC8 didn't allow WCHAR_MAX in #if expressions #if defined(BOOST_MSVC) && BOOST_MSVC < 1400 -#define BOOST_TT_AUX_WCHAR_MAX 0 // force test_cv< wchar_t, int > -#else -#define BOOST_TT_AUX_WCHAR_MAX WCHAR_MAX +# define BOOST_TT_AUX_WCHAR_MAX USHORT_MAX // force test_cv< wchar_t, int > +#elif defined(WCHAR_MAX) && !defined(__APPLE__) +# define BOOST_TT_AUX_WCHAR_MAX WCHAR_MAX +#elif defined(__BORLANDC__) || defined(__CYGWIN__) || defined(__MINGW32__) || (defined(__BEOS__) && defined(__GNUC__)) + // No WCHAR_MIN and WCHAR_MAX, whar_t is short and unsigned: +# define BOOST_TT_AUX_WCHAR_MAX USHORT_MAX // force test_cv< wchar_t, int > +#elif (defined(__sgi) && (!defined(__SGI_STL_PORT) || __SGI_STL_PORT < 0x400))\ + || (defined __APPLE__)\ + || (defined(__OpenBSD__) && defined(__GNUC__))\ + || (defined(__NetBSD__) && defined(__GNUC__))\ + || (defined(__FreeBSD__) && defined(__GNUC__))\ + || (defined(__DragonFly__) && defined(__GNUC__))\ + || (defined(__hpux) && defined(__GNUC__) && (__GNUC__ == 3) && !defined(__SGI_STL_PORT)) + // No WCHAR_MIN and WCHAR_MAX, wchar_t has the same range as int. + // - SGI MIPSpro with native library + // - gcc 3.x on HP-UX + // - Mac OS X with native library + // - gcc on FreeBSD, OpenBSD and NetBSD +# define BOOST_TT_AUX_WCHAR_MAX INT_MAX // force test_cv< wchar_t, int > +#elif defined(__hpux) && defined(__GNUC__) && (__GNUC__ == 2) && !defined(__SGI_STL_PORT) + // No WCHAR_MIN and WCHAR_MAX, wchar_t has the same range as unsigned int. + // - gcc 2.95.x on HP-UX + // (also, std::numeric_limits appears to return the wrong values). +# define BOOST_TT_AUX_WCHAR_MAX UINT_MAX // force test_cv< wchar_t, int > #endif +#ifdef BOOST_TT_AUX_WCHAR_MAX #if BOOST_TT_AUX_WCHAR_MAX <= INT_MAX test_cv< wchar_t, int >(); #elif WCHAR_MIN == 0 && BOOST_TT_AUX_WCHAR_MAX <= UINT_MAX @@ -71,6 +93,7 @@ int main() #else test_cv< wchar_t, unsigned long >(); #endif +#endif #undef BOOST_TT_AUX_WCHAR_MAX From dcee03611b4fee7cb64da00bac562651e241bebd Mon Sep 17 00:00:00 2001 From: John Maddock Date: Thu, 4 Oct 2007 09:18:16 +0000 Subject: [PATCH 43/56] Added tip to function_traits.qbk, rebuilt docs. [SVN r39682] --- doc/Jamfile.v2 | 3 +- doc/function_traits.qbk | 6 ++ doc/html/boost_typetraits/background.html | 22 ++--- .../boost_typetraits/category/transform.html | 2 +- doc/html/boost_typetraits/intrinsics.html | 2 +- .../boost_typetraits/reference/add_const.html | 2 +- .../boost_typetraits/reference/add_cv.html | 2 +- .../reference/add_pointer.html | 2 +- .../reference/add_reference.html | 2 +- .../reference/add_volatile.html | 2 +- .../boost_typetraits/reference/decay.html | 2 +- .../reference/floating_point_promotion.html | 2 +- .../reference/function_traits.html | 15 +++- .../reference/integral_promotion.html | 2 +- .../reference/is_function.html | 81 +++++++------------ .../reference/is_pointer.html | 27 +++---- .../reference/make_signed.html | 2 +- .../reference/make_unsigned.html | 2 +- .../boost_typetraits/reference/promote.html | 2 +- .../reference/remove_all_extents.html | 2 +- .../reference/remove_const.html | 2 +- .../boost_typetraits/reference/remove_cv.html | 2 +- .../reference/remove_extent.html | 2 +- .../reference/remove_pointer.html | 2 +- .../reference/remove_reference.html | 2 +- .../reference/remove_volatile.html | 2 +- doc/html/index.html | 2 +- 27 files changed, 91 insertions(+), 105 deletions(-) diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index a642ebe..6926164 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -11,7 +11,7 @@ boostbook standalone type_traits : # Path for links to Boost: - boost.root=../../../../ + boost.root=../../../.. # Path for libraries index: boost.libraries=../../../libraries.htm # Use the main Boost stylesheet: @@ -60,3 +60,4 @@ boostbook standalone #install html : ../../../doc/html/boostbook.css ; #install ../ : ../../../boost.png ; + diff --git a/doc/function_traits.qbk b/doc/function_traits.qbk index ecf220e..366d66d 100644 --- a/doc/function_traits.qbk +++ b/doc/function_traits.qbk @@ -15,6 +15,12 @@ The class template function_traits will only compile if: * The template argument `T` is a /function type/, note that this ['[*is not]] the same thing as a /pointer to a function/. +[tip +function_traits is intended to introspect only C++ functions of the +form R (), R( A1 ), R ( A1, ... etc. ) and not function pointers or +class member functions. To convert a function pointer type to a suitable +type use __remove_pointer.] + [table Function Traits Members [[Member] [Description]] [[`function_traits::arity`] diff --git a/doc/html/boost_typetraits/background.html b/doc/html/boost_typetraits/background.html index 762b544..2936f47 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

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

- + Optimized copy

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

- + Was it worth it?

@@ -286,7 +286,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)

@@ -385,7 +385,7 @@

- + Pair of References

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

-

Table 1.2. Required Constructor Argument Types

+

Table 1.2. Required Constructor Argument Types

@@ -488,7 +488,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

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

- + Conclusion

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

- + Acknowledgements

@@ -627,7 +627,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 e7095bb..0e9dbcb 100644 --- a/doc/html/boost_typetraits/category/transform.html +++ b/doc/html/boost_typetraits/category/transform.html @@ -92,7 +92,7 @@ struct remove_volatile;
    - + Broken Compiler Workarounds:
    diff --git a/doc/html/boost_typetraits/intrinsics.html b/doc/html/boost_typetraits/intrinsics.html index 2935470..1f21924 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 2a2c437..6edf188 100644 --- a/doc/html/boost_typetraits/reference/add_const.html +++ b/doc/html/boost_typetraits/reference/add_const.html @@ -54,7 +54,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 44a0fb4..9eb7c37 100644 --- a/doc/html/boost_typetraits/reference/add_cv.html +++ b/doc/html/boost_typetraits/reference/add_cv.html @@ -55,7 +55,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 c69c8e6..fac8b58 100644 --- a/doc/html/boost_typetraits/reference/add_pointer.html +++ b/doc/html/boost_typetraits/reference/add_pointer.html @@ -57,7 +57,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 5e96e6a..3a99d5b 100644 --- a/doc/html/boost_typetraits/reference/add_reference.html +++ b/doc/html/boost_typetraits/reference/add_reference.html @@ -54,7 +54,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 17e8fc7..0806c65 100644 --- a/doc/html/boost_typetraits/reference/add_volatile.html +++ b/doc/html/boost_typetraits/reference/add_volatile.html @@ -54,7 +54,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 4887e29..25a099a 100644 --- a/doc/html/boost_typetraits/reference/decay.html +++ b/doc/html/boost_typetraits/reference/decay.html @@ -49,7 +49,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 f0817f1..9f7cfc7 100644 --- a/doc/html/boost_typetraits/reference/floating_point_promotion.html +++ b/doc/html/boost_typetraits/reference/floating_point_promotion.html @@ -50,7 +50,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 5b30ef0..cffc73d 100644 --- a/doc/html/boost_typetraits/reference/function_traits.html +++ b/doc/html/boost_typetraits/reference/function_traits.html @@ -48,8 +48,19 @@ to a function. +
+ + + + + +
[Tip]Tip

+ function_traits is intended to introspect only C++ functions of the form + R (), R( A1 ), R ( A1, ... etc. ) and not function pointers or class member + functions. To convert a function pointer type to a suitable type use remove_pointer. +

-

Table 1.12. Function Traits Members

+

Table 1.12. Function Traits Members

@@ -112,7 +123,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 fe27f79..b1ee9fc 100644 --- a/doc/html/boost_typetraits/reference/integral_promotion.html +++ b/doc/html/boost_typetraits/reference/integral_promotion.html @@ -50,7 +50,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.14. Examples

+

Table 1.14. Examples

diff --git a/doc/html/boost_typetraits/reference/is_function.html b/doc/html/boost_typetraits/reference/is_function.html index 5a1e59a..a70206b 100644 --- a/doc/html/boost_typetraits/reference/is_function.html +++ b/doc/html/boost_typetraits/reference/is_function.html @@ -131,69 +131,44 @@

-

+ Don't confuse function-types with pointers to functions: +

- Don't confuse function-types with pointers to functions: -

+ typedef int + f(double); +

-

+ defines a function type, +

- typedef int - f(double); -

+ f foo; +

-

+ declares a prototype for a function of type f, +

- defines a function type, -

+ f* + pf = + foo; +

-

+ f& + fr = + foo; +

- f foo; -

+ declares a pointer and a reference to the function foo. +

-

+ If you want to detect whether some type is a pointer-to-function then use: +

- declares a prototype for a function of type f, -

-

-

-

- f* - pf = - foo; -

-

-

-

- f& - fr = - foo; -

-

-

-

- declares a pointer and a reference to the function foo. -

-

-

-

- If you want to detect whether some type is a pointer-to-function then - use: -

-

-

-

- is_function<remove_pointer<T>::type>::value - && is_pointer<T>::value -

-

-

-

- or for pointers to member functions you can just use is_member_function_pointer - directly. -

+ is_function<remove_pointer<T>::type>::value + && is_pointer<T>::value +

+ or for pointers to member functions you can just use is_member_function_pointer + directly.

diff --git a/doc/html/boost_typetraits/reference/is_pointer.html b/doc/html/boost_typetraits/reference/is_pointer.html index 5a1c6f6..1f955be 100644 --- a/doc/html/boost_typetraits/reference/is_pointer.html +++ b/doc/html/boost_typetraits/reference/is_pointer.html @@ -110,23 +110,16 @@ [Important] Important - -

-

-

- is_pointer detects "real" - pointer types only, and not smart pointers. Users - should not specialise is_pointer - for smart pointer types, as doing so may cause Boost (and other third - party) code to fail to function correctly. Users wanting a trait to detect - smart pointers should create their own. However, note that there is no - way in general to auto-magically detect smart pointer types, so such - a trait would have to be partially specialised for each supported smart - pointer type. -

-

-

- +

+ is_pointer detects "real" + pointer types only, and not smart pointers. Users + should not specialise is_pointer + for smart pointer types, as doing so may cause Boost (and other third party) + code to fail to function correctly. Users wanting a trait to detect smart + pointers should create their own. However, note that there is no way in + general to auto-magically detect smart pointer types, so such a trait would + have to be partially specialised for each supported smart pointer type. +

diff --git a/doc/html/boost_typetraits/reference/make_signed.html b/doc/html/boost_typetraits/reference/make_signed.html index 5bd6469..bbf824e 100644 --- a/doc/html/boost_typetraits/reference/make_signed.html +++ b/doc/html/boost_typetraits/reference/make_signed.html @@ -55,7 +55,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 a42cab5..b77a4d5 100644 --- a/doc/html/boost_typetraits/reference/make_unsigned.html +++ b/doc/html/boost_typetraits/reference/make_unsigned.html @@ -55,7 +55,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 048075e..cb3bf1f 100644 --- a/doc/html/boost_typetraits/reference/promote.html +++ b/doc/html/boost_typetraits/reference/promote.html @@ -52,7 +52,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 c3c734f..b7b23d5 100644 --- a/doc/html/boost_typetraits/reference/remove_all_extents.html +++ b/doc/html/boost_typetraits/reference/remove_all_extents.html @@ -55,7 +55,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 983d8c4..26e6421 100644 --- a/doc/html/boost_typetraits/reference/remove_const.html +++ b/doc/html/boost_typetraits/reference/remove_const.html @@ -54,7 +54,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 9b25477..290a560 100644 --- a/doc/html/boost_typetraits/reference/remove_cv.html +++ b/doc/html/boost_typetraits/reference/remove_cv.html @@ -54,7 +54,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 48dcb37..24aa231 100644 --- a/doc/html/boost_typetraits/reference/remove_extent.html +++ b/doc/html/boost_typetraits/reference/remove_extent.html @@ -55,7 +55,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 107d1a9..ff55dd6 100644 --- a/doc/html/boost_typetraits/reference/remove_pointer.html +++ b/doc/html/boost_typetraits/reference/remove_pointer.html @@ -54,7 +54,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 d90e787..d247cf5 100644 --- a/doc/html/boost_typetraits/reference/remove_reference.html +++ b/doc/html/boost_typetraits/reference/remove_reference.html @@ -54,7 +54,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 3c76cd1..50ba5ec 100644 --- a/doc/html/boost_typetraits/reference/remove_volatile.html +++ b/doc/html/boost_typetraits/reference/remove_volatile.html @@ -54,7 +54,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 de9bb82..e8c88d1 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -27,7 +27,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> http:/www.boost.org/LICENSE_1_0.txt </ulink>) From c85d9e3b88289809ff2730a954347b9f1ac15184 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 5 Oct 2007 15:00:40 +0000 Subject: [PATCH 44/56] Disable PP-logic for __DECCXX compiler: WCAHR_MAX is defined but doesn't work in PP-logic on that platform. [SVN r39708] --- test/promote_basic_test.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/promote_basic_test.cpp b/test/promote_basic_test.cpp index 4b65807..9b765f0 100755 --- a/test/promote_basic_test.cpp +++ b/test/promote_basic_test.cpp @@ -83,7 +83,8 @@ int main() # define BOOST_TT_AUX_WCHAR_MAX UINT_MAX // force test_cv< wchar_t, int > #endif -#ifdef BOOST_TT_AUX_WCHAR_MAX +// For this PP-logic to work we need a valid WCHAR_MAX etc: +#if defined(BOOST_TT_AUX_WCHAR_MAX) && !defined(__DECCXX) #if BOOST_TT_AUX_WCHAR_MAX <= INT_MAX test_cv< wchar_t, int >(); #elif WCHAR_MIN == 0 && BOOST_TT_AUX_WCHAR_MAX <= UINT_MAX From 27eacb40393bf519582445105c92b5eaa10c4b10 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 5 Oct 2007 17:49:12 +0000 Subject: [PATCH 45/56] Update Jamfiles to make PDF generation easier. [SVN r39714] --- doc/Jamfile.v2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index 6926164..7143451 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -5,6 +5,8 @@ using quickbook ; +path-constant boost-images : ../../../doc/src/images ; + xml type_traits : type_traits.qbk ; boostbook standalone : @@ -54,10 +56,12 @@ boostbook standalone # Set this one for PDF generation *only*: # default pnd graphics are awful in PDF form, # better use SVG's instead: - # admon.graphics.extension=".svg" + pdf:admon.graphics.extension=".svg" + pdf:admon.graphics.path=$(boost-images)/ ; #install html : ../../../doc/html/boostbook.css ; #install ../ : ../../../boost.png ; + From ec72b74218f67e6fcfeb5732644559281e74840b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20M=20L=C3=B3pez=20Mu=C3=B1oz?= Date: Wed, 10 Oct 2007 10:20:43 +0000 Subject: [PATCH 46/56] reverted 36306 for CW 8.3 [SVN r39885] --- include/boost/type_traits/is_member_pointer.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/boost/type_traits/is_member_pointer.hpp b/include/boost/type_traits/is_member_pointer.hpp index b098afb..1f9f5a7 100644 --- a/include/boost/type_traits/is_member_pointer.hpp +++ b/include/boost/type_traits/is_member_pointer.hpp @@ -47,9 +47,12 @@ BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer, #elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,::boost::is_member_function_pointer::value) BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*,true) + +#if !BOOST_WORKAROUND(__MWERKS__,<=0x3003) BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*const,true) BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*volatile,true) BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*const volatile,true) +#endif #else // no partial template specialization From 295936b17599a197ab347db1ad4f26a2382b9f35 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 22 Oct 2007 17:48:51 +0000 Subject: [PATCH 47/56] Disabled intrinsic type traits testing for SGI compiler. Disabled one is_convertible test for aCC on PA RISC. Disabled some tests in promote_basic_test.cpp for more platforms that have broken WCHAR_MAX macros. [SVN r40294] --- test/is_class_test.cpp | 2 +- test/is_convertible_test.cpp | 6 +++++- test/is_union_test.cpp | 2 +- test/promote_basic_test.cpp | 7 ++++++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/test/is_class_test.cpp b/test/is_class_test.cpp index 156f94e..d885986 100644 --- a/test/is_class_test.cpp +++ b/test/is_class_test.cpp @@ -27,7 +27,7 @@ TT_TEST_BEGIN(is_class) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); -#ifdef BOOST_HAS_TYPE_TRAITS_INTRINSICS +#if defined(BOOST_HAS_TYPE_TRAITS_INTRINSICS) && !defined(__sgi) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, false); diff --git a/test/is_convertible_test.cpp b/test/is_convertible_test.cpp index f461e8a..d181cb5 100644 --- a/test/is_convertible_test.cpp +++ b/test/is_convertible_test.cpp @@ -84,7 +84,11 @@ BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::val BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); -#ifndef BOOST_NO_IS_ABSTRACT +#if !defined(BOOST_NO_IS_ABSTRACT) && !(defined(__hppa) && defined(__HP_aCC)) +// +// This doesn't work with aCC on PA RISC even though the is_abstract tests do +// all pass, this may indicate a deeper problem... +// BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); #endif diff --git a/test/is_union_test.cpp b/test/is_union_test.cpp index 5985704..a95ecc5 100644 --- a/test/is_union_test.cpp +++ b/test/is_union_test.cpp @@ -26,7 +26,7 @@ TT_TEST_BEGIN(is_union) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, false); -#ifdef BOOST_HAS_TYPE_TRAITS_INTRINSICS +#if defined(BOOST_HAS_TYPE_TRAITS_INTRINSICS) && !defined(__sgi) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union::value, true); diff --git a/test/promote_basic_test.cpp b/test/promote_basic_test.cpp index 9b765f0..f84a75c 100755 --- a/test/promote_basic_test.cpp +++ b/test/promote_basic_test.cpp @@ -84,7 +84,11 @@ int main() #endif // For this PP-logic to work we need a valid WCHAR_MAX etc: -#if defined(BOOST_TT_AUX_WCHAR_MAX) && !defined(__DECCXX) +#if defined(BOOST_TT_AUX_WCHAR_MAX) \ + && !defined(__DECCXX) \ + && !defined(__hpux) \ + && !defined(_WIN32_WCE) + #if BOOST_TT_AUX_WCHAR_MAX <= INT_MAX test_cv< wchar_t, int >(); #elif WCHAR_MIN == 0 && BOOST_TT_AUX_WCHAR_MAX <= UINT_MAX @@ -94,6 +98,7 @@ int main() #else test_cv< wchar_t, unsigned long >(); #endif + #endif #undef BOOST_TT_AUX_WCHAR_MAX From 2275f12df8c49ec5741d5b660d2fd169a1485602 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 2 Nov 2007 13:01:39 +0000 Subject: [PATCH 48/56] Added a couple of boost:: qualifiers that were present in 1.34.1 but got lost from the Trunk. [SVN r40683] --- include/boost/type_traits/function_traits.hpp | 2 +- include/boost/type_traits/is_class.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/type_traits/function_traits.hpp b/include/boost/type_traits/function_traits.hpp index 36efaec..2112ce7 100644 --- a/include/boost/type_traits/function_traits.hpp +++ b/include/boost/type_traits/function_traits.hpp @@ -166,7 +166,7 @@ struct function_traits_helper template struct function_traits : - public detail::function_traits_helper::type> + public detail::function_traits_helper::type> { }; diff --git a/include/boost/type_traits/is_class.hpp b/include/boost/type_traits/is_class.hpp index 6bf2fdc..05d96de 100644 --- a/include/boost/type_traits/is_class.hpp +++ b/include/boost/type_traits/is_class.hpp @@ -116,7 +116,7 @@ struct is_class_impl # ifdef __EDG_VERSION__ BOOST_TT_AUX_BOOL_TRAIT_DEF1( - is_class,T, boost::detail::is_class_impl::type>::value) + is_class,T, boost::detail::is_class_impl::type>::value) # else BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_class,T,::boost::detail::is_class_impl::value) # endif From a8c65cc5955a60a95a0175a61c1f0f79e1da1a2e Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Wed, 7 Nov 2007 03:23:31 +0000 Subject: [PATCH 49/56] added license info in copyright notice at the footer [SVN r40867] --- doc/html/boost_typetraits/background.html | 210 +++++++++--------- doc/html/boost_typetraits/category.html | 20 +- .../boost_typetraits/category/alignment.html | 37 +-- .../boost_typetraits/category/function.html | 34 +-- .../boost_typetraits/category/transform.html | 82 ++++--- .../category/value_traits.html | 34 +-- .../category/value_traits/primary.html | 84 ++++--- .../category/value_traits/properties.html | 82 ++++--- .../category/value_traits/relate.html | 36 +-- doc/html/boost_typetraits/credits.html | 19 +- doc/html/boost_typetraits/examples.html | 20 +- doc/html/boost_typetraits/examples/copy.html | 38 ++-- .../boost_typetraits/examples/destruct.html | 35 +-- doc/html/boost_typetraits/examples/fill.html | 41 ++-- doc/html/boost_typetraits/examples/iter.html | 45 ++-- .../boost_typetraits/examples/to_double.html | 26 ++- doc/html/boost_typetraits/intrinsics.html | 66 +++--- doc/html/boost_typetraits/intro.html | 23 +- doc/html/boost_typetraits/mpl.html | 35 +-- doc/html/boost_typetraits/reference.html | 20 +- .../boost_typetraits/reference/add_const.html | 66 +++--- .../boost_typetraits/reference/add_cv.html | 72 +++--- .../reference/add_pointer.html | 66 +++--- .../reference/add_reference.html | 64 +++--- .../reference/add_volatile.html | 68 +++--- .../reference/aligned_storage.html | 35 +-- .../reference/alignment_of.html | 51 +++-- .../boost_typetraits/reference/decay.html | 68 +++--- .../boost_typetraits/reference/extent.html | 64 +++--- .../reference/floating_point_promotion.html | 66 +++--- .../reference/function_traits.html | 95 ++++---- .../reference/has_no_throw_def_cons.html | 24 +- .../reference/has_nothrow_assign.html | 42 ++-- .../reference/has_nothrow_constructor.html | 49 ++-- .../reference/has_nothrow_copy.html | 46 ++-- .../reference/has_nothrow_cp_cons.html | 23 +- .../reference/has_trivial_assign.html | 58 ++--- .../reference/has_trivial_constructor.html | 63 +++--- .../reference/has_trivial_copy.html | 60 ++--- .../reference/has_trivial_cp_cons.html | 23 +- .../reference/has_trivial_def_cons.html | 24 +- .../reference/has_trivial_destructor.html | 57 ++--- .../reference/has_virtual_destructor.html | 45 ++-- .../reference/integral_constant.html | 25 ++- .../reference/integral_promotion.html | 62 +++--- .../reference/is_abstract.html | 55 ++--- .../reference/is_arithmetic.html | 53 ++--- .../boost_typetraits/reference/is_array.html | 51 +++-- .../reference/is_base_of.html | 75 ++++--- .../boost_typetraits/reference/is_class.html | 65 +++--- .../reference/is_complex.html | 37 +-- .../reference/is_compound.html | 55 ++--- .../boost_typetraits/reference/is_const.html | 53 ++--- .../reference/is_convertible.html | 79 +++---- .../boost_typetraits/reference/is_empty.html | 59 ++--- .../boost_typetraits/reference/is_enum.html | 63 +++--- .../reference/is_floating_point.html | 49 ++-- .../reference/is_function.html | 84 +++---- .../reference/is_fundamental.html | 57 ++--- .../reference/is_integral.html | 52 +++-- .../reference/is_member_function_pointer.html | 63 +++--- .../reference/is_member_object_pointer.html | 63 +++--- .../reference/is_member_pointer.html | 50 +++-- .../boost_typetraits/reference/is_object.html | 57 ++--- .../boost_typetraits/reference/is_pod.html | 53 ++--- .../reference/is_pointer.html | 59 ++--- .../reference/is_polymorphic.html | 57 ++--- .../reference/is_reference.html | 53 ++--- .../boost_typetraits/reference/is_same.html | 53 ++--- .../boost_typetraits/reference/is_scalar.html | 57 ++--- .../boost_typetraits/reference/is_signed.html | 57 ++--- .../reference/is_stateless.html | 47 ++-- .../boost_typetraits/reference/is_union.html | 59 ++--- .../reference/is_unsigned.html | 61 ++--- .../boost_typetraits/reference/is_void.html | 53 ++--- .../reference/is_volatile.html | 51 +++-- .../reference/make_signed.html | 64 +++--- .../reference/make_unsigned.html | 66 +++--- .../boost_typetraits/reference/promote.html | 65 +++--- doc/html/boost_typetraits/reference/rank.html | 57 ++--- .../reference/remove_all_extents.html | 70 +++--- .../reference/remove_const.html | 68 +++--- .../boost_typetraits/reference/remove_cv.html | 68 +++--- .../reference/remove_extent.html | 68 +++--- .../reference/remove_pointer.html | 66 +++--- .../reference/remove_reference.html | 62 +++--- .../reference/remove_volatile.html | 68 +++--- .../reference/type_with_alignment.html | 33 +-- doc/html/boost_typetraits/user_defined.html | 32 +-- doc/html/index.html | 13 +- 90 files changed, 2610 insertions(+), 2273 deletions(-) diff --git a/doc/html/boost_typetraits/background.html b/doc/html/boost_typetraits/background.html index 2936f47..be75eb7 100644 --- a/doc/html/boost_typetraits/background.html +++ b/doc/html/boost_typetraits/background.html @@ -1,13 +1,13 @@ -Background and Tutorial + Background and Tutorial - + - - + +

@@ -24,8 +24,7 @@

The following is an updated version of the article "C++ Type traits" by John Maddock and Steve Cleary that appeared in the October 2000 issue of @@ -46,29 +45,29 @@ Consider an example: when working with character strings, one common operation is to determine the length of a null terminated string. Clearly it's possible to write generic code that can do this, but it turns out that there are much - more efficient methods available: for example, the C library functions strlen and wcslen + more efficient methods available: for example, the C library functions strlen and wcslen are usually written in assembler, and with suitable hardware support can be considerably faster than a generic version written in C++. The authors of the - C++ standard library realized this, and abstracted the properties of char and wchar_t - into the class char_traits. - Generic code that works with character strings can simply use char_traits<>::length to determine the length of a null - terminated string, safe in the knowledge that specializations of char_traits will use the most appropriate + C++ standard library realized this, and abstracted the properties of char and wchar_t + into the class char_traits. + Generic code that works with character strings can simply use char_traits<>::length to determine the length of a null + terminated string, safe in the knowledge that specializations of char_traits will use the most appropriate method available to them.

-
- +

+ Type Traits -

+

- Class char_traits is a classic + Class char_traits is a classic example of a collection of type specific properties wrapped up in a single class - what Nathan Myers termed a baggage class[1]. In the Boost type-traits library, we[2] have written a set of very specific traits classes, each of which encapsulate a single trait from the C++ type system; for example, is a type a pointer or a reference type? Or does a type have a trivial constructor, or a const-qualifier? The type-traits classes - share a unified design: each class inherits from a the type true_type - if the type has the specified property and inherits from false_type + share a unified design: each class inherits from a the type true_type + if the type has the specified property and inherits from false_type otherwise. As we will show, these classes can be used in generic programming to determine the properties of a given type and introduce optimizations that are appropriate for that case. @@ -77,51 +76,51 @@ The type-traits library also contains a set of classes that perform a specific transformation on a type; for example, they can remove a top-level const or volatile qualifier from a type. Each class that performs a transformation defines - a single typedef-member type + a single typedef-member type that is the result of the transformation. All of the type-traits classes are - defined inside namespace boost; + defined inside namespace boost; for brevity, namespace-qualification is omitted in most of the code samples given.

-
- +

+ Implementation -

+

There are far too many separate classes contained in the type-traits library to give a full implementation here - see the source code in the Boost library for the full details - however, most of the implementation is fairly repetitive anyway, so here we will just give you a flavor for how some of the classes are implemented. Beginning with possibly the simplest class in the library, - is_void<T> inherits - from true_type - only if T is void. + is_void<T> inherits + from true_type + only if T is void.

 template <typename T> 
-struct is_void : public false_type{};
+struct is_void : public false_type{};
 
 template <> 
-struct is_void<void> : public true_type{};
+struct is_void<void> : public true_type{};
 

- Here we define a primary version of the template class is_void, - and provide a full-specialization when T - is void. While full specialization + Here we define a primary version of the template class is_void, + and provide a full-specialization when T + is void. While full specialization of a template class is an important technique, sometimes we need a solution that is halfway between a fully generic solution, and a full specialization. This is exactly the situation for which the standards committee defined partial - template-class specialization. As an example, consider the class boost::is_pointer<T>: + template-class specialization. As an example, consider the class boost::is_pointer<T>: here we needed a primary version that handles all the cases where T is not a pointer, and a partial specialization to handle all the cases where T is a pointer:

 template <typename T> 
-struct is_pointer : public false_type{};
+struct is_pointer : public false_type{};
 
 template <typename T> 
-struct is_pointer<T*> : public true_type{};
+struct is_pointer<T*> : public true_type{};
 

The syntax for partial specialization is somewhat arcane and could easily occupy @@ -153,35 +152,35 @@ and close enough to the actual rule to be useful for everyday use.

- As a more complex example of partial specialization consider the class remove_extent<T>. This - class defines a single typedef-member type + As a more complex example of partial specialization consider the class remove_extent<T>. This + class defines a single typedef-member type that is the same type as T but with any top-level array bounds removed; this is an example of a traits class that performs a transformation on a type:

 template <typename T> 
-struct remove_extent
+struct remove_extent
 { typedef T type; };
 
 template <typename T, std::size_t N> 
-struct remove_extent<T[N]>
+struct remove_extent<T[N]>
 { typedef T type; };
 

- The aim of remove_extent + The aim of remove_extent is this: imagine a generic algorithm that is passed an array type as a template - parameter, remove_extent + parameter, remove_extent provides a means of determining the underlying type of the array. For example - remove_extent<int[4][5]>::type would evaluate to the type int[5]. This example also shows that the number of + remove_extent<int[4][5]>::type would evaluate to the type int[5]. This example also shows that the number of template parameters in a partial specialization does not have to match the number in the default template. However, the number of parameters that appear after the class name do have to match the number and type of the parameters in the default template.

-
- +

+ Optimized copy -

+

As an example of how the type traits classes can be used, consider the standard library algorithm copy: @@ -192,24 +191,24 @@

Obviously, there's no problem writing a generic version of copy that works - for all iterator types Iter1 - and Iter2; however, there are + for all iterator types Iter1 + and Iter2; however, there are some circumstances when the copy operation can best be performed by a call - to memcpy. In order to implement - copy in terms of memcpy all + to memcpy. In order to implement + copy in terms of memcpy all of the following conditions need to be met:

  • - Both of the iterator types Iter1 - and Iter2 must be pointers. + Both of the iterator types Iter1 + and Iter2 must be pointers.
  • - Both Iter1 and Iter2 must point to the same type - excluding + Both Iter1 and Iter2 must point to the same type - excluding const and volatile-qualifiers.
  • - The type pointed to by Iter1 + The type pointed to by Iter1 must have a trivial assignment operator.
@@ -229,33 +228,34 @@

- If all these conditions are met then a type can be copied using memcpy rather than using a compiler generated - assignment operator. The type-traits library provides a class has_trivial_assign, - such that has_trivial_assign<T>::value is true only if T has a trivial assignment + If all these conditions are met then a type can be copied using memcpy rather than using a compiler generated + assignment operator. The type-traits library provides a class has_trivial_assign, + such that has_trivial_assign<T>::value is true only if T has a trivial assignment operator. This class "just works" for scalar types, but has to be explicitly specialised for class/struct types that also happen to have a trivial - assignment operator. In other words if has_trivial_assign + assignment operator. In other words if has_trivial_assign gives the wrong answer, it will give the "safe" wrong answer - that trivial assignment is not allowable.

- The code for an optimized version of copy that uses memcpy - where appropriate is given in the - examples. The code begins by defining a template function do_copy that performs a "slow but safe" - copy. The last parameter passed to this function may be either a true_type - or a false_type. + The code for an optimized version of copy that uses memcpy + where appropriate is given in the + examples. The code begins by defining a template function do_copy that performs a "slow but safe" + copy. The last parameter passed to this function may be either a true_type + or a false_type. Following that there is an overload of docopy that uses `memcpy`: this time the iterators are required to actually be pointers - to the same type, and the final parameter must be a `_true_type. Finally, the version - of copy calls - docopy`, passing `_has_trivial_assign<value_type>()` + to the same type, and the final parameter must be a `_true_type. Finally, the version + of copy calls + docopy`, passing `_has_trivial_assign<value_type>()` as the final parameter: this will dispatch to the optimized version where appropriate, otherwise it will call the "slow but safe version".

-
- +

+ Was it worth it? -

+

It has often been repeated in these columns that "premature optimization is the root of all evil" [4]. @@ -286,9 +286,9 @@

-

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)

-
@@ -382,12 +382,12 @@ -
+ -
- +

+ Pair of References -

+

The optimized copy example shows how type traits may be used to perform optimization decisions at compile-time. Another important usage of type traits is to allow @@ -397,7 +397,7 @@ references [6].

- First, let us examine the definition of std::pair, omitting + First, let us examine the definition of std::pair, omitting the comparison operators, default constructor, and template copy constructor for simplicity:

@@ -423,8 +423,8 @@ to hold non-reference types, references, and constant references:

-

Table 1.2. Required Constructor Argument Types

-
+

Table 1.2. Required Constructor Argument Types

+
@@ -432,7 +432,7 @@ -

- Type of T1 + Type of T1

@@ -479,18 +479,18 @@
+
-

+

A little familiarity with the type traits classes allows us to construct a single mapping that allows us to determine the type of parameter from the type - of the contained class. The type traits classes provide a transformation add_reference, which + of the contained class. The type traits classes provide a transformation add_reference, which 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

-
@@ -500,17 +500,17 @@ @@ -567,10 +567,10 @@ -

- Type of T1 + Type of T1

- Type of const T1 + Type of const T1

- Type of add_reference<const T1>::type + Type of add_reference<const T1>::type

+
-

- This allows us to build a primary template definition for pair +

+ This allows us to build a primary template definition for pair that can contain non-reference types, reference types, and constant reference types:

@@ -584,20 +584,20 @@ T1 first; T2 second; -pair(boost::add_reference<const T1>::type nfirst, - boost::add_reference<const T2>::type nsecond) +pair(boost::add_reference<const T1>::type nfirst, + boost::add_reference<const T2>::type nsecond) :first(nfirst), second(nsecond) { } };

Add back in the standard comparison operators, default constructor, and template - copy constructor (which are all the same), and you have a std::pair that + copy constructor (which are all the same), and you have a std::pair that can hold reference types!

This same extension could have been done using partial template specialization - of pair, but to specialize - pair in this way would require + of pair, but to specialize + pair in this way would require three partial specializations, plus the primary template. Type traits allows us to define a single primary template that adjusts itself auto-magically to any of these partial specializations, instead of a brute-force partial specialization @@ -605,10 +605,10 @@ partial specialization to the type traits classes, resulting in code that is easier to maintain and easier to understand.

-
- +

+ Conclusion -

+

We hope that in this article we have been able to give you some idea of what type-traits are all about. A more complete listing of the available classes @@ -618,18 +618,18 @@ does not have to sink to the lowest common denominator, and that templates can be optimal as well as generic.

-
- +

+ Acknowledgements -

+

The authors would like to thank Beman Dawes and Howard Hinnant for their helpful comments when preparing this article.

-
- +

+ References -

+
  1. Nathan C. Myers, C++ Report, June 1995. @@ -677,10 +677,14 @@
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/category.html b/doc/html/boost_typetraits/category.html index 256ef75..430f830 100644 --- a/doc/html/boost_typetraits/category.html +++ b/doc/html/boost_typetraits/category.html @@ -1,13 +1,14 @@ -Type Traits by Category + Type Traits by Category - + - - + + @@ -24,8 +25,7 @@
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/category/alignment.html b/doc/html/boost_typetraits/category/alignment.html index cb22d55..39ba2ad 100644 --- a/doc/html/boost_typetraits/category/alignment.html +++ b/doc/html/boost_typetraits/category/alignment.html @@ -1,13 +1,16 @@ -Synthesizing Types with Specific Alignments + Synthesizing Types + with Specific Alignments - + - - - + + + @@ -24,32 +27,36 @@

Some low level memory management routines need to synthesize a POD type with - specific alignment properties. The template type_with_alignment - finds the smallest type with a specified alignment, while template aligned_storage + specific alignment properties. The template type_with_alignment + finds the smallest type with a specified alignment, while template aligned_storage creates a type with a specific size and alignment.

- Synopsis + Synopsis

 template <std::size_t Align>
-struct type_with_alignment;
+struct type_with_alignment;
 
 template <std::size_t Size, std::size_t Align>
-struct aligned_storage;
+struct aligned_storage;
 
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/category/function.html b/doc/html/boost_typetraits/category/function.html index 20a4736..3da077d 100644 --- a/doc/html/boost_typetraits/category/function.html +++ b/doc/html/boost_typetraits/category/function.html @@ -1,13 +1,15 @@ -Decomposing Function Types + Decomposing Function + Types - + - - - + + + @@ -24,29 +26,33 @@

- The class template function_traits - extracts information from function types (see also is_function). + The class template function_traits + extracts information from function types (see also is_function). This traits class allows you to tell how many arguments a function takes, what those argument types are, and what the return type is.

- Synopsis + Synopsis

 template <std::size_t Align>
-struct function_traits;
+struct function_traits;
 
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/category/transform.html b/doc/html/boost_typetraits/category/transform.html index 0e9dbcb..0ddfae9 100644 --- a/doc/html/boost_typetraits/category/transform.html +++ b/doc/html/boost_typetraits/category/transform.html @@ -1,13 +1,16 @@ -Type Traits that Transform One Type to Another + Type Traits that + Transform One Type to Another - + - - - + + + @@ -24,78 +27,79 @@

The following templates transform one type to another, based upon some well-defined - rule. Each template has a single member called type + rule. Each template has a single member called type that is the result of applying the transformation to the template argument - T. + T.

- Synopsis: + Synopsis:

 template <class T>
-struct add_const;
+struct add_const;
 
 template <class T>
-struct add_cv;
+struct add_cv;
 
 template <class T>
-struct add_pointer;
+struct add_pointer;
 
 template <class T>
-struct add_reference;
+struct add_reference;
 
 template <class T>
-struct add_volatile;
+struct add_volatile;
 
 template <class T>
-struct decay;
+struct decay;
 
 template <class T>
-struct floating_point_promotion;
+struct floating_point_promotion;
 
 template <class T>
-struct integral_promotion;
+struct integral_promotion;
 
 template <class T>
-struct make_signed;
+struct make_signed;
 
 template <class T>
-struct make_unsigned;
+struct make_unsigned;
 
 template <class T>
-struct promote;
+struct promote;
 
 template <class T>
-struct remove_all_extents;
+struct remove_all_extents;
 
 template <class T>
-struct remove_const;
+struct remove_const;
 
 template <class T>
-struct remove_cv;
+struct remove_cv;
 
 template <class T>
-struct remove_extent;
+struct remove_extent;
 
 template <class T>
-struct remove_pointer;
+struct remove_pointer;
 
 template <class T>
-struct remove_reference;
+struct remove_reference;
 
 template <class T>
-struct remove_volatile;
+struct remove_volatile;
 
-
- +

+ Broken Compiler Workarounds: -

+

For all of these templates support for partial specialization of class templates is required to correctly implement the transformation. On the other hand, @@ -129,8 +133,8 @@

and the second part provides the library's users with a mechanism to make - the above code work not only for char, - int or other built-in type, + the above code work not only for char, + int or other built-in type, but for their own types as well:

@@ -146,16 +150,20 @@
 

Note that the macro BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION evaluates - to nothing on those compilers that do support + to nothing on those compilers that do support partial specialization.

- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/category/value_traits.html b/doc/html/boost_typetraits/category/value_traits.html index aca0bb4..2c59bcc 100644 --- a/doc/html/boost_typetraits/category/value_traits.html +++ b/doc/html/boost_typetraits/category/value_traits.html @@ -1,13 +1,15 @@ -Type Traits that Describe the Properties of a Type + Type Traits + that Describe the Properties of a Type - + - - - + + + @@ -24,9 +26,9 @@
Categorizing a Type
@@ -37,21 +39,25 @@

These traits are all value traits, which is to say the - traits classes all inherit from integral_constant, + traits classes all inherit from integral_constant, and are used to access some numerical property of a type. Often this is a simple true or false Boolean value, but in a few cases may be some other integer value (for example when dealing with type alignments, or array bounds: - see alignment_of, - rank - and extent). + see alignment_of, + rank + and extent).

- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/category/value_traits/primary.html b/doc/html/boost_typetraits/category/value_traits/primary.html index 6aff1a3..2235fc4 100644 --- a/doc/html/boost_typetraits/category/value_traits/primary.html +++ b/doc/html/boost_typetraits/category/value_traits/primary.html @@ -1,13 +1,17 @@ -Categorizing a Type + Categorizing + a Type - + - - - + + + @@ -24,69 +28,71 @@

- These traits identify what "kind" of type some type T is. These are split into two groups: + These traits identify what "kind" of type some type T is. These are split into two groups: primary traits which are all mutually exclusive, and composite traits that are compositions of one or more primary traits.

- For any given type, exactly one primary type trait will inherit from true_type, - and all the others will inherit from false_type, + For any given type, exactly one primary type trait will inherit from true_type, + and all the others will inherit from false_type, in other words these traits are mutually exclusive.

- This means that is_integral<T>::value - and is_floating_point<T>::value + This means that is_integral<T>::value + and is_floating_point<T>::value will only ever be true for built-in types; if you want to check for a user-defined class type that behaves "as if" it is an integral or floating - point type, then use the std::numeric_limits - template instead. + point type, then use the std::numeric_limits + template instead.

- Synopsis: + Synopsis:

 template <class T>
-struct is_array<T>;
+struct is_array<T>;
   
 template <class T>
-struct is_class<T>;
+struct is_class<T>;
 
 template <class T>
-struct is_complex<T>;
+struct is_complex<T>;
   
 template <class T>
-struct is_enum<T>;
+struct is_enum<T>;
   
 template <class T>
-struct is_floating_point<T>;
+struct is_floating_point<T>;
   
 template <class T>
-struct is_function<T>;
+struct is_function<T>;
 
 template <class T>
-struct is_integral<T>;
+struct is_integral<T>;
   
 template <class T>
-struct is_member_function_pointer<T>;
+struct is_member_function_pointer<T>;
   
 template <class T>
-struct is_member_object_pointer<T>;
+struct is_member_object_pointer<T>;
   
 template <class T>
-struct is_pointer<T>;
+struct is_pointer<T>;
   
 template <class T>
-struct is_reference<T>;
+struct is_reference<T>;
   
 template <class T>
-struct is_union<T>;
+struct is_union<T>;
   
 template <class T>
-struct is_void<T>;
+struct is_void<T>;
 

The following traits are made up of the union of one or more type categorizations. @@ -95,30 +101,34 @@

 template <class T>
-struct is_arithmetic;
+struct is_arithmetic;
 
 template <class T>
-struct is_compound;
+struct is_compound;
 
 template <class T>
-struct is_fundamental;
+struct is_fundamental;
 
 template <class T>
-struct is_member_pointer;
+struct is_member_pointer;
 
 template <class T>
-struct is_object;
+struct is_object;
 
 template <class T>
-struct is_scalar;
+struct is_scalar;
 
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/category/value_traits/properties.html b/doc/html/boost_typetraits/category/value_traits/properties.html index 41abd37..96e6482 100644 --- a/doc/html/boost_typetraits/category/value_traits/properties.html +++ b/doc/html/boost_typetraits/category/value_traits/properties.html @@ -1,13 +1,17 @@ -General Type Properties + + General Type Properties - + - - - + + + @@ -24,95 +28,103 @@

The following templates describe the general properties of a type.

- Synopsis: + Synopsis:

 template <class T>
-struct alignment_of;
+struct alignment_of;
 
 template <class T>
-struct has_nothrow_assign;
+struct has_nothrow_assign;
 
 template <class T>
-struct has_nothrow_constructor;
+struct has_nothrow_constructor;
 
 template <class T>
-struct has_nothrow_default_constructor;
+struct has_nothrow_default_constructor;
 
 template <class T>
-struct has_nothrow_copy;
+struct has_nothrow_copy;
 
 template <class T>
-struct has_nothrow_copy_constructor;
+struct has_nothrow_copy_constructor;
 
 template <class T>
-struct has_trivial_assign;
+struct has_trivial_assign;
 
 template <class T>
-struct has_trivial_constructor;
+struct has_trivial_constructor;
 
 template <class T>
-struct has_trivial_default_constructor;
+struct has_trivial_default_constructor;
 
 template <class T>
-struct has_trivial_copy;
+struct has_trivial_copy;
 
 template <class T>
-struct has_trivial_copy_constructor;
+struct has_trivial_copy_constructor;
 
 template <class T>
-struct has_trivial_destructor;
+struct has_trivial_destructor;
 
 template <class T>
-struct has_virtual_destructor;
+struct has_virtual_destructor;
 
 template <class T>
-struct is_abstract;
+struct is_abstract;
 
 template <class T>
-struct is_const;
+struct is_const;
 
 template <class T>
-struct is_empty;
+struct is_empty;
 
 template <class T>
-struct is_stateless;
+struct is_stateless;
 
 template <class T>
-struct is_pod;
+struct is_pod;
 
 template <class T>
-struct is_polymorphic;
+struct is_polymorphic;
 
 template <class T>
-struct is_signed;
+struct is_signed;
 
 template <class T>
-struct is_unsigned;
+struct is_unsigned;
 
 template <class T>
-struct is_volatile;
+struct is_volatile;
 
 template <class T, std::size_t N = 0>
-struct extent;
+struct extent;
 
 template <class T>
-struct rank;
+struct rank;
 
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/category/value_traits/relate.html b/doc/html/boost_typetraits/category/value_traits/relate.html index a6771fd..65ae0d5 100644 --- a/doc/html/boost_typetraits/category/value_traits/relate.html +++ b/doc/html/boost_typetraits/category/value_traits/relate.html @@ -1,13 +1,17 @@ -Relationships Between Two Types + Relationships + Between Two Types - + - - - + + + @@ -24,33 +28,37 @@

These templates determine the whether there is a relationship between two types:

- Synopsis: + Synopsis:

 template <class Base, class Derived>
-struct is_base_of;
+struct is_base_of;
 
 template <class From, class To>
-struct is_convertible;
+struct is_convertible;
 
 template <class T, class U>
-struct is_same;
+struct is_same;
 
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/credits.html b/doc/html/boost_typetraits/credits.html index 8127b84..ef9135e 100644 --- a/doc/html/boost_typetraits/credits.html +++ b/doc/html/boost_typetraits/credits.html @@ -1,12 +1,12 @@ -Credits + Credits - + - + @@ -23,8 +23,7 @@

This documentation was pulled together by John Maddock, using Boost.Quickbook and Boost.DocBook. @@ -49,7 +48,7 @@ Aleksey Gurtovoy added MPL integration to the library.

- The is_convertible + The is_convertible template is based on code originally devised by Andrei Alexandrescu, see "Generic<Programming>: Mappings between Types and Values".

@@ -61,10 +60,14 @@
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/examples.html b/doc/html/boost_typetraits/examples.html index 8e2a14f..232541b 100644 --- a/doc/html/boost_typetraits/examples.html +++ b/doc/html/boost_typetraits/examples.html @@ -1,13 +1,14 @@ -Examples + Examples - + - - + + @@ -24,8 +25,7 @@
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/examples/copy.html b/doc/html/boost_typetraits/examples/copy.html index 2372378..9ada6be 100644 --- a/doc/html/boost_typetraits/examples/copy.html +++ b/doc/html/boost_typetraits/examples/copy.html @@ -1,13 +1,15 @@ -An Optimized Version of std::copy + An Optimized Version + of std::copy - + - - - + + + @@ -24,13 +26,13 @@

- Demonstrates a version of std::copy - that uses has_trivial_assign - to determine whether to use memcpy + Demonstrates a version of std::copy + that uses has_trivial_assign + to determine whether to use memcpy to optimise the copy operation (see copy_example.cpp):

@@ -43,7 +45,7 @@
 namespace detail{
 
 template<typename I1, typename I2, bool b>
-I2 copy_imp(I1 first, I1 last, I2 out, const boost::integral_constant<bool, b>&)
+I2 copy_imp(I1 first, I1 last, I2 out, const boost::integral_constant<bool, b>&)
 {
    while(first != last)
    {
@@ -55,7 +57,7 @@
 }
 
 template<typename T>
-T* copy_imp(const T* first, const T* last, T* out, const boost::true_type&)
+T* copy_imp(const T* first, const T* last, T* out, const boost::true_type&)
 {
    memcpy(out, first, (last-first)*sizeof(T));
    return out+(last-first);
@@ -73,16 +75,20 @@
    // requirement we detect with overload resolution):
    //
    typedef typename std::iterator_traits<I1>::value_type value_type;
-   return detail::copy_imp(first, last, out, boost::has_trivial_assign<value_type>());
+   return detail::copy_imp(first, last, out, boost::has_trivial_assign<value_type>());
 }
 
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/examples/destruct.html b/doc/html/boost_typetraits/examples/destruct.html index 96cfdf2..2a3d2d4 100644 --- a/doc/html/boost_typetraits/examples/destruct.html +++ b/doc/html/boost_typetraits/examples/destruct.html @@ -1,13 +1,16 @@ -An Example that Omits Destructor Calls For Types with Trivial Destructors + An Example that + Omits Destructor Calls For Types with Trivial Destructors - + - - - + + + @@ -24,11 +27,11 @@

- Demonstrates a simple algorithm that uses __has_trivial_destruct + Demonstrates a simple algorithm that uses __has_trivial_destruct to determine whether to destructors need to be called (see trivial_destructor_example.cpp):

@@ -41,7 +44,7 @@
 namespace detail{
 
 template <class T>
-void do_destroy_array(T* first, T* last, const boost::false_type&)
+void do_destroy_array(T* first, T* last, const boost::false_type&)
 {
    while(first != last)
    {
@@ -51,7 +54,7 @@
 }
 
 template <class T>
-inline void do_destroy_array(T* first, T* last, const boost::true_type&)
+inline void do_destroy_array(T* first, T* last, const boost::true_type&)
 {
 }
 
@@ -60,16 +63,20 @@
 template <class T>
 inline void destroy_array(T* p1, T* p2)
 {
-   detail::do_destroy_array(p1, p2, ::boost::has_trivial_destructor<T>());
+   detail::do_destroy_array(p1, p2, ::boost::has_trivial_destructor<T>());
 }
 
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/examples/fill.html b/doc/html/boost_typetraits/examples/fill.html index f190a28..48d62c6 100644 --- a/doc/html/boost_typetraits/examples/fill.html +++ b/doc/html/boost_typetraits/examples/fill.html @@ -1,13 +1,16 @@ -An Optimised Version of std::fill + An Optimised Version + of std::fill - + - - - + + + @@ -24,13 +27,13 @@

- Demonstrates a version of std::fill - that uses has_trivial_assign - to determine whether to use memset + Demonstrates a version of std::fill + that uses has_trivial_assign + to determine whether to use memset to optimise the fill operation (see fill_example.cpp):

@@ -41,7 +44,7 @@
 namespace detail{
 
 template <typename I, typename T, bool b>
-void do_fill(I first, I last, const T& val, const boost::integral_constant<bool, b>&)
+void do_fill(I first, I last, const T& val, const boost::integral_constant<bool, b>&)
 {
    while(first != last)
    {
@@ -51,7 +54,7 @@
 }
 
 template <typename T>
-void do_fill(T* first, T* last, const T& val, const boost::true_type&)
+void do_fill(T* first, T* last, const T& val, const boost::true_type&)
 {
    std::memset(first, val, last-first);
 }
@@ -65,18 +68,22 @@
    // We can do an optimised fill if T has a trivial assignment 
    // operator and if it's size is one:
    //
-   typedef boost::integral_constant<bool, 
-      ::boost::has_trivial_assign<T>::value && (sizeof(T) == 1)> truth_type;
+   typedef boost::integral_constant<bool, 
+      ::boost::has_trivial_assign<T>::value && (sizeof(T) == 1)> truth_type;
    detail::do_fill(first, last, val, truth_type());
 }
 
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/examples/iter.html b/doc/html/boost_typetraits/examples/iter.html index 615796a..7573ba9 100644 --- a/doc/html/boost_typetraits/examples/iter.html +++ b/doc/html/boost_typetraits/examples/iter.html @@ -1,13 +1,16 @@ -An improved Version of std::iter_swap + An improved Version + of std::iter_swap - + - - - + + + @@ -24,14 +27,14 @@

- Demonstrates a version of std::iter_swap + Demonstrates a version of std::iter_swap that use type traits to determine whether an it's arguments are proxying - iterators or not, if they're not then it just does a std::swap - of it's dereferenced arguments (the same as std::iter_swap + iterators or not, if they're not then it just does a std::swap + of it's dereferenced arguments (the same as std::iter_swap does), however if they are proxying iterators then takes special care over the swap to ensure that the algorithm works correctly for both proxying iterators, and even iterators of different types (see iter_swap_example.cpp): @@ -45,7 +48,7 @@ namespace detail{ template <typename I> -static void do_swap(I one, I two, const boost::false_type&) +static void do_swap(I one, I two, const boost::false_type&) { typedef typename std::iterator_traits<I>::value_type v_t; v_t v = *one; @@ -53,7 +56,7 @@ *two = v; } template <typename I> -static void do_swap(I one, I two, const boost::true_type&) +static void do_swap(I one, I two, const boost::true_type&) { using std::swap; swap(*one, *two); @@ -71,10 +74,10 @@ typedef typename std::iterator_traits<I1>::reference r1_t; typedef typename std::iterator_traits<I2>::reference r2_t; - typedef boost::integral_constant<bool, - ::boost::is_reference<r1_t>::value - && ::boost::is_reference<r2_t>::value - && ::boost::is_same<r1_t, r2_t>::value> truth_type; + typedef boost::integral_constant<bool, + ::boost::is_reference<r1_t>::value + && ::boost::is_reference<r2_t>::value + && ::boost::is_same<r1_t, r2_t>::value> truth_type; detail::do_swap(one, two, truth_type()); } @@ -82,10 +85,14 @@

- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/examples/to_double.html b/doc/html/boost_typetraits/examples/to_double.html index 72c69a9..6cac92b 100644 --- a/doc/html/boost_typetraits/examples/to_double.html +++ b/doc/html/boost_typetraits/examples/to_double.html @@ -1,13 +1,15 @@ -Convert Numeric Types and Enums to double + Convert Numeric + Types and Enums to double - + - - - + + + @@ -24,9 +26,9 @@

Demonstrates a conversion of Numeric Types and enum types to double: @@ -42,10 +44,14 @@

- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/intrinsics.html b/doc/html/boost_typetraits/intrinsics.html index 1f21924..acc298b 100644 --- a/doc/html/boost_typetraits/intrinsics.html +++ b/doc/html/boost_typetraits/intrinsics.html @@ -1,13 +1,13 @@ -Support for Compiler Intrinsics + Support for Compiler Intrinsics - + - - + + @@ -24,8 +24,7 @@

There are some traits that can not be implemented within the current C++ language: to make these traits "just work" with user defined types, some kind @@ -38,16 +37,18 @@ for all types (but all have safe fallback positions if this support is unavailable):

The following traits classes can't be portably implemented in the C++ language, @@ -55,15 +56,15 @@ all the compilers we know about:

The following traits classes are dependent on one or more of the above:

The hooks for compiler-intrinsic support are defined in boost/type_traits/intrinsics.hpp, @@ -71,8 +72,8 @@ of the following macros:

-

Table 1.4. Macros for Compiler Intrinsics

-
+

Table 1.4. Macros for Compiler Intrinsics

+
@@ -174,8 +175,8 @@ @@ -188,7 +189,7 @@ @@ -200,11 +201,11 @@ @@ -221,16 +222,19 @@ -

- Should evaluate to true if T - x; + Should evaluate to true if T + x; can not throw

- Should evaluate to true if T(t) can not throw + Should evaluate to true if T(t) can not throw

- Should evaluate to true if T + Should evaluate to true if T t, u; t = - u can not throw + u can not throw

+
-
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/intro.html b/doc/html/boost_typetraits/intro.html index a4582fe..df2f346 100644 --- a/doc/html/boost_typetraits/intro.html +++ b/doc/html/boost_typetraits/intro.html @@ -1,13 +1,13 @@ -Introduction + Introduction - + - + @@ -24,8 +24,7 @@

The Boost type-traits library contains a set of very specific traits classes, each of which encapsulate a single trait from the C++ type system; for example, @@ -34,24 +33,28 @@

The type-traits classes share a unified design: each class inherits from a - the type true_type - if the type has the specified property and inherits from false_type + the type true_type + if the type has the specified property and inherits from false_type otherwise.

The type-traits library also contains a set of classes that perform a specific transformation on a type; for example, they can remove a top-level const or volatile qualifier from a type. Each class that performs a transformation defines - a single typedef-member type + a single typedef-member type that is the result of the transformation.

- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/mpl.html b/doc/html/boost_typetraits/mpl.html index f6b8b84..e4d5ae0 100644 --- a/doc/html/boost_typetraits/mpl.html +++ b/doc/html/boost_typetraits/mpl.html @@ -1,13 +1,13 @@ -MPL Interoperability + MPL Interoperability - + - - + + @@ -24,8 +24,7 @@

All the value based traits in this library conform to MPL's requirements for an Integral @@ -33,22 +32,26 @@ for broken compilers.

- Purely as an implementation detail, this means that true_type - inherits from boost::mpl::true_, - false_type - inherits from boost::mpl::false_, - and integral_constant<T, - v> - inherits from boost::mpl::integral_c<T,v> - (provided T is not bool) + Purely as an implementation detail, this means that true_type + inherits from boost::mpl::true_, + false_type + inherits from boost::mpl::false_, + and integral_constant<T, + v> + inherits from boost::mpl::integral_c<T,v> + (provided T is not bool)

- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/reference.html b/doc/html/boost_typetraits/reference.html index 886db8c..3512f1e 100644 --- a/doc/html/boost_typetraits/reference.html +++ b/doc/html/boost_typetraits/reference.html @@ -1,13 +1,14 @@ -Alphabetical Reference + Alphabetical Reference - + - - + + @@ -24,8 +25,7 @@
add_const
add_cv
@@ -104,10 +104,14 @@
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/reference/add_const.html b/doc/html/boost_typetraits/reference/add_const.html index 6edf188..01782bd 100644 --- a/doc/html/boost_typetraits/reference/add_const.html +++ b/doc/html/boost_typetraits/reference/add_const.html @@ -1,13 +1,13 @@ -add_const + add_const - + - - - + + + @@ -24,38 +24,37 @@
 template <class T>
 struct add_const
 {
-   typedef see-below type;
+   typedef see-below type;
 };
 

- type: The same type as T - const for all T. + type: The same type as T + const for all T.

- C++ Standard Reference: 3.9.3. + C++ Standard Reference: 3.9.3.

- Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

- Header: #include - <boost/type_traits/add_const.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/add_const.hpp> + or #include <boost/type_traits.hpp>

-

Table 1.5. Examples

-
+

Table 1.5. Examples

+
@@ -76,63 +75,66 @@ -

- add_const<int>::type + add_const<int>::type

- int const + int const

- add_const<int&>::type + add_const<int&>::type

- int& + int&

- add_const<int*>::type + add_const<int*>::type

- int* - const + int* + const

- add_const<int const>::type + add_const<int const>::type

- int const + int const

+
-
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/reference/add_cv.html b/doc/html/boost_typetraits/reference/add_cv.html index 9eb7c37..22249d5 100644 --- a/doc/html/boost_typetraits/reference/add_cv.html +++ b/doc/html/boost_typetraits/reference/add_cv.html @@ -1,13 +1,13 @@ -add_cv + add_cv - + - - - + + + @@ -24,39 +24,38 @@
 template <class T>
 struct add_cv
 {
-   typedef see-below type;
+   typedef see-below type;
 };
 

- type: The same type as T - const volatile - for all T. + type: The same type as T + const volatile + for all T.

- C++ Standard Reference: 3.9.3. + C++ Standard Reference: 3.9.3.

- Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

- Header: #include - <boost/type_traits/add_cv.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/add_cv.hpp> + or #include <boost/type_traits.hpp>

-

Table 1.6. Examples

-
+

Table 1.6. Examples

+
@@ -77,65 +76,68 @@ -

- add_cv<int>::type + add_cv<int>::type

- int const - volatile + int const + volatile

- add_cv<int&>::type + add_cv<int&>::type

- int& + int&

- add_cv<int*>::type + add_cv<int*>::type

- int* - const volatile + int* + const volatile

- add_cv<int const>::type + add_cv<int const>::type

- int const - volatile + int const + volatile

+
-
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/reference/add_pointer.html b/doc/html/boost_typetraits/reference/add_pointer.html index fac8b58..6c46a15 100644 --- a/doc/html/boost_typetraits/reference/add_pointer.html +++ b/doc/html/boost_typetraits/reference/add_pointer.html @@ -1,13 +1,13 @@ -add_pointer + add_pointer - + - - - + + + @@ -24,41 +24,40 @@
 template <class T>
 struct add_pointer
 {
-   typedef see-below type;
+   typedef see-below type;
 };
 

- type: The same type as remove_reference<T>::type*. + type: The same type as remove_reference<T>::type*.

- The rationale for this template is that it produces the same type as TYPEOF(&t), where - t is an object of type T. + The rationale for this template is that it produces the same type as TYPEOF(&t), where + t is an object of type T.

- C++ Standard Reference: 8.3.1. + C++ Standard Reference: 8.3.1.

- Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

- Header: #include - <boost/type_traits/add_pointer.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/add_pointer.hpp> + or #include <boost/type_traits.hpp>

-

Table 1.7. Examples

-
+

Table 1.7. Examples

+
@@ -79,62 +78,65 @@ -

- add_pointer<int>::type + add_pointer<int>::type

- int* + int*

- add_pointer<int const&>::type + add_pointer<int const&>::type

- int const* + int const*

- add_pointer<int*>::type + add_pointer<int*>::type

- int** + int**

- add_pointer<int*&>::type + add_pointer<int*&>::type

- int** + int**

+
-
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/reference/add_reference.html b/doc/html/boost_typetraits/reference/add_reference.html index 3a99d5b..9d48aa3 100644 --- a/doc/html/boost_typetraits/reference/add_reference.html +++ b/doc/html/boost_typetraits/reference/add_reference.html @@ -1,13 +1,13 @@ -add_reference + add_reference - + - - - + + + @@ -24,38 +24,37 @@
 template <class T>
 struct add_reference
 {
-   typedef see-below type;
+   typedef see-below type;
 };
 

- type: If T - is not a reference type then T&, otherwise T. + type: If T + is not a reference type then T&, otherwise T.

- C++ Standard Reference: 8.3.2. + C++ Standard Reference: 8.3.2.

- Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

- Header: #include - <boost/type_traits/add_reference.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/add_reference.hpp> + or #include <boost/type_traits.hpp>

-

Table 1.8. Examples

-
+

Table 1.8. Examples

+
@@ -76,62 +75,65 @@ -

- add_reference<int>::type + add_reference<int>::type

- int& + int&

- add_reference<int const&>::type + add_reference<int const&>::type

- int const& + int const&

- add_reference<int*>::type + add_reference<int*>::type

- int*& + int*&

- add_reference<int*&>::type + add_reference<int*&>::type

- int*& + int*&

+
-
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/reference/add_volatile.html b/doc/html/boost_typetraits/reference/add_volatile.html index 0806c65..c11e104 100644 --- a/doc/html/boost_typetraits/reference/add_volatile.html +++ b/doc/html/boost_typetraits/reference/add_volatile.html @@ -1,13 +1,13 @@ -add_volatile + add_volatile - + - - - + + + @@ -24,38 +24,37 @@
 template <class T>
 struct add_volatile
 {
-   typedef see-below type;
+   typedef see-below type;
 };
 

- type: The same type as T - volatile for all T. + type: The same type as T + volatile for all T.

- C++ Standard Reference: 3.9.3. + C++ Standard Reference: 3.9.3.

- Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

- Header: #include - <boost/type_traits/add_volatile.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/add_volatile.hpp> + or #include <boost/type_traits.hpp>

-

Table 1.9. Examples

-
+

Table 1.9. Examples

+
@@ -76,64 +75,67 @@ -

- add_volatile<int>::type + add_volatile<int>::type

- int volatile + int volatile

- add_volatile<int&>::type + add_volatile<int&>::type

- int& + int&

- add_volatile<int*>::type + add_volatile<int*>::type

- int* - volatile + int* + volatile

- add_volatile<int const>::type + add_volatile<int const>::type

- int const - volatile + int const + volatile

+
-
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/reference/aligned_storage.html b/doc/html/boost_typetraits/reference/aligned_storage.html index aa941c3..9521fbb 100644 --- a/doc/html/boost_typetraits/reference/aligned_storage.html +++ b/doc/html/boost_typetraits/reference/aligned_storage.html @@ -1,13 +1,13 @@ -aligned_storage + aligned_storage - + - - - + + + @@ -24,32 +24,35 @@
 template <std::size_t Size, std::size_t Align>
 struct aligned_storage
 {
-   typedef see-below type;
+   typedef see-below type;
 };
 

- type: a built-in or POD type with size - Size and an alignment that - is a multiple of Align. + type: a built-in or POD type with size + Size and an alignment that + is a multiple of Align.

- Header: #include - <boost/type_traits/aligned_storage.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/aligned_storage.hpp> + or #include <boost/type_traits.hpp>

- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/reference/alignment_of.html b/doc/html/boost_typetraits/reference/alignment_of.html index 912b9a5..c089b70 100644 --- a/doc/html/boost_typetraits/reference/alignment_of.html +++ b/doc/html/boost_typetraits/reference/alignment_of.html @@ -1,13 +1,13 @@ -alignment_of + alignment_of - + - - - + + + @@ -24,36 +24,35 @@
 template <class T>
-struct alignment_of : public integral_constant<std::size_t, ALIGNOF(T)> {};
+struct alignment_of : public integral_constant<std::size_t, ALIGNOF(T)> {};
 

- Inherits: Class template alignmentof inherits from `_integral_constant<std::size_t, - ALIGNOF(T)>, where - ALIGNOF(T)` is the alignment of type T. + Inherits: Class template alignmentof inherits from `_integral_constant<std::size_t, + ALIGNOF(T)>, where + ALIGNOF(T)` is the alignment of type T.

- Note: strictly speaking you should only rely on the value of ALIGNOF(T) being + Note: strictly speaking you should only rely on the value of ALIGNOF(T) being a multiple of the true alignment of T, although in practice it does compute the correct value in all the cases we know about.

- Header: #include - <boost/type_traits/alignment_of.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/alignment_of.hpp> + or #include <boost/type_traits.hpp>

- Examples: + Examples:

- alignment_of<int> - inherits from integral_constant<std::size_t, ALIGNOF(int)>. + alignment_of<int> + inherits from integral_constant<std::size_t, ALIGNOF(int)>.

@@ -62,7 +61,7 @@

- alignment_of<char>::type is the type integral_constant<std::size_t, ALIGNOF(char)>. + alignment_of<char>::type is the type integral_constant<std::size_t, ALIGNOF(char)>.

@@ -71,8 +70,8 @@

- alignment_of<double>::value is an integral constant expression - with value ALIGNOF(double). + alignment_of<double>::value is an integral constant expression + with value ALIGNOF(double).

@@ -81,7 +80,7 @@

- alignment_of<T>::value_type is the type std::size_t. + alignment_of<T>::value_type is the type std::size_t.

@@ -89,10 +88,14 @@
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/reference/decay.html b/doc/html/boost_typetraits/reference/decay.html index 25a099a..c6b24d0 100644 --- a/doc/html/boost_typetraits/reference/decay.html +++ b/doc/html/boost_typetraits/reference/decay.html @@ -1,13 +1,13 @@ -decay + decay - + - - - + + + @@ -24,33 +24,32 @@
 template <class T>
 struct decay
 {
-   typedef see-below type;
+   typedef see-below type;
 };
 

- type: Let U - be the result of remove_reference<T>::type, then if U - is an array type, the result is remove_extent<U>*, - otherwise if U is a function - type then the result is U*, otherwise the result is U. + type: Let U + be the result of remove_reference<T>::type, then if U + is an array type, the result is remove_extent<U>*, + otherwise if U is a function + type then the result is U*, otherwise the result is U.

- C++ Standard Reference: 3.9.1. + C++ Standard Reference: 3.9.1.

- Header: #include - <boost/type_traits/decay.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/decay.hpp> + or #include <boost/type_traits.hpp>

-

Table 1.10. Examples

-
+

Table 1.10. Examples

+
@@ -71,74 +70,77 @@ -

- decay<int[2][3]>::type + decay<int[2][3]>::type

- int[2]* + int[2]*

- decay<int(&)[2]>::type + decay<int(&)[2]>::type

- int* + int*

- decay<int(&)(double)>::type + decay<int(&)(double)>::type

- int(*)(double) + int(*)(double)

- int(*)(double + int(*)(double

- int(*)(double) + int(*)(double)

- int(double) + int(double)

- int(*)(double) + int(*)(double)

+
-
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/reference/extent.html b/doc/html/boost_typetraits/reference/extent.html index 00f661d..841df98 100644 --- a/doc/html/boost_typetraits/reference/extent.html +++ b/doc/html/boost_typetraits/reference/extent.html @@ -1,13 +1,14 @@ -extent + extent - + - - - + + + @@ -24,37 +25,36 @@
 template <class T, std::size_t N = 0>
-struct extent : public integral_constant<std::size_t, EXTENT(T,N)> {};
+struct extent : public integral_constant<std::size_t, EXTENT(T,N)> {};
 

- Inherits: Class template extent inherits - from integral_constant<std::size_t, EXTENT(T,N)>, - where EXTENT(T,N) is the number of elements in the N'th array - dimention of type T. + Inherits: Class template extent inherits + from integral_constant<std::size_t, EXTENT(T,N)>, + where EXTENT(T,N) is the number of elements in the N'th array + dimention of type T.

- If T is not an array type, - or if N > - rank<T>::value, or if the N'th array bound is incomplete, - then EXTENT(T,N) is zero. + If T is not an array type, + or if N > + rank<T>::value, or if the N'th array bound is incomplete, + then EXTENT(T,N) is zero.

- Header: #include - <boost/type_traits/extent.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/extent.hpp> + or #include <boost/type_traits.hpp>

- Examples: + Examples:

- extent<int[1]> inherits from integral_constant<std::size_t, 1>. + extent<int[1]> inherits from integral_constant<std::size_t, 1>.

@@ -63,8 +63,8 @@

- extent<double[2][3][4], - 1>::type is the type integral_constant<std::size_t, 3>. + extent<double[2][3][4], + 1>::type is the type integral_constant<std::size_t, 3>.

@@ -73,7 +73,7 @@

- extent<int[4]>::value + extent<int[4]>::value is an integral constant expression that evaluates to 4.

@@ -83,7 +83,7 @@

- extent<int[][2]>::value is an integral constant expression + extent<int[][2]>::value is an integral constant expression that evaluates to 0.

@@ -93,7 +93,7 @@

- extent<int[][2], 1>::value + extent<int[][2], 1>::value is an integral constant expression that evaluates to 2.

@@ -103,7 +103,7 @@

- extent<int*>::value is an integral constant expression + extent<int*>::value is an integral constant expression that evaluates to 0.

@@ -113,7 +113,7 @@

- extent<T>::value_type is the type std::size_t. + extent<T>::value_type is the type std::size_t.

@@ -121,10 +121,14 @@
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/reference/floating_point_promotion.html b/doc/html/boost_typetraits/reference/floating_point_promotion.html index 9f7cfc7..45b057b 100644 --- a/doc/html/boost_typetraits/reference/floating_point_promotion.html +++ b/doc/html/boost_typetraits/reference/floating_point_promotion.html @@ -1,13 +1,14 @@ -floating_point_promotion + + floating_point_promotion - + - - - + + + @@ -24,34 +25,34 @@
 template <class T>
 struct floating_point_promotion
 {
-   typedef see-below type;
+   typedef see-below type;
 };
 

- type: If floating point promotion can be - applied to an rvalue of type T, - then applies floating point promotion to T - and keeps cv-qualifiers of T, - otherwise leaves T unchanged. + type: If floating point promotion can be + applied to an rvalue of type T, + then applies floating point promotion to T + and keeps cv-qualifiers of T, + otherwise leaves T unchanged.

- C++ Standard Reference: 4.6. + C++ Standard Reference: 4.6.

- Header: #include - <boost/type_traits/floating_point_promotion.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/floating_point_promotion.hpp> + or #include <boost/type_traits.hpp>

-

Table 1.11. Examples

-
+

Table 1.11. Examples

+
@@ -72,51 +73,54 @@ -

- floating_point_promotion<float - const>::type + floating_point_promotion<float + const>::type

- double const + double const

- floating_point_promotion<float&>::type + floating_point_promotion<float&>::type

- float& + float&

- floating_point_promotion<short>::type + floating_point_promotion<short>::type

- short + short

+
-
- + Ramey and Jeremy Siek

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

diff --git a/doc/html/boost_typetraits/reference/function_traits.html b/doc/html/boost_typetraits/reference/function_traits.html index cffc73d..0e0a357 100644 --- a/doc/html/boost_typetraits/reference/function_traits.html +++ b/doc/html/boost_typetraits/reference/function_traits.html @@ -1,13 +1,14 @@ -function_traits + function_traits - + - - - + + + @@ -24,15 +25,14 @@
 template <class T>
 struct function_traits
 {
-   static const std::size_t    arity = see-below;
-   typedef see-below           result_type;
-   typedef see-below           argN_type; 
+   static const std::size_t    arity = see-below;
+   typedef see-below           result_type;
+   typedef see-below           argN_type; 
 };
 

@@ -43,8 +43,8 @@ The compiler supports partial specialization of class templates.

  • - The template argument T - is a function type, note that this is not the same thing as a pointer + The template argument T + is a function type, note that this is not the same thing as a pointer to a function.
  • @@ -53,15 +53,15 @@ -
    [Tip] Tip

    +

    function_traits is intended to introspect only C++ functions of the form R (), R( A1 ), R ( A1, ... etc. ) and not function pointers or class member - functions. To convert a function pointer type to a suitable type use remove_pointer. + functions. To convert a function pointer type to a suitable type use remove_pointer.

    -

    Table 1.12. Function Traits Members

    -
    +

    Table 1.12. Function Traits Members

    +
    @@ -82,49 +82,49 @@ -

    - function_traits<T>::arity + function_traits<T>::arity

    An integral constant expression that gives the number of arguments - accepted by the function type F. + accepted by the function type F.

    - function_traits<T>::result_type + function_traits<T>::result_type

    - The type returned by function type F. + The type returned by function type F.

    - function_traits<T>::argN_type + function_traits<T>::argN_type

    - The Nth argument type of function type F, - where 1 <= + The Nth argument type of function type F, + where 1 <= N <= - arity of F. + arity of F.

    +
    -
    -

    Table 1.13. Examples

    -
    +
    +

    Table 1.13. Examples

    +
    @@ -145,7 +145,7 @@ @@ -242,7 +242,7 @@ -

    - function_traits<void (void)>::arity + function_traits<void (void)>::arity

    @@ -157,7 +157,7 @@

    - function_traits<long (int)>::arity + function_traits<long (int)>::arity

    @@ -169,7 +169,7 @@

    - function_traits<long (int, long, double, void*)>::arity + function_traits<long (int, long, double, void*)>::arity

    @@ -181,60 +181,60 @@

    - function_traits<void (void)>::result_type + function_traits<void (void)>::result_type

    - The type void. + The type void.

    - function_traits<long (int)>::result_type + function_traits<long (int)>::result_type

    - The type long. + The type long.

    - function_traits<long (int)>::arg1_type + function_traits<long (int)>::arg1_type

    - The type int. + The type int.

    - function_traits<long (int, long, double, void*)>::arg4_type + function_traits<long (int, long, double, void*)>::arg4_type

    - The type void*. + The type void*.

    - function_traits<long (int, long, double, void*)>::arg5_type + function_traits<long (int, long, double, void*)>::arg5_type

    - A compiler error: there is no arg4_type + A compiler error: there is no arg4_type since there are only three arguments.

    - function_traits<long (*)(void)>::arity + function_traits<long (*)(void)>::arity

    @@ -253,16 +253,19 @@
    +
    -
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/has_no_throw_def_cons.html b/doc/html/boost_typetraits/reference/has_no_throw_def_cons.html index 14f93b2..16ef48b 100644 --- a/doc/html/boost_typetraits/reference/has_no_throw_def_cons.html +++ b/doc/html/boost_typetraits/reference/has_no_throw_def_cons.html @@ -1,13 +1,13 @@ -has_nothrow_default_constructor + has_nothrow_default_constructor - + - - - + + + @@ -24,18 +24,22 @@

    - See has_nothrow_constructor. + See has_nothrow_constructor.

    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/has_nothrow_assign.html b/doc/html/boost_typetraits/reference/has_nothrow_assign.html index da5eeb0..55d9259 100644 --- a/doc/html/boost_typetraits/reference/has_nothrow_assign.html +++ b/doc/html/boost_typetraits/reference/has_nothrow_assign.html @@ -1,13 +1,14 @@ -has_nothrow_assign + has_nothrow_assign - + - - - + + + @@ -24,43 +25,46 @@
     template <class T>
    -struct has_nothrow_assign : public true_type-or-false_type {};
    +struct has_nothrow_assign : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - type with a non-throwing assignment-operator then inherits from true_type, - otherwise inherits from false_type. - Type T must be a complete + Inherits: If T is a (possibly cv-qualified) + type with a non-throwing assignment-operator then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete type.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: 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, has_nothrow_assign + Without some (as yet unspecified) help from the compiler, has_nothrow_assign will never report that a class or struct has a non-throwing assignment-operator; this is always safe, if possibly sub-optimal. Currently (May 2005) only Visual C++ 8 has the necessary compiler support to ensure that this trait "just works".

    - Header: #include - <boost/type_traits/has_nothrow_assign.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/has_nothrow_assign.hpp> + or #include <boost/type_traits.hpp>

    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/has_nothrow_constructor.html b/doc/html/boost_typetraits/reference/has_nothrow_constructor.html index aaf1cad..7ad0ce3 100644 --- a/doc/html/boost_typetraits/reference/has_nothrow_constructor.html +++ b/doc/html/boost_typetraits/reference/has_nothrow_constructor.html @@ -1,13 +1,14 @@ -has_nothrow_constructor + + has_nothrow_constructor - + - - - + + + @@ -24,50 +25,54 @@
     template <class T>
    -struct has_nothrow_constructor : public true_type-or-false_type {};
    +struct has_nothrow_constructor : public true_type-or-false_type {};
     
     template <class T>
    -struct has_nothrow_default_constructor : public true_type-or-false_type {};
    +struct has_nothrow_default_constructor : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - type with a non-throwing default-constructor then inherits from true_type, - otherwise inherits from false_type. - Type T must be a complete + Inherits: If T is a (possibly cv-qualified) + type with a non-throwing default-constructor then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete type.

    These two traits are synonyms for each other.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: 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, has_nothrow_constructor + Without some (as yet 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 + C++ 8 has the necessary compiler intrinsics to ensure that this trait "just works".

    - Header: #include - <boost/type_traits/has_nothrow_constructor.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/has_nothrow_constructor.hpp> + or #include <boost/type_traits.hpp>

    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/has_nothrow_copy.html b/doc/html/boost_typetraits/reference/has_nothrow_copy.html index 7ed412e..72e6967 100644 --- a/doc/html/boost_typetraits/reference/has_nothrow_copy.html +++ b/doc/html/boost_typetraits/reference/has_nothrow_copy.html @@ -1,13 +1,14 @@ -has_nothrow_copy + has_nothrow_copy - + - - - + + + @@ -24,49 +25,52 @@
     template <class T>
    -struct has_nothrow_copy : public true_type-or-false_type {};
    +struct has_nothrow_copy : public true_type-or-false_type {};
     
     template <class T>
    -struct has_nothrow_copy_constructor : public true_type-or-false_type {};
    +struct has_nothrow_copy_constructor : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - type with a non-throwing copy-constructor then inherits from true_type, - otherwise inherits from false_type. - Type T must be a complete + Inherits: If T is a (possibly cv-qualified) + type with a non-throwing copy-constructor then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete type.

    These two traits are synonyms for each other.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: 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, has_nothrow_copy + 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 + C++ 8 has the necessary compiler intrinsics to ensure that this trait "just works".

    - Header: #include - <boost/type_traits/has_nothrow_copy.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/has_nothrow_copy.hpp> + or #include <boost/type_traits.hpp>

    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/has_nothrow_cp_cons.html b/doc/html/boost_typetraits/reference/has_nothrow_cp_cons.html index aa732b8..ee57829 100644 --- a/doc/html/boost_typetraits/reference/has_nothrow_cp_cons.html +++ b/doc/html/boost_typetraits/reference/has_nothrow_cp_cons.html @@ -1,13 +1,13 @@ -has_nothrow_copy_constructor + has_nothrow_copy_constructor - + - - - + + + @@ -24,18 +24,21 @@

    - See has_nothrow_copy. + See has_nothrow_copy.

    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/has_trivial_assign.html b/doc/html/boost_typetraits/reference/has_trivial_assign.html index 6d2fe1b..88ced5d 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_assign.html +++ b/doc/html/boost_typetraits/reference/has_trivial_assign.html @@ -1,13 +1,14 @@ -has_trivial_assign + has_trivial_assign - + - - - + + + @@ -24,24 +25,23 @@
     template <class T>
    -struct has_trivial_assign : public true_type-or-false_type {};
    +struct has_trivial_assign : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - type with a trivial assignment-operator then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + type with a trivial assignment-operator then inherits from true_type, + otherwise inherits from false_type.

    If a type has a trivial assignment-operator then the operator has the same effect as copying the bits of one object to the other: calls to the operator - can be safely replaced with a call to memcpy. + can be safely replaced with a call to memcpy.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template can not be used with function types.

    @@ -49,26 +49,26 @@ 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 + 9 and Visual C++ 8 have the necessary compiler intrinsics to detect user-defined classes with trivial constructors.

    - C++ Standard Reference: 12.8p11. + C++ Standard Reference: 12.8p11.

    - Header: #include - <boost/type_traits/has_trivial_assign.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/has_trivial_assign.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - has_trivial_assign<int> - inherits from true_type. + has_trivial_assign<int> + inherits from true_type.

    @@ -77,7 +77,7 @@

    - has_trivial_assign<char*>::type is the type true_type. + has_trivial_assign<char*>::type is the type true_type.

    @@ -86,7 +86,7 @@

    - has_trivial_assign<int (*)(long)>::value is an integral constant expression + has_trivial_assign<int (*)(long)>::value is an integral constant expression that evaluates to true.

    @@ -96,7 +96,7 @@

    - has_trivial_assign<MyClass>::value is an integral constant expression + has_trivial_assign<MyClass>::value is an integral constant expression that evaluates to false.

    @@ -106,7 +106,7 @@

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

    @@ -114,10 +114,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/has_trivial_constructor.html b/doc/html/boost_typetraits/reference/has_trivial_constructor.html index 95cf0e8..9e59ba2 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_constructor.html +++ b/doc/html/boost_typetraits/reference/has_trivial_constructor.html @@ -1,13 +1,14 @@ -has_trivial_constructor + + has_trivial_constructor - + - - - + + + @@ -24,20 +25,20 @@
     template <class T>
    -struct has_trivial_constructor : public true_type-or-false_type {};
    +struct has_trivial_constructor : public true_type-or-false_type {};
     
     template <class T>
    -struct has_trivial_default_constructor : public true_type-or-false_type {};
    +struct has_trivial_default_constructor : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - type with a trivial default-constructor then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + type with a trivial default-constructor then inherits from true_type, + otherwise inherits from false_type.

    These two traits are synonyms for each other. @@ -50,7 +51,7 @@ some benefit in terms of code size and speed can be obtained.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template can not be used with function types.

    @@ -58,25 +59,25 @@ 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 + 9 and Visual C++ 8 have the necessary compiler intrinsics to detect user-defined classes with trivial constructors.

    - C++ Standard Reference: 12.1p6. + C++ Standard Reference: 12.1p6.

    - Header: #include - <boost/type_traits/has_trivial_constructor.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/has_trivial_constructor.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - has_trivial_constructor<int> inherits from true_type. + has_trivial_constructor<int> inherits from true_type.

    @@ -85,8 +86,8 @@

    - has_trivial_constructor<char*>::type - is the type true_type. + has_trivial_constructor<char*>::type + is the type true_type.

    @@ -95,7 +96,7 @@

    - has_trivial_constructor<int (*)(long)>::value + has_trivial_constructor<int (*)(long)>::value is an integral constant expression that evaluates to true.

    @@ -105,7 +106,7 @@

    - has_trivial_constructor<MyClass>::value + has_trivial_constructor<MyClass>::value is an integral constant expression that evaluates to false.

    @@ -115,8 +116,8 @@

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

    @@ -124,10 +125,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/has_trivial_copy.html b/doc/html/boost_typetraits/reference/has_trivial_copy.html index 59bff4f..566ac98 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_copy.html +++ b/doc/html/boost_typetraits/reference/has_trivial_copy.html @@ -1,13 +1,14 @@ -has_trivial_copy + has_trivial_copy - + - - - + + + @@ -24,19 +25,18 @@
     template <class T>
    -struct has_trivial_copy : public true_type-or-false_type {};
    +struct has_trivial_copy : public true_type-or-false_type {};
     
     template <class T>
    -struct has_trivial_copy_constructor : public true_type-or-false_type {};
    +struct has_trivial_copy_constructor : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - type with a trivial copy-constructor then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + type with a trivial copy-constructor then inherits from true_type, + otherwise inherits from false_type.

    These two traits are synonyms for each other. @@ -44,10 +44,10 @@

    If a type has a trivial copy-constructor then the constructor has the same effect as copying the bits of one object to the other: calls to the constructor - can be safely replaced with a call to memcpy. + can be safely replaced with a call to memcpy.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template can not be used with function types.

    @@ -55,26 +55,26 @@ 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 + 9 and Visual C++ 8 have the necessary compiler intrinsics to detect user-defined classes with trivial constructors.

    - C++ Standard Reference: 12.8p6. + C++ Standard Reference: 12.8p6.

    - Header: #include - <boost/type_traits/has_trivial_copy.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/has_trivial_copy.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - has_trivial_copy<int> - inherits from true_type. + has_trivial_copy<int> + inherits from true_type.

    @@ -83,7 +83,7 @@

    - has_trivial_copy<char*>::type is the type true_type. + has_trivial_copy<char*>::type is the type true_type.

    @@ -92,7 +92,7 @@

    - has_trivial_copy<int (*)(long)>::value is an integral constant expression + has_trivial_copy<int (*)(long)>::value is an integral constant expression that evaluates to true.

    @@ -102,7 +102,7 @@

    - has_trivial_copy<MyClass>::value is an integral constant expression + has_trivial_copy<MyClass>::value is an integral constant expression that evaluates to false.

    @@ -112,7 +112,7 @@

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

    @@ -120,10 +120,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/has_trivial_cp_cons.html b/doc/html/boost_typetraits/reference/has_trivial_cp_cons.html index b6ef80a..bcd3a36 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_cp_cons.html +++ b/doc/html/boost_typetraits/reference/has_trivial_cp_cons.html @@ -1,13 +1,13 @@ -has_trivial_copy_constructor + has_trivial_copy_constructor - + - - - + + + @@ -24,18 +24,21 @@

    - See has_trivial_copy. + See has_trivial_copy.

    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/has_trivial_def_cons.html b/doc/html/boost_typetraits/reference/has_trivial_def_cons.html index 0d99e05..e1bc71e 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_def_cons.html +++ b/doc/html/boost_typetraits/reference/has_trivial_def_cons.html @@ -1,13 +1,13 @@ -has_trivial_default_constructor + has_trivial_default_constructor - + - - - + + + @@ -24,18 +24,22 @@

    - See has_trivial_constructor. + See has_trivial_constructor.

    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/has_trivial_destructor.html b/doc/html/boost_typetraits/reference/has_trivial_destructor.html index ac9332e..d65f45e 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_destructor.html +++ b/doc/html/boost_typetraits/reference/has_trivial_destructor.html @@ -1,13 +1,13 @@ -has_trivial_destructor + has_trivial_destructor - + - - - + + + @@ -24,16 +24,15 @@
     template <class T>
    -struct has_trivial_destructor : public true_type-or-false_type {};
    +struct has_trivial_destructor : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - type with a trivial destructor then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + type with a trivial destructor then inherits from true_type, + otherwise inherits from false_type.

    If a type has a trivial destructor then the destructor has no effect: calls @@ -43,7 +42,7 @@ some benefit in terms of code size and speed can be obtained.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template can not be used with function types.

    @@ -51,25 +50,25 @@ 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 + 9 and Visual C++ 8 have the necessary compiler intrinsics to detect user-defined classes with trivial constructors.

    - C++ Standard Reference: 12.4p3. + C++ Standard Reference: 12.4p3.

    - Header: #include - <boost/type_traits/has_trivial_destructor.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/has_trivial_destructor.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - has_trivial_destructor<int> inherits from true_type. + has_trivial_destructor<int> inherits from true_type.

    @@ -78,8 +77,8 @@

    - has_trivial_destructor<char*>::type - is the type true_type. + has_trivial_destructor<char*>::type + is the type true_type.

    @@ -88,7 +87,7 @@

    - has_trivial_destructor<int (*)(long)>::value + has_trivial_destructor<int (*)(long)>::value is an integral constant expression that evaluates to true.

    @@ -98,7 +97,7 @@

    - has_trivial_destructor<MyClass>::value + has_trivial_destructor<MyClass>::value is an integral constant expression that evaluates to false.

    @@ -108,8 +107,8 @@

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

    @@ -117,10 +116,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/has_virtual_destructor.html b/doc/html/boost_typetraits/reference/has_virtual_destructor.html index fc2bba2..3f74200 100644 --- a/doc/html/boost_typetraits/reference/has_virtual_destructor.html +++ b/doc/html/boost_typetraits/reference/has_virtual_destructor.html @@ -1,13 +1,13 @@ -has_virtual_destructor + has_virtual_destructor - + - - - + + + @@ -24,42 +24,45 @@
     template <class T>
    -struct has_virtual_destructor : public true_type-or-false_type {};
    +struct has_virtual_destructor : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - type with a virtual destructor then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + type with a virtual destructor then inherits from true_type, + otherwise inherits from false_type.

    - Compiler Compatibility: This trait is provided + Compiler Compatibility: This trait is provided for completeness, since it's part of the 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, + 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 + the compiler used has compiler intrinsics that enable the trait to do the right thing: currently (May 2005) only Visual - C++ 8 has the necessary intrinsics. + C++ 8 has the necessary intrinsics.

    - C++ Standard Reference: 12.4. + C++ Standard Reference: 12.4.

    - Header: #include - <boost/type_traits/has_virtual_destructor.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/has_virtual_destructor.hpp> + or #include <boost/type_traits.hpp>

    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/integral_constant.html b/doc/html/boost_typetraits/reference/integral_constant.html index ccadf62..8862bdc 100644 --- a/doc/html/boost_typetraits/reference/integral_constant.html +++ b/doc/html/boost_typetraits/reference/integral_constant.html @@ -1,13 +1,13 @@ -integral_constant + integral_constant - + - - - + + + @@ -24,8 +24,7 @@
     template <class T, T val>
     struct integral_constant
    @@ -39,19 +38,23 @@
     typedef integral_constant<bool, false> false_type;
     

    - Class template integral_constant + Class template integral_constant is the common base class for all the value-based type traits. The two typedef's - true_type and false_type are provided for convenience: + true_type and false_type are provided for convenience: most of the value traits are Boolean properties and so will inherit from one of these.

    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/integral_promotion.html b/doc/html/boost_typetraits/reference/integral_promotion.html index b1ee9fc..c08b749 100644 --- a/doc/html/boost_typetraits/reference/integral_promotion.html +++ b/doc/html/boost_typetraits/reference/integral_promotion.html @@ -1,13 +1,13 @@ -integral_promotion + integral_promotion - + - - - + + + @@ -24,34 +24,33 @@
     template <class T>
     struct integral_promotion
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: If integral promotion can be applied - to an rvalue of type T, then - applies integral promotion to T - and keeps cv-qualifiers of T, - otherwise leaves T unchanged. + type: If integral promotion can be applied + to an rvalue of type T, then + applies integral promotion to T + and keeps cv-qualifiers of T, + otherwise leaves T unchanged.

    - C++ Standard Reference: 4.5 except 4.5/3 + C++ Standard Reference: 4.5 except 4.5/3 (integral bit-field).

    - Header: #include - <boost/type_traits/integral_promotion.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/integral_promotion.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.14. Examples

    -
    +

    Table 1.14. Examples

    +
    @@ -72,51 +71,54 @@ -

    - integral_promotion<short - const>::type + integral_promotion<short + const>::type

    - int const + int const

    - integral_promotion<short&>::type + integral_promotion<short&>::type

    - short& + short&

    - integral_promotion<enum std::float_round_style>::type + integral_promotion<enum std::float_round_style>::type

    - int + int

    +
    -
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_abstract.html b/doc/html/boost_typetraits/reference/is_abstract.html index 36dfa38..f83feba 100644 --- a/doc/html/boost_typetraits/reference/is_abstract.html +++ b/doc/html/boost_typetraits/reference/is_abstract.html @@ -1,13 +1,13 @@ -is_abstract + is_abstract - + - - - + + + @@ -24,29 +24,28 @@
     template <class T>
    -struct is_abstract : public true_type-or-false_type {};
    +struct is_abstract : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - abstract type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + abstract type then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 10.3. + C++ Standard Reference: 10.3.

    - Header: #include - <boost/type_traits/is_abstract.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_abstract.hpp> + or #include <boost/type_traits.hpp>

    - Compiler Compatibility: The compiler must + Compiler Compatibility: The compiler must support DR337 (as of April 2005: GCC 3.4, VC++ 7.1 (and later), Intel C++ - 7 (and later), and Comeau 4.3.2). Otherwise behaves the same as is_polymorphic; + 7 (and later), and Comeau 4.3.2). Otherwise behaves the same as is_polymorphic; this is the "safe fallback position" for which polymorphic types are always regarded as potentially abstract. The macro BOOST_NO_IS_ABSTRACT is used to signify that the implementation is buggy, users should check for @@ -54,13 +53,13 @@ their particular use-case.

    - Examples: + Examples:

    - Given: class abc{ virtual ~abc() = 0; }; + Given: class abc{ virtual ~abc() = 0; };

    @@ -69,8 +68,8 @@

    - is_abstract<abc> - inherits from true_type. + is_abstract<abc> + inherits from true_type.

    @@ -79,7 +78,7 @@

    - is_abstract<abc>::type is the type true_type. + is_abstract<abc>::type is the type true_type.

    @@ -88,7 +87,7 @@

    - is_abstract<abc const>::value + is_abstract<abc const>::value is an integral constant expression that evaluates to true.

    @@ -98,7 +97,7 @@

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

    @@ -106,10 +105,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_arithmetic.html b/doc/html/boost_typetraits/reference/is_arithmetic.html index 7f45356..84b7284 100644 --- a/doc/html/boost_typetraits/reference/is_arithmetic.html +++ b/doc/html/boost_typetraits/reference/is_arithmetic.html @@ -1,13 +1,13 @@ -is_arithmetic + is_arithmetic - + - - - + + + @@ -24,36 +24,35 @@
     template <class T>
    -struct is_arithmetic : public true_type-or-false_type {};
    +struct is_arithmetic : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - arithmetic type then inherits from true_type, - otherwise inherits from false_type. - Arithmetic types include integral and floating point types (see also is_integral and - is_floating_point). + Inherits: If T is a (possibly cv-qualified) + arithmetic type then inherits from true_type, + otherwise inherits from false_type. + Arithmetic types include integral and floating point types (see also is_integral and + is_floating_point).

    - C++ Standard Reference: 3.9.1p8. + C++ Standard Reference: 3.9.1p8.

    - Header: #include - <boost/type_traits/is_arithmetic.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_arithmetic.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_arithmetic<int> - inherits from true_type. + is_arithmetic<int> + inherits from true_type.

    @@ -62,7 +61,7 @@

    - is_arithmetic<char>::type is the type true_type. + is_arithmetic<char>::type is the type true_type.

    @@ -71,7 +70,7 @@

    - is_arithmetic<double>::value is an integral constant expression + is_arithmetic<double>::value is an integral constant expression that evaluates to true.

    @@ -81,7 +80,7 @@

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

    @@ -89,10 +88,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_array.html b/doc/html/boost_typetraits/reference/is_array.html index 6038fa2..a065229 100644 --- a/doc/html/boost_typetraits/reference/is_array.html +++ b/doc/html/boost_typetraits/reference/is_array.html @@ -1,13 +1,13 @@ -is_array + is_array - + - - - + + + @@ -24,38 +24,37 @@
     template <class T>
    -struct is_array : public true_type-or-false_type {};
    +struct is_array : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - array type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + array type then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.2 and 8.3.4. + C++ Standard Reference: 3.9.2 and 8.3.4.

    - Header: #include - <boost/type_traits/is_array.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_array.hpp> + or #include <boost/type_traits.hpp>

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template can give the wrong result with function types.

    - Examples: + Examples:

    - is_array<int[2]> inherits from true_type. + is_array<int[2]> inherits from true_type.

    @@ -64,8 +63,8 @@

    - is_array<char[2][3]>::type - is the type true_type. + is_array<char[2][3]>::type + is the type true_type.

    @@ -74,7 +73,7 @@

    - is_array<double[]>::value is an integral constant expression + is_array<double[]>::value is an integral constant expression that evaluates to true.

    @@ -84,7 +83,7 @@

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

    @@ -92,10 +91,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_base_of.html b/doc/html/boost_typetraits/reference/is_base_of.html index 99fb01b..2533dfc 100644 --- a/doc/html/boost_typetraits/reference/is_base_of.html +++ b/doc/html/boost_typetraits/reference/is_base_of.html @@ -1,13 +1,13 @@ -is_base_of + is_base_of - + - - - + + + @@ -24,57 +24,56 @@
     template <class Base, class Derived>
    -struct is_base_of : public true_type-or-false_type {};
    +struct is_base_of : public true_type-or-false_type {};
     

    - Inherits: If Base is base class of type - Derived or if both types are the same then inherits from true_type, - otherwise inherits from false_type. + Inherits: If Base is base class of type + Derived or if both types are the same then inherits from true_type, + otherwise inherits from false_type.

    This template will detect non-public base classes, and ambiguous base classes.

    - Note that is_base_of<X,X> will always inherit from true_type. - This is the case even if X - is not a class type. This is a change in behaviour from Boost-1.33 + Note that is_base_of<X,X> will always inherit from true_type. + This is the case even if X + is not a class type. This is a change in behaviour from Boost-1.33 in order to track the Technical Report on C++ Library Extensions.

    - Types Base and Derived must not be incomplete types. + Types Base and Derived must not be incomplete types.

    - C++ Standard Reference: 10. + C++ Standard Reference: 10.

    - Header: #include - <boost/type_traits/is_base_of.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_base_of.hpp> + or #include <boost/type_traits.hpp>

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template can not be used with function types. There are some older compilers which - will produce compiler errors if Base - is a private base class of Derived, - or if Base is an ambiguous - base of Derived. These compilers + will produce compiler errors if Base + is a private base class of Derived, + or if Base is an ambiguous + base of Derived. These compilers include Borland C++, older versions of Sun Forte C++, Digital Mars C++, and older versions of EDG based compilers.

    - Examples: + Examples:

    - Given: class Base{}; class Derived : - public Base{}; + Given: class Base{}; class Derived : + public Base{};

    @@ -83,8 +82,8 @@

    - is_base_of<Base, Derived> - inherits from true_type. + is_base_of<Base, Derived> + inherits from true_type.

    @@ -93,7 +92,7 @@

    - is_base_of<Base, Derived>::type is the type true_type. + is_base_of<Base, Derived>::type is the type true_type.

    @@ -102,7 +101,7 @@

    - is_base_of<Base, Derived>::value is an integral constant expression + is_base_of<Base, Derived>::value is an integral constant expression that evaluates to true.

    @@ -112,7 +111,7 @@

    - is_base_of<Base, Derived>::value is an integral constant expression + is_base_of<Base, Derived>::value is an integral constant expression that evaluates to true.

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

    - is_base_of<Base, Base>::value is an integral constant expression + is_base_of<Base, Base>::value is an integral constant expression that evaluates to true: a class is regarded as it's own base.

    @@ -133,7 +132,7 @@

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

    @@ -141,10 +140,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_class.html b/doc/html/boost_typetraits/reference/is_class.html index 3a688c2..6d34c76 100644 --- a/doc/html/boost_typetraits/reference/is_class.html +++ b/doc/html/boost_typetraits/reference/is_class.html @@ -1,13 +1,13 @@ -is_class + is_class - + - - - + + + @@ -24,41 +24,40 @@
     template <class T>
    -struct is_class : public true_type-or-false_type {};
    +struct is_class : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - class type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + class type then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.2 and 9.2. + C++ Standard Reference: 3.9.2 and 9.2.

    - Header: #include - <boost/type_traits/is_class.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_class.hpp> + or #include <boost/type_traits.hpp>

    - Compiler Compatibility: Without (some as + Compiler Compatibility: Without (some as 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 + 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.

    - Examples: + Examples:

    - Given: class MyClass; then: + Given: class MyClass; then:

    @@ -67,8 +66,8 @@

    - is_class<MyClass> - inherits from true_type. + is_class<MyClass> + inherits from true_type.

    @@ -77,8 +76,8 @@

    - is_class<MyClass const>::type - is the type true_type. + is_class<MyClass const>::type + is the type true_type.

    @@ -87,7 +86,7 @@

    - is_class<MyClass>::value is an integral constant expression + is_class<MyClass>::value is an integral constant expression that evaluates to true.

    @@ -97,7 +96,7 @@

    - is_class<MyClass&>::value is an integral constant expression + is_class<MyClass&>::value is an integral constant expression that evaluates to false.

    @@ -107,7 +106,7 @@

    - is_class<MyClass*>::value is an integral constant expression + is_class<MyClass*>::value is an integral constant expression that evaluates to false.

    @@ -117,7 +116,7 @@

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

    @@ -125,10 +124,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_complex.html b/doc/html/boost_typetraits/reference/is_complex.html index 59419cf..15d6fa5 100644 --- a/doc/html/boost_typetraits/reference/is_complex.html +++ b/doc/html/boost_typetraits/reference/is_complex.html @@ -1,13 +1,13 @@ -is_complex + is_complex - + - - - + + + @@ -24,33 +24,36 @@
     template <class T>
    -struct is_complex : public true_type-or-false_type {};
    +struct is_complex : public true_type-or-false_type {};
     

    - Inherits: If T - is a complex number type then true (of type std::complex<U> - for some type U), otherwise + Inherits: If T + is a complex number type then true (of type std::complex<U> + for some type U), otherwise false.

    - C++ Standard Reference: 26.2. + C++ Standard Reference: 26.2.

    - Header: #include - <boost/type_traits/is_complex.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_complex.hpp> + or #include <boost/type_traits.hpp>

    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_compound.html b/doc/html/boost_typetraits/reference/is_compound.html index 453c575..88a04c3 100644 --- a/doc/html/boost_typetraits/reference/is_compound.html +++ b/doc/html/boost_typetraits/reference/is_compound.html @@ -1,13 +1,13 @@ -is_compound + is_compound - + - - - + + + @@ -24,35 +24,34 @@
     template <class T>
    -struct is_compound : public true_type-or-false_type {};
    +struct is_compound : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - compound type then inherits from true_type, - otherwise inherits from false_type. - Any type that is not a fundamental type is a compound type (see also is_fundamental). + Inherits: If T is a (possibly cv-qualified) + compound type then inherits from true_type, + otherwise inherits from false_type. + Any type that is not a fundamental type is a compound type (see also is_fundamental).

    - C++ Standard Reference: 3.9.2. + C++ Standard Reference: 3.9.2.

    - Header: #include - <boost/type_traits/is_compound.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_compound.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_compound<MyClass> - inherits from true_type. + is_compound<MyClass> + inherits from true_type.

    @@ -61,7 +60,7 @@

    - is_compound<MyEnum>::type is the type true_type. + is_compound<MyEnum>::type is the type true_type.

    @@ -70,7 +69,7 @@

    - is_compound<int*>::value is an integral constant expression + is_compound<int*>::value is an integral constant expression that evaluates to true.

    @@ -80,7 +79,7 @@

    - is_compound<int&>::value is an integral constant expression + is_compound<int&>::value is an integral constant expression that evaluates to true.

    @@ -90,7 +89,7 @@

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

    @@ -100,7 +99,7 @@

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

    @@ -108,10 +107,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_const.html b/doc/html/boost_typetraits/reference/is_const.html index 6f2922c..2c085d7 100644 --- a/doc/html/boost_typetraits/reference/is_const.html +++ b/doc/html/boost_typetraits/reference/is_const.html @@ -1,13 +1,13 @@ -is_const + is_const - + - - - + + + @@ -24,33 +24,32 @@
     template <class T>
    -struct is_const : public true_type-or-false_type {};
    +struct is_const : public true_type-or-false_type {};
     

    - Inherits: If T is a (top level) const-qualified - type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (top level) const-qualified + type then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.3. + C++ Standard Reference: 3.9.3.

    - Header: #include - <boost/type_traits/is_const.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_const.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_const<int const> inherits from true_type. + is_const<int const> inherits from true_type.

    @@ -59,7 +58,7 @@

    - is_const<int const volatile>::type is the type true_type. + is_const<int const volatile>::type is the type true_type.

    @@ -68,7 +67,7 @@

    - is_const<int* const>::value is an integral constant expression + is_const<int* const>::value is an integral constant expression that evaluates to true.

    @@ -78,7 +77,7 @@

    - is_const<int const*>::value + is_const<int const*>::value is an integral constant expression that evaluates to false: the const-qualifier is not at the top level in this case.

    @@ -89,7 +88,7 @@

    - is_const<int const&>::value + is_const<int const&>::value is an integral constant expression that evaluates to false: the const-qualifier is not at the top level in this case.

    @@ -100,7 +99,7 @@

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

    @@ -110,7 +109,7 @@

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

    @@ -118,10 +117,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_convertible.html b/doc/html/boost_typetraits/reference/is_convertible.html index 75a881a..aaf3b1b 100644 --- a/doc/html/boost_typetraits/reference/is_convertible.html +++ b/doc/html/boost_typetraits/reference/is_convertible.html @@ -1,13 +1,13 @@ -is_convertible + is_convertible - + - - - + + + @@ -24,17 +24,16 @@
     template <class From, class To>
    -struct is_convertible : public true_type-or-false_type {};
    +struct is_convertible : public true_type-or-false_type {};
     

    - Inherits: If an imaginary lvalue of type - From is convertible to type - To then inherits from true_type, - otherwise inherits from false_type. + Inherits: If an imaginary lvalue of type + From is convertible to type + To then inherits from true_type, + otherwise inherits from false_type.

    Type From must not be an incomplete type. @@ -47,12 +46,12 @@ types.

    - This template can not detect whether a converting-constructor is public or not: if type To - has a private converting constructor - from type From then instantiating - is_convertible<From, To> - will produce a compiler error. For this reason is_convertible - can not be used to determine whether a type has a public + This template can not detect whether a converting-constructor is public or not: if type To + has a private converting constructor + from type From then instantiating + is_convertible<From, To> + will produce a compiler error. For this reason is_convertible + can not be used to determine whether a type has a public copy-constructor or not.

    @@ -68,30 +67,30 @@ bool const y = boost::is_convertible<D*,A*>::value;

    - C++ Standard Reference: 4 and 8.5. + C++ Standard Reference: 4 and 8.5.

    - Compiler Compatibility: This template is + Compiler Compatibility: This template is currently broken with Borland C++ Builder 5 (and earlier), for constructor-based conversions, and for the Metrowerks 7 (and earlier) compiler in all cases. - If the compiler does not support is_abstract, - then the template parameter To + If the compiler does not support is_abstract, + then the template parameter To must not be an abstract type.

    - Header: #include - <boost/type_traits/is_convertible.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_convertible.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_convertible<int, double> - inherits from true_type. + is_convertible<int, double> + inherits from true_type.

    @@ -100,8 +99,8 @@

    - is_convertible<const int, double>::type - is the type true_type. + is_convertible<const int, double>::type + is the type true_type.

    @@ -110,7 +109,7 @@

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

    @@ -120,9 +119,9 @@

    - is_convertible<int const*, int*>::value + is_convertible<int const*, int*>::value is an integral constant expression that evaluates to false: - the conversion would require a const_cast. + the conversion would require a const_cast.

    @@ -131,7 +130,7 @@

    - is_convertible<int const&, long>::value + is_convertible<int const&, long>::value is an integral constant expression that evaluates to true.

    @@ -141,7 +140,7 @@

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

    @@ -151,7 +150,7 @@

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

    @@ -159,10 +158,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_empty.html b/doc/html/boost_typetraits/reference/is_empty.html index 06d4100..a7b5cb2 100644 --- a/doc/html/boost_typetraits/reference/is_empty.html +++ b/doc/html/boost_typetraits/reference/is_empty.html @@ -1,13 +1,13 @@ -is_empty + is_empty - + - - - + + + @@ -24,27 +24,26 @@
     template <class T>
    -struct is_empty : public true_type-or-false_type {};
    +struct is_empty : public true_type-or-false_type {};
     

    - Inherits: If T is an empty class type then - inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is an empty class type then + inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 10p5. + C++ Standard Reference: 10p5.

    - Header: #include - <boost/type_traits/is_empty.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_empty.hpp> + or #include <boost/type_traits.hpp>

    - Compiler Compatibility: In order to correctly + Compiler Compatibility: In order to correctly detect empty classes this trait relies on either:

      @@ -52,7 +51,7 @@ the compiler implementing zero sized empty base classes, or
    • - the compiler providing intrinsics + the compiler providing intrinsics to detect empty classes.
    @@ -67,14 +66,14 @@ then this template can not be used with abstract types.

    - Examples: + Examples:

    - Given: struct empty_class - {}; + Given: struct empty_class + {};

    @@ -83,8 +82,8 @@

    - is_empty<empty_class> - inherits from true_type. + is_empty<empty_class> + inherits from true_type.

    @@ -93,8 +92,8 @@

    - is_empty<empty_class const>::type - is the type true_type. + is_empty<empty_class const>::type + is the type true_type.

    @@ -103,7 +102,7 @@

    - is_empty<empty_class>::value is an integral constant expression + is_empty<empty_class>::value is an integral constant expression that evaluates to true.

    @@ -113,7 +112,7 @@

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

    @@ -121,10 +120,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_enum.html b/doc/html/boost_typetraits/reference/is_enum.html index 1397ca2..3c46a39 100644 --- a/doc/html/boost_typetraits/reference/is_enum.html +++ b/doc/html/boost_typetraits/reference/is_enum.html @@ -1,13 +1,13 @@ -is_enum + is_enum - + - - - + + + @@ -24,41 +24,40 @@
     template <class T>
    -struct is_enum : public true_type-or-false_type {};
    +struct is_enum : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - enum type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + enum type then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.2 and 7.2. + C++ Standard Reference: 3.9.2 and 7.2.

    - Header: #include - <boost/type_traits/is_enum.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_enum.hpp> + or #include <boost/type_traits.hpp>

    - Compiler Compatibility: Requires a correctly - functioning is_convertible + Compiler Compatibility: Requires a correctly + functioning is_convertible template; this means that is_enum is currently broken under Borland C++ Builder 5, and for the Metrowerks compiler prior to version 8, other compilers should handle this template just fine.

    - Examples: + Examples:

    - Given: enum my_enum - { one, two }; + Given: enum my_enum + { one, two };

    @@ -67,8 +66,8 @@

    - is_enum<my_enum> - inherits from true_type. + is_enum<my_enum> + inherits from true_type.

    @@ -77,8 +76,8 @@

    - is_enum<my_enum const>::type - is the type true_type. + is_enum<my_enum const>::type + is the type true_type.

    @@ -87,7 +86,7 @@

    - is_enum<my_enum>::value is an integral constant expression + is_enum<my_enum>::value is an integral constant expression that evaluates to true.

    @@ -97,7 +96,7 @@

    - is_enum<my_enum&>::value is an integral constant expression + is_enum<my_enum&>::value is an integral constant expression that evaluates to false.

    @@ -107,7 +106,7 @@

    - is_enum<my_enum*>::value is an integral constant expression + is_enum<my_enum*>::value is an integral constant expression that evaluates to false.

    @@ -117,7 +116,7 @@

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

    @@ -125,10 +124,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_floating_point.html b/doc/html/boost_typetraits/reference/is_floating_point.html index 8e53ebe..b59bb90 100644 --- a/doc/html/boost_typetraits/reference/is_floating_point.html +++ b/doc/html/boost_typetraits/reference/is_floating_point.html @@ -1,13 +1,13 @@ -is_floating_point + is_floating_point - + - - - + + + @@ -24,34 +24,33 @@
     template <class T>
    -struct is_floating_point : public true_type-or-false_type {};
    +struct is_floating_point : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - floating point type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + floating point type then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.1p8. + C++ Standard Reference: 3.9.1p8.

    - Header: #include - <boost/type_traits/is_floating_point.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_floating_point.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_floating_point<float> - inherits from true_type. + is_floating_point<float> + inherits from true_type.

    @@ -60,7 +59,7 @@

    - is_floating_point<double>::type is the type true_type. + is_floating_point<double>::type is the type true_type.

    @@ -69,7 +68,7 @@

    - is_floating_point<long double>::value + is_floating_point<long double>::value is an integral constant expression that evaluates to true.

    @@ -79,7 +78,7 @@

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

    @@ -87,10 +86,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_function.html b/doc/html/boost_typetraits/reference/is_function.html index a70206b..78c22a4 100644 --- a/doc/html/boost_typetraits/reference/is_function.html +++ b/doc/html/boost_typetraits/reference/is_function.html @@ -1,13 +1,13 @@ -is_function + is_function - + - - - + + + @@ -24,18 +24,17 @@
     template <class T>
    -struct is_function : public true_type-or-false_type {};
    +struct is_function : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - function type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + function type then inherits from true_type, + otherwise inherits from false_type. Note that this template does not detect pointers to functions, - or references to functions, these are detected by is_pointer and is_reference respectively: + or references to functions, these are detected by is_pointer and is_reference respectively:

     typedef int f1();      // f1 is of function type.
    @@ -43,22 +42,22 @@
     typedef int (f3&)();   // f3 is a reference to a function.
     

    - C++ Standard Reference: 3.9.2p1 and 8.3.5. + C++ Standard Reference: 3.9.2p1 and 8.3.5.

    - Header: #include - <boost/type_traits/is_function.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_function.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_function<int (void)> - inherits from true_type. + is_function<int (void)> + inherits from true_type.

    @@ -67,7 +66,7 @@

    - is_function<long (double, int)>::type is the type true_type. + is_function<long (double, int)>::type is the type true_type.

    @@ -76,7 +75,7 @@

    - is_function<long (double, int)>::value is an integral constant expression + is_function<long (double, int)>::value is an integral constant expression that evaluates to true.

    @@ -86,7 +85,7 @@

    - is_function<long (*)(double, int)>::value is an integral constant expression + is_function<long (*)(double, int)>::value is an integral constant expression that evaluates to false: the argument in this case is a pointer type, not a function type.

    @@ -97,7 +96,7 @@

    - is_function<long (&)(double, int)>::value is an integral constant expression + is_function<long (&)(double, int)>::value is an integral constant expression that evaluates to false: the argument in this case is a reference to a function, not a function type.

    @@ -108,7 +107,7 @@

    - is_function<long (MyClass::*)(double, int)>::value is an integral constant expression + is_function<long (MyClass::*)(double, int)>::value is an integral constant expression that evaluates to false: the argument in this case is a pointer to a member function.

    @@ -119,7 +118,7 @@

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

    @@ -129,45 +128,46 @@
    - @@ -175,10 +175,14 @@
    [Tip] Tip
    +

    Don't confuse function-types with pointers to functions:

    - typedef int - f(double); + typedef int + f(double);

    defines a function type,

    - f foo; + f foo;

    - declares a prototype for a function of type f, + declares a prototype for a function of type f,

    - f* + f* pf = - foo; + foo;

    - f& + f& fr = - foo; + foo;

    - declares a pointer and a reference to the function foo. + declares a pointer and a reference to the function foo.

    If you want to detect whether some type is a pointer-to-function then use:

    - is_function<remove_pointer<T>::type>::value - && is_pointer<T>::value + is_function<remove_pointer<T>::type>::value + && is_pointer<T>::value

    - or for pointers to member functions you can just use is_member_function_pointer + or for pointers to member functions you can just use is_member_function_pointer directly.

    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_fundamental.html b/doc/html/boost_typetraits/reference/is_fundamental.html index d01c1a2..bb416a7 100644 --- a/doc/html/boost_typetraits/reference/is_fundamental.html +++ b/doc/html/boost_typetraits/reference/is_fundamental.html @@ -1,13 +1,13 @@ -is_fundamental + is_fundamental - + - - - + + + @@ -24,38 +24,37 @@
     template <class T>
    -struct is_fundamental : public true_type-or-false_type {};
    +struct is_fundamental : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - fundamental type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + fundamental type then inherits from true_type, + otherwise inherits from false_type. Fundamental types include integral, floating point and void types (see also - is_integral, - is_floating_point - and is_void) + is_integral, + is_floating_point + and is_void)

    - C++ Standard Reference: 3.9.1. + C++ Standard Reference: 3.9.1.

    - Header: #include - <boost/type_traits/is_fundamental.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_fundamental.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_fundamental<int)> - inherits from true_type. + is_fundamental<int)> + inherits from true_type.

    @@ -64,8 +63,8 @@

    - is_fundamental<double const>::type - is the type true_type. + is_fundamental<double const>::type + is the type true_type.

    @@ -74,7 +73,7 @@

    - is_fundamental<void>::value is an integral constant expression + is_fundamental<void>::value is an integral constant expression that evaluates to true.

    @@ -84,7 +83,7 @@

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

    @@ -92,10 +91,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_integral.html b/doc/html/boost_typetraits/reference/is_integral.html index 9852baa..658359c 100644 --- a/doc/html/boost_typetraits/reference/is_integral.html +++ b/doc/html/boost_typetraits/reference/is_integral.html @@ -1,13 +1,14 @@ -is_integral + is_integral - + - - - + + + @@ -24,34 +25,33 @@
     template <class T>
    -struct is_integral : public true_type-or-false_type {};
    +struct is_integral : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - integral type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + integral type then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.1p7. + C++ Standard Reference: 3.9.1p7.

    - Header: #include - <boost/type_traits/is_integral.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_integral.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_integral<int> - inherits from true_type. + is_integral<int> + inherits from true_type.

    @@ -60,8 +60,8 @@

    - is_integral<const char>::type - is the type true_type. + is_integral<const char>::type + is the type true_type.

    @@ -70,7 +70,7 @@

    - is_integral<long>::value is an integral constant expression + is_integral<long>::value is an integral constant expression that evaluates to true.

    @@ -80,7 +80,7 @@

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

    @@ -88,10 +88,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_member_function_pointer.html b/doc/html/boost_typetraits/reference/is_member_function_pointer.html index 4586bac..0b1c012 100644 --- a/doc/html/boost_typetraits/reference/is_member_function_pointer.html +++ b/doc/html/boost_typetraits/reference/is_member_function_pointer.html @@ -1,13 +1,15 @@ -is_member_function_pointer + + is_member_function_pointer - + - - - + + + @@ -24,34 +26,34 @@
     template <class T>
    -struct is_member_function_pointer : public true_type-or-false_type {};
    +struct is_member_function_pointer : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - pointer to a member function then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + pointer to a member function then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.2 and 8.3.3. + C++ Standard Reference: 3.9.2 and 8.3.3.

    - Header: #include - <boost/type_traits/is_member_function_pointer.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_member_function_pointer.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_member_function_pointer<int (MyClass::*)(void)> inherits from true_type. + is_member_function_pointer<int (MyClass::*)(void)> inherits from true_type.

    @@ -60,8 +62,8 @@

    - is_member_function_pointer<int (MyClass::*)(char)>::type - is the type true_type. + is_member_function_pointer<int (MyClass::*)(char)>::type + is the type true_type.

    @@ -70,7 +72,7 @@

    - is_member_function_pointer<int (MyClass::*)(void)const>::value + is_member_function_pointer<int (MyClass::*)(void)const>::value is an integral constant expression that evaluates to true.

    @@ -80,11 +82,12 @@

    - is_member_function_pointer<int (MyClass::*)>::value + is_member_function_pointer<int (MyClass::*)>::value is an integral constant expression that evaluates to false: the argument in this case is a pointer to a data member and not a member - function, see is_member_object_pointer - and is_member_pointer + function, see is_member_object_pointer + and is_member_pointer

    @@ -93,8 +96,8 @@

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

    @@ -102,10 +105,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_member_object_pointer.html b/doc/html/boost_typetraits/reference/is_member_object_pointer.html index e9247f0..9985f9d 100644 --- a/doc/html/boost_typetraits/reference/is_member_object_pointer.html +++ b/doc/html/boost_typetraits/reference/is_member_object_pointer.html @@ -1,13 +1,15 @@ -is_member_object_pointer + + is_member_object_pointer - + - - - + + + @@ -24,34 +26,34 @@
     template <class T>
    -struct is_member_object_pointer : public true_type-or-false_type {};
    +struct is_member_object_pointer : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - pointer to a member object (a data member) then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + pointer to a member object (a data member) then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.2 and 8.3.3. + C++ Standard Reference: 3.9.2 and 8.3.3.

    - Header: #include - <boost/type_traits/is_member_object_pointer.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_member_object_pointer.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_member_object_pointer<int (MyClass::*)> inherits from true_type. + is_member_object_pointer<int (MyClass::*)> inherits from true_type.

    @@ -60,8 +62,8 @@

    - is_member_object_pointer<double (MyClass::*)>::type - is the type true_type. + is_member_object_pointer<double (MyClass::*)>::type + is the type true_type.

    @@ -70,7 +72,7 @@

    - is_member_object_pointer<const int (MyClass::*)>::value is an integral constant expression + is_member_object_pointer<const int (MyClass::*)>::value is an integral constant expression that evaluates to true.

    @@ -80,11 +82,12 @@

    - is_member_object_pointer<int (MyClass::*)(void)>::value + is_member_object_pointer<int (MyClass::*)(void)>::value is an integral constant expression that evaluates to false: the argument in this case is a pointer to a member function and not a - member object, see is_member_function_pointer - and is_member_pointer + member object, see is_member_function_pointer + and is_member_pointer

    @@ -93,8 +96,8 @@

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

    @@ -102,10 +105,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_member_pointer.html b/doc/html/boost_typetraits/reference/is_member_pointer.html index c0e964e..9abd0ca 100644 --- a/doc/html/boost_typetraits/reference/is_member_pointer.html +++ b/doc/html/boost_typetraits/reference/is_member_pointer.html @@ -1,13 +1,14 @@ -is_member_pointer + is_member_pointer - + - - - + + + @@ -24,35 +25,34 @@
     template <class T>
    -struct is_member_pointer : public true_type-or-false_type {};
    +struct is_member_pointer : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) + Inherits: If T is a (possibly cv-qualified) pointer to a member (either a function or a data member) then inherits from - true_type, - otherwise inherits from false_type. + true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.2 and 8.3.3. + C++ Standard Reference: 3.9.2 and 8.3.3.

    - Header: #include - <boost/type_traits/is_member_pointer.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_member_pointer.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_member_pointer<int (MyClass::*)> - inherits from true_type. + is_member_pointer<int (MyClass::*)> + inherits from true_type.

    @@ -61,7 +61,7 @@

    - is_member_pointer<int (MyClass::*)(char)>::type is the type true_type. + is_member_pointer<int (MyClass::*)(char)>::type is the type true_type.

    @@ -70,7 +70,7 @@

    - is_member_pointer<int (MyClass::*)(void)const>::value is an integral constant expression + is_member_pointer<int (MyClass::*)(void)const>::value is an integral constant expression that evaluates to true.

    @@ -80,7 +80,7 @@

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

    @@ -88,10 +88,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_object.html b/doc/html/boost_typetraits/reference/is_object.html index afb73b1..ef116f9 100644 --- a/doc/html/boost_typetraits/reference/is_object.html +++ b/doc/html/boost_typetraits/reference/is_object.html @@ -1,13 +1,13 @@ -is_object + is_object - + - - - + + + @@ -24,35 +24,34 @@
     template <class T>
    -struct is_object : public true_type-or-false_type {};
    +struct is_object : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - object type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + object type then inherits from true_type, + otherwise inherits from false_type. All types are object types except references, void, and function types.

    - C++ Standard Reference: 3.9p9. + C++ Standard Reference: 3.9p9.

    - Header: #include - <boost/type_traits/is_object.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_object.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_object<int> - inherits from true_type. + is_object<int> + inherits from true_type.

    @@ -61,7 +60,7 @@

    - is_object<int*>::type is the type true_type. + is_object<int*>::type is the type true_type.

    @@ -70,7 +69,7 @@

    - is_object<int (*)(void)>::value is an integral constant expression + is_object<int (*)(void)>::value is an integral constant expression that evaluates to true.

    @@ -80,7 +79,7 @@

    - is_object<int (MyClass::*)(void)const>::value is an integral constant expression + is_object<int (MyClass::*)(void)const>::value is an integral constant expression that evaluates to true.

    @@ -90,7 +89,7 @@

    - is_object<int &>::value is an integral constant expression + is_object<int &>::value is an integral constant expression that evaluates to false: reference types are not objects

    @@ -101,7 +100,7 @@

    - is_object<int (double)>::value is an integral constant expression + is_object<int (double)>::value is an integral constant expression that evaluates to false: function types are not objects

    @@ -112,7 +111,7 @@

    - is_object<const void>::value + is_object<const void>::value is an integral constant expression that evaluates to false: void is not an object type

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

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

    @@ -131,10 +130,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_pod.html b/doc/html/boost_typetraits/reference/is_pod.html index b932557..fd46d8e 100644 --- a/doc/html/boost_typetraits/reference/is_pod.html +++ b/doc/html/boost_typetraits/reference/is_pod.html @@ -1,13 +1,13 @@ -is_pod + is_pod - + - - - + + + @@ -24,16 +24,15 @@
     template <class T>
    -struct is_pod : public true_type-or-false_type {};
    +struct is_pod : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - POD type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + POD type then inherits from true_type, + otherwise inherits from false_type.

    POD stands for "Plain old data". Arithmetic types, and enumeration @@ -45,11 +44,11 @@ array of PODs.

    - C++ Standard Reference: 3.9p10 and 9p4 (Note + C++ Standard Reference: 3.9p10 and 9p4 (Note that POD's are also aggregates, see 8.5.1).

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template can not be used with function types.

    @@ -60,19 +59,19 @@ the necessary compiler-_intrinsics.

    - Header: #include - <boost/type_traits/is_pod.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_pod.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_pod<int> - inherits from true_type. + is_pod<int> + inherits from true_type.

    @@ -81,7 +80,7 @@

    - is_pod<char*>::type is the type true_type. + is_pod<char*>::type is the type true_type.

    @@ -90,7 +89,7 @@

    - is_pod<int (*)(long)>::value is an integral constant expression + is_pod<int (*)(long)>::value is an integral constant expression that evaluates to true.

    @@ -100,7 +99,7 @@

    - is_pod<MyClass>::value is an integral constant expression + is_pod<MyClass>::value is an integral constant expression that evaluates to false.

    @@ -110,7 +109,7 @@

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

    @@ -118,10 +117,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_pointer.html b/doc/html/boost_typetraits/reference/is_pointer.html index 1f955be..322009d 100644 --- a/doc/html/boost_typetraits/reference/is_pointer.html +++ b/doc/html/boost_typetraits/reference/is_pointer.html @@ -1,13 +1,13 @@ -is_pointer + is_pointer - + - - - + + + @@ -24,35 +24,34 @@
     template <class T>
    -struct is_pointer : public true_type-or-false_type {};
    +struct is_pointer : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) + Inherits: If T is a (possibly cv-qualified) pointer type (includes function pointers, but excludes pointers to members) - then inherits from true_type, - otherwise inherits from false_type. + then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.2p2 and 8.3.1. + C++ Standard Reference: 3.9.2p2 and 8.3.1.

    - Header: #include - <boost/type_traits/is_pointer.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_pointer.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_pointer<int*> - inherits from true_type. + is_pointer<int*> + inherits from true_type.

    @@ -61,7 +60,7 @@

    - is_pointer<char* const>::type is the type true_type. + is_pointer<char* const>::type is the type true_type.

    @@ -70,7 +69,7 @@

    - is_pointer<int (*)(long)>::value is an integral constant expression + is_pointer<int (*)(long)>::value is an integral constant expression that evaluates to true.

    @@ -80,7 +79,7 @@

    - is_pointer<int (MyClass::*)(long)>::value is an integral constant expression + is_pointer<int (MyClass::*)(long)>::value is an integral constant expression that evaluates to false.

    @@ -90,7 +89,7 @@

    - is_pointer<int (MyClass::*)>::value is an integral constant expression + is_pointer<int (MyClass::*)>::value is an integral constant expression that evaluates to false.

    @@ -100,7 +99,7 @@

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

    @@ -110,10 +109,10 @@
    -
    [Important] Important

    - is_pointer detects "real" +

    + is_pointer detects "real" pointer types only, and not smart pointers. Users - should not specialise is_pointer + should not specialise is_pointer for smart pointer types, as doing so may cause Boost (and other third party) code to fail to function correctly. Users wanting a trait to detect smart pointers should create their own. However, note that there is no way in @@ -124,10 +123,14 @@ - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +


    diff --git a/doc/html/boost_typetraits/reference/is_polymorphic.html b/doc/html/boost_typetraits/reference/is_polymorphic.html index 8ba6496..439eb74 100644 --- a/doc/html/boost_typetraits/reference/is_polymorphic.html +++ b/doc/html/boost_typetraits/reference/is_polymorphic.html @@ -1,13 +1,13 @@ -is_polymorphic + is_polymorphic - + - - - + + + @@ -24,40 +24,39 @@
     template <class T>
    -struct is_polymorphic : public true_type-or-false_type {};
    +struct is_polymorphic : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - polymorphic type then inherits from true_type, - otherwise inherits from false_type. - Type T must be a complete + Inherits: If T is a (possibly cv-qualified) + polymorphic type then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete type.

    - C++ Standard Reference: 10.3. + C++ Standard Reference: 10.3.

    - Compiler Compatibility: The implementation + Compiler Compatibility: The implementation requires some knowledge of the compilers ABI, it does actually seem to work with the majority of compilers though.

    - Header: #include - <boost/type_traits/is_polymorphic.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_polymorphic.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - Given: class poly{ virtual ~poly(); }; + Given: class poly{ virtual ~poly(); };

    @@ -66,8 +65,8 @@

    - is_polymorphic<poly> - inherits from true_type. + is_polymorphic<poly> + inherits from true_type.

    @@ -76,8 +75,8 @@

    - is_polymorphic<poly const>::type - is the type true_type. + is_polymorphic<poly const>::type + is the type true_type.

    @@ -86,7 +85,7 @@

    - is_polymorphic<poly>::value is an integral constant expression + is_polymorphic<poly>::value is an integral constant expression that evaluates to true.

    @@ -96,7 +95,7 @@

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

    @@ -104,10 +103,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_reference.html b/doc/html/boost_typetraits/reference/is_reference.html index e2f2192..0c8bca0 100644 --- a/doc/html/boost_typetraits/reference/is_reference.html +++ b/doc/html/boost_typetraits/reference/is_reference.html @@ -1,13 +1,13 @@ -is_reference + is_reference - + - - - + + + @@ -24,40 +24,39 @@
     template <class T>
    -struct is_reference : public true_type-or-false_type {};
    +struct is_reference : public true_type-or-false_type {};
     

    - Inherits: If T is a reference pointer type - then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a reference pointer type + then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.2 and 8.3.2. + C++ Standard Reference: 3.9.2 and 8.3.2.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template may report the wrong result for function types, and for types that are both const and volatile qualified.

    - Header: #include - <boost/type_traits/is_reference.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_reference.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_reference<int&> - inherits from true_type. + is_reference<int&> + inherits from true_type.

    @@ -66,8 +65,8 @@

    - is_reference<int const&>::type - is the type true_type. + is_reference<int const&>::type + is the type true_type.

    @@ -76,7 +75,7 @@

    - is_reference<int (&)(long)>::value is an integral constant expression + is_reference<int (&)(long)>::value is an integral constant expression that evaluates to true (the argument in this case is a reference to a function).

    @@ -87,7 +86,7 @@

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

    @@ -95,10 +94,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_same.html b/doc/html/boost_typetraits/reference/is_same.html index 198aa4f..c1bcceb 100644 --- a/doc/html/boost_typetraits/reference/is_same.html +++ b/doc/html/boost_typetraits/reference/is_same.html @@ -1,13 +1,13 @@ -is_same + is_same - + - - - + + + @@ -24,36 +24,35 @@
     template <class T, class U>
    -struct is_same : public true_type-or-false_type {};
    +struct is_same : public true_type-or-false_type {};
     

    - Inherits: If T and U are the same types - then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T and U are the same types + then inherits from true_type, + otherwise inherits from false_type.

    - Header: #include - <boost/type_traits/is_same.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_same.hpp> + or #include <boost/type_traits.hpp>

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template can not be used with abstract, incomplete or function types.

    - Examples: + Examples:

    - is_same<int, int> - inherits from true_type. + is_same<int, int> + inherits from true_type.

    @@ -62,7 +61,7 @@

    - is_same<int, int>::type is the type true_type. + is_same<int, int>::type is the type true_type.

    @@ -71,7 +70,7 @@

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

    @@ -81,7 +80,7 @@

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

    @@ -91,7 +90,7 @@

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

    @@ -101,7 +100,7 @@

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

    @@ -109,10 +108,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_scalar.html b/doc/html/boost_typetraits/reference/is_scalar.html index a2c1119..daa6286 100644 --- a/doc/html/boost_typetraits/reference/is_scalar.html +++ b/doc/html/boost_typetraits/reference/is_scalar.html @@ -1,13 +1,13 @@ -is_scalar + is_scalar - + - - - + + + @@ -24,41 +24,40 @@
     template <class T>
    -struct is_scalar : public true_type-or-false_type {};
    +struct is_scalar : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - scalar type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + scalar type then inherits from true_type, + otherwise inherits from false_type. Scalar types include integral, floating point, enumeration, pointer, and pointer-to-member types.

    - C++ Standard Reference: 3.9p10. + C++ Standard Reference: 3.9p10.

    - Header: #include - <boost/type_traits/is_scalar.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_scalar.hpp> + or #include <boost/type_traits.hpp>

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template can not be used with function types.

    - Examples: + Examples:

    - is_scalar<int*> - inherits from true_type. + is_scalar<int*> + inherits from true_type.

    @@ -67,7 +66,7 @@

    - is_scalar<int>::type is the type true_type. + is_scalar<int>::type is the type true_type.

    @@ -76,7 +75,7 @@

    - is_scalar<double>::value is an integral constant expression + is_scalar<double>::value is an integral constant expression that evaluates to true.

    @@ -86,7 +85,7 @@

    - is_scalar<int (*)(long)>::value is an integral constant expression + is_scalar<int (*)(long)>::value is an integral constant expression that evaluates to true.

    @@ -96,7 +95,7 @@

    - is_scalar<int (MyClass::*)(long)>::value is an integral constant expression + is_scalar<int (MyClass::*)(long)>::value is an integral constant expression that evaluates to true.

    @@ -106,7 +105,7 @@

    - is_scalar<int (MyClass::*)>::value is an integral constant expression + is_scalar<int (MyClass::*)>::value is an integral constant expression that evaluates to true.

    @@ -116,7 +115,7 @@

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

    @@ -124,10 +123,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_signed.html b/doc/html/boost_typetraits/reference/is_signed.html index 680dbaa..e367498 100644 --- a/doc/html/boost_typetraits/reference/is_signed.html +++ b/doc/html/boost_typetraits/reference/is_signed.html @@ -1,13 +1,13 @@ -is_signed + is_signed - + - - - + + + @@ -24,35 +24,34 @@
     template <class T>
    -struct is_signed : public true_type-or-false_type {};
    +struct is_signed : public true_type-or-false_type {};
     

    - Inherits: If T is an signed integer type + Inherits: If T is an signed integer type or an enumerated type with an underlying signed integer type, then inherits - from true_type, - otherwise inherits from false_type. + from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.1, 7.2. + C++ Standard Reference: 3.9.1, 7.2.

    - Header: #include - <boost/type_traits/is_signed.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_signed.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_signed<int> - inherits from true_type. + is_signed<int> + inherits from true_type.

    @@ -61,7 +60,7 @@

    - is_signed<int const volatile>::type is the type true_type. + is_signed<int const volatile>::type is the type true_type.

    @@ -70,7 +69,7 @@

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

    @@ -80,7 +79,7 @@

    - is_signed<myclass>::value is an integral constant expression + is_signed<myclass>::value is an integral constant expression that evaluates to false.

    @@ -90,8 +89,8 @@

    - is_signed<char>::value is an integral constant expression - whose value depends upon the signedness of type char. + is_signed<char>::value is an integral constant expression + whose value depends upon the signedness of type char.

    @@ -100,7 +99,7 @@

    - is_signed<long long>::value + is_signed<long long>::value is an integral constant expression that evaluates to true.

    @@ -110,7 +109,7 @@

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

    @@ -118,10 +117,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_stateless.html b/doc/html/boost_typetraits/reference/is_stateless.html index c7d63bf..af9f386 100644 --- a/doc/html/boost_typetraits/reference/is_stateless.html +++ b/doc/html/boost_typetraits/reference/is_stateless.html @@ -1,13 +1,13 @@ -is_stateless + is_stateless - + - - - + + + @@ -24,25 +24,24 @@
     template <class T>
    -struct is_stateless : public true_type-or-false_type {};
    +struct is_stateless : public true_type-or-false_type {};
     

    - Inherits: Ff T is a stateless type then - inherits from true_type, - otherwise from false_type. + Inherits: Ff T is a stateless type then + inherits from true_type, + otherwise from false_type.

    Type T must be a complete type.

    A stateless type is a type that has no storage and whose constructors and - destructors are trivial. That means that is_stateless - only inherits from true_type - if the following expression is true: + destructors are trivial. That means that is_stateless + only inherits from true_type + if the following expression is true:

     ::boost::has_trivial_constructor<T>::value
    @@ -52,15 +51,15 @@
     && ::boost::is_empty<T>::value
     

    - C++ Standard Reference: 3.9p10. + C++ Standard Reference: 3.9p10.

    - Header: #include - <boost/type_traits/is_stateless.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_stateless.hpp> + or #include <boost/type_traits.hpp>

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template can not be used with function types.

    @@ -68,16 +67,20 @@ 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 + the necessary compiler intrinsics to make this template work automatically.

    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_union.html b/doc/html/boost_typetraits/reference/is_union.html index a051ae4..16a82bc 100644 --- a/doc/html/boost_typetraits/reference/is_union.html +++ b/doc/html/boost_typetraits/reference/is_union.html @@ -1,13 +1,13 @@ -is_union + is_union - + - - - + + + @@ -24,47 +24,46 @@
     template <class T>
    -struct is_union : public true_type-or-false_type {};
    +struct is_union : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - union type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + union type then inherits from true_type, + otherwise inherits from false_type. Currently requires some kind of compiler support, otherwise unions are identified as classes.

    - C++ Standard Reference: 3.9.2 and 9.5. + C++ Standard Reference: 3.9.2 and 9.5.

    - Compiler Compatibility: Without (some as + Compiler Compatibility: 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, + 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 + the necessary compiler intrinsics to make this trait "just work" without user intervention.

    - Header: #include - <boost/type_traits/is_union.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_union.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_union<void> - inherits from true_type. + is_union<void> + inherits from true_type.

    @@ -73,8 +72,8 @@

    - is_union<const void>::type - is the type true_type. + is_union<const void>::type + is the type true_type.

    @@ -83,7 +82,7 @@

    - is_union<void>::value is an integral constant expression + is_union<void>::value is an integral constant expression that evaluates to true.

    @@ -93,7 +92,7 @@

    - is_union<void*>::value is an integral constant expression + is_union<void*>::value is an integral constant expression that evaluates to false.

    @@ -103,7 +102,7 @@

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

    @@ -111,10 +110,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_unsigned.html b/doc/html/boost_typetraits/reference/is_unsigned.html index d18fdbf..fa0c65a 100644 --- a/doc/html/boost_typetraits/reference/is_unsigned.html +++ b/doc/html/boost_typetraits/reference/is_unsigned.html @@ -1,13 +1,13 @@ -is_unsigned + is_unsigned - + - - - + + + @@ -24,34 +24,33 @@
     template <class T>
    -struct is_unsigned : public true_type-or-false_type {};
    +struct is_unsigned : public true_type-or-false_type {};
     

    - Inherits: If T is an unsigned integer type + Inherits: If T is an unsigned integer type or an enumerated type with an underlying unsigned integer type, then inherits - from true_type, - otherwise inherits from false_type. + from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.1, 7.2. + C++ Standard Reference: 3.9.1, 7.2.

    - Header: #include - <boost/type_traits/is_unsigned.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_unsigned.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_unsigned<unsigned int> inherits from true_type. + is_unsigned<unsigned int> inherits from true_type.

    @@ -60,9 +59,9 @@

    - is_unsigned<unsigned int - const volatile>::type - is the type true_type. + is_unsigned<unsigned int + const volatile>::type + is the type true_type.

    @@ -71,7 +70,7 @@

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

    @@ -81,7 +80,7 @@

    - is_unsigned<myclass>::value is an integral constant expression + is_unsigned<myclass>::value is an integral constant expression that evaluates to false.

    @@ -91,8 +90,8 @@

    - is_unsigned<char>::value is an integral constant expression - whose value depends upon the signedness of type char. + is_unsigned<char>::value is an integral constant expression + whose value depends upon the signedness of type char.

    @@ -101,8 +100,8 @@

    - is_unsigned<unsigned long - long>::value is an integral constant expression + is_unsigned<unsigned long + long>::value is an integral constant expression that evaluates to true.

    @@ -112,7 +111,7 @@

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

    @@ -120,10 +119,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_void.html b/doc/html/boost_typetraits/reference/is_void.html index 12b570a..89063d7 100644 --- a/doc/html/boost_typetraits/reference/is_void.html +++ b/doc/html/boost_typetraits/reference/is_void.html @@ -1,13 +1,13 @@ -is_void + is_void - + - - - + + + @@ -24,34 +24,33 @@
     template <class T>
    -struct is_void : public true_type-or-false_type {};
    +struct is_void : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - void type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + void type then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.1p9. + C++ Standard Reference: 3.9.1p9.

    - Header: #include - <boost/type_traits/is_void.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_void.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_void<void> - inherits from true_type. + is_void<void> + inherits from true_type.

    @@ -60,8 +59,8 @@

    - is_void<const void>::type - is the type true_type. + is_void<const void>::type + is the type true_type.

    @@ -70,7 +69,7 @@

    - is_void<void>::value is an integral constant expression + is_void<void>::value is an integral constant expression that evaluates to true.

    @@ -80,7 +79,7 @@

    - is_void<void*>::value is an integral constant expression + is_void<void*>::value is an integral constant expression that evaluates to false.

    @@ -90,7 +89,7 @@

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

    @@ -98,10 +97,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/is_volatile.html b/doc/html/boost_typetraits/reference/is_volatile.html index fa1b090..3cb0ed2 100644 --- a/doc/html/boost_typetraits/reference/is_volatile.html +++ b/doc/html/boost_typetraits/reference/is_volatile.html @@ -1,13 +1,13 @@ -is_volatile + is_volatile - + - - - + + + @@ -24,33 +24,32 @@
     template <class T>
    -struct is_volatile : public true_type-or-false_type {};
    +struct is_volatile : public true_type-or-false_type {};
     

    - Inherits: If T is a (top level) volatile-qualified - type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (top level) volatile-qualified + type then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.3. + C++ Standard Reference: 3.9.3.

    - Header: #include - <boost/type_traits/is_volatile.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_volatile.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_volatile<volatile int> inherits from true_type. + is_volatile<volatile int> inherits from true_type.

    @@ -59,8 +58,8 @@

    - is_volatile<const volatile - int>::type is the type true_type. + is_volatile<const volatile + int>::type is the type true_type.

    @@ -69,7 +68,7 @@

    - is_volatile<int* volatile>::value is an integral constant expression + is_volatile<int* volatile>::value is an integral constant expression that evaluates to true.

    @@ -79,7 +78,7 @@

    - is_volatile<int volatile*>::value + is_volatile<int volatile*>::value is an integral constant expression that evaluates to false: the volatile qualifier is not at the top level in this case.

    @@ -90,7 +89,7 @@

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

    @@ -98,10 +97,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/make_signed.html b/doc/html/boost_typetraits/reference/make_signed.html index bbf824e..de6a3f7 100644 --- a/doc/html/boost_typetraits/reference/make_signed.html +++ b/doc/html/boost_typetraits/reference/make_signed.html @@ -1,13 +1,13 @@ -make_signed + make_signed - + - - - + + + @@ -24,17 +24,16 @@
     template <class T>
     struct make_signed
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: If T is a signed integer type then + type: If T is a signed integer type then the same type as T, if T is an unsigned integer type then the corresponding signed type. Otherwise if T is an enumerated or character type (char or wchar_t) then a signed integer type with the same width as T. @@ -43,20 +42,20 @@ If T has any cv-qualifiers then these are also present on the result type.

    - Requires: T must be an integer or enumerated + Requires: T must be an integer or enumerated type, and must not be the type bool.

    - C++ Standard Reference: 3.9.1. + C++ Standard Reference: 3.9.1.

    - Header: #include - <boost/type_traits/make_signed.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/make_signed.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.15. Examples

    -
    +

    Table 1.15. Examples

    +
    @@ -77,46 +76,46 @@ -

    - make_signed<int>::type + make_signed<int>::type

    - int + int

    - make_signed<unsigned int - const>::type + make_signed<unsigned int + const>::type

    - int const + int const

    - make_signed<const unsigned - long long>::type + make_signed<const unsigned + long long>::type

    - const long - long + const long + long

    - make_signed<my_enum>::type + make_signed<my_enum>::type

    @@ -128,7 +127,7 @@

    - make_signed<wchar_t>::type + make_signed<wchar_t>::type

    @@ -138,16 +137,19 @@
    +
    -
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/make_unsigned.html b/doc/html/boost_typetraits/reference/make_unsigned.html index b77a4d5..1b86312 100644 --- a/doc/html/boost_typetraits/reference/make_unsigned.html +++ b/doc/html/boost_typetraits/reference/make_unsigned.html @@ -1,13 +1,13 @@ -make_unsigned + make_unsigned - + - - - + + + @@ -24,17 +24,16 @@
     template <class T>
     struct make_unsigned
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: If T is a unsigned integer type then + type: If T is a unsigned integer type then the same type as T, if T is an signed integer type then the corresponding unsigned type. Otherwise if T is an enumerated or character type (char or wchar_t) then an unsigned integer type with the same width as T. @@ -43,20 +42,20 @@ If T has any cv-qualifiers then these are also present on the result type.

    - Requires: T must be an integer or enumerated + Requires: T must be an integer or enumerated type, and must not be the type bool.

    - C++ Standard Reference: 3.9.1. + C++ Standard Reference: 3.9.1.

    - Header: #include - <boost/type_traits/make_unsigned.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/make_unsigned.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.16. Examples

    -
    +

    Table 1.16. Examples

    +
    @@ -77,47 +76,47 @@ -

    - make_signed<int>::type + make_signed<int>::type

    - unsigned int + unsigned int

    - make_signed<unsigned int - const>::type + make_signed<unsigned int + const>::type

    - unsigned int - const + unsigned int + const

    - make_signed<const unsigned - long long>::type + make_signed<const unsigned + long long>::type

    - const unsigned - long long + const unsigned + long long

    - make_signed<my_enum>::type + make_signed<my_enum>::type

    @@ -129,7 +128,7 @@

    - make_signed<wchar_t>::type + make_signed<wchar_t>::type

    @@ -139,16 +138,19 @@
    +
    -
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/promote.html b/doc/html/boost_typetraits/reference/promote.html index cb3bf1f..8a833eb 100644 --- a/doc/html/boost_typetraits/reference/promote.html +++ b/doc/html/boost_typetraits/reference/promote.html @@ -1,13 +1,13 @@ -promote + promote - + - - - + + + @@ -24,36 +24,36 @@
     template <class T>
     struct promote
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: If integral or floating point promotion - can be applied to an rvalue of type T, - then applies integral and floating point promotions to T - and keeps cv-qualifiers of T, - otherwise leaves T unchanged. - See also integral_promotion - and floating_point_promotion. + type: If integral or floating point promotion + can be applied to an rvalue of type T, + then applies integral and floating point promotions to T + and keeps cv-qualifiers of T, + otherwise leaves T unchanged. + See also integral_promotion + and floating_point_promotion.

    - C++ Standard Reference: 4.5 except 4.5/3 + C++ Standard Reference: 4.5 except 4.5/3 (integral bit-field) and 4.6.

    - Header: #include - <boost/type_traits/promote.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/promote.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.17. Examples

    -
    +

    Table 1.17. Examples

    +
    @@ -74,50 +74,53 @@ -

    - promote<short volatile>::type + promote<short volatile>::type

    - int volatile + int volatile

    - promote<float const>::type + promote<float const>::type

    - double const + double const

    - promote<short&>::type + promote<short&>::type

    - short& + short&

    +
    -
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/rank.html b/doc/html/boost_typetraits/reference/rank.html index b60bfc2..4510d27 100644 --- a/doc/html/boost_typetraits/reference/rank.html +++ b/doc/html/boost_typetraits/reference/rank.html @@ -1,13 +1,13 @@ -rank + rank - + - - - + + + @@ -24,36 +24,35 @@
     template <class T>
    -struct rank : public integral_constant<std::size_t, RANK(T)> {};
    +struct rank : public integral_constant<std::size_t, RANK(T)> {};
     

    - Inherits: Class template rank inherits from - integral_constant<std::size_t, RANK(T)>, - where RANK(T) is the - number of array dimensions in type T. + Inherits: Class template rank inherits from + integral_constant<std::size_t, RANK(T)>, + where RANK(T) is the + number of array dimensions in type T.

    - If T is not an array type, - then RANK(T) is zero. + If T is not an array type, + then RANK(T) is zero.

    - Header: #include - <boost/type_traits/rank.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/rank.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - rank<int[]> - inherits from integral_constant<std::size_t, 1>. + rank<int[]> + inherits from integral_constant<std::size_t, 1>.

    @@ -62,7 +61,7 @@

    - rank<double[2][3][4]>::type is the type integral_constant<std::size_t, 3>. + rank<double[2][3][4]>::type is the type integral_constant<std::size_t, 3>.

    @@ -71,7 +70,7 @@

    - rank<int[1]>::value + rank<int[1]>::value is an integral constant expression that evaluates to 1.

    @@ -81,7 +80,7 @@

    - rank<int[][2]>::value is an integral constant expression + rank<int[][2]>::value is an integral constant expression that evaluates to 2.

    @@ -91,7 +90,7 @@

    - rank<int*>::value is an integral constant expression + rank<int*>::value is an integral constant expression that evaluates to 0.

    @@ -101,7 +100,7 @@

    - rank<T>::value_type is the type std::size_t. + rank<T>::value_type is the type std::size_t.

    @@ -109,10 +108,14 @@
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/remove_all_extents.html b/doc/html/boost_typetraits/reference/remove_all_extents.html index b7b23d5..89104df 100644 --- a/doc/html/boost_typetraits/reference/remove_all_extents.html +++ b/doc/html/boost_typetraits/reference/remove_all_extents.html @@ -1,13 +1,13 @@ -remove_all_extents + remove_all_extents - + - - - + + + @@ -24,39 +24,38 @@
     template <class T>
     struct remove_all_extents
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: If T - is an array type, then removes all of the array bounds on T, - otherwise leaves T unchanged. + type: If T + is an array type, then removes all of the array bounds on T, + otherwise leaves T unchanged.

    - C++ Standard Reference: 8.3.4. + C++ Standard Reference: 8.3.4.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

    - Header: #include - <boost/type_traits/remove_all_extents.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/remove_all_extents.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.18. Examples

    -
    +

    Table 1.18. Examples

    +
    @@ -77,74 +76,77 @@ -

    - remove_all_extents<int>::type + remove_all_extents<int>::type

    - int + int

    - remove_all_extents<int const[2]>::type + remove_all_extents<int const[2]>::type

    - int const + int const

    - remove_all_extents<int[][2]>::type + remove_all_extents<int[][2]>::type

    - int + int

    - remove_all_extents<int[2][3][4]>::type + remove_all_extents<int[2][3][4]>::type

    - int + int

    - remove_all_extents<int const*>::type + remove_all_extents<int const*>::type

    - int const* + int const*

    +
    -
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/remove_const.html b/doc/html/boost_typetraits/reference/remove_const.html index 26e6421..bf4643a 100644 --- a/doc/html/boost_typetraits/reference/remove_const.html +++ b/doc/html/boost_typetraits/reference/remove_const.html @@ -1,13 +1,13 @@ -remove_const + remove_const - + - - - + + + @@ -24,38 +24,37 @@
     template <class T>
     struct remove_const
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: The same type as T, + type: The same type as T, but with any top level const-qualifier removed.

    - C++ Standard Reference: 3.9.3. + C++ Standard Reference: 3.9.3.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

    - Header: #include - <boost/type_traits/remove_const.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/remove_const.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.19. Examples

    -
    +

    Table 1.19. Examples

    +
    @@ -76,75 +75,78 @@ -

    - remove_const<int>::type + remove_const<int>::type

    - int + int

    - remove_const<int const>::type + remove_const<int const>::type

    - int + int

    - remove_const<int const - volatile>::type + remove_const<int const + volatile>::type

    - int volatile + int volatile

    - remove_const<int const&>::type + remove_const<int const&>::type

    - int const& + int const&

    - remove_const<int const*>::type + remove_const<int const*>::type

    - int const* + int const*

    +
    -
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/remove_cv.html b/doc/html/boost_typetraits/reference/remove_cv.html index 290a560..845be09 100644 --- a/doc/html/boost_typetraits/reference/remove_cv.html +++ b/doc/html/boost_typetraits/reference/remove_cv.html @@ -1,13 +1,13 @@ -remove_cv + remove_cv - + - - - + + + @@ -24,38 +24,37 @@
     template <class T>
     struct remove_cv
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: The same type as T, + type: The same type as T, but with any top level cv-qualifiers removed.

    - C++ Standard Reference: 3.9.3. + C++ Standard Reference: 3.9.3.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

    - Header: #include - <boost/type_traits/remove_cv.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/remove_cv.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.20. Examples

    -
    +

    Table 1.20. Examples

    +
    @@ -76,75 +75,78 @@ -

    - remove_cv<int>::type + remove_cv<int>::type

    - int + int

    - remove_cv<int const>::type + remove_cv<int const>::type

    - int + int

    - remove_cv<int const - volatile>::type + remove_cv<int const + volatile>::type

    - int + int

    - remove_cv<int const&>::type + remove_cv<int const&>::type

    - int const& + int const&

    - remove_cv<int const*>::type + remove_cv<int const*>::type

    - int const* + int const*

    +
    -
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/remove_extent.html b/doc/html/boost_typetraits/reference/remove_extent.html index 24aa231..f899db9 100644 --- a/doc/html/boost_typetraits/reference/remove_extent.html +++ b/doc/html/boost_typetraits/reference/remove_extent.html @@ -1,13 +1,13 @@ -remove_extent + remove_extent - + - - - + + + @@ -24,39 +24,38 @@
     template <class T>
     struct remove_extent
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: If T + type: If T is an array type, then removes the topmost array bound, otherwise leaves - T unchanged. + T unchanged.

    - C++ Standard Reference: 8.3.4. + C++ Standard Reference: 8.3.4.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

    - Header: #include - <boost/type_traits/remove_extent.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/remove_extent.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.21. Examples

    -
    +

    Table 1.21. Examples

    +
    @@ -77,74 +76,77 @@ -

    - remove_extent<int>::type + remove_extent<int>::type

    - int + int

    - remove_extent<int const[2]>::type + remove_extent<int const[2]>::type

    - int const + int const

    - remove_extent<int[2][4]>::type + remove_extent<int[2][4]>::type

    - int[4] + int[4]

    - remove_extent<int[][2]>::type + remove_extent<int[][2]>::type

    - int[2] + int[2]

    - remove_extent<int const*>::type + remove_extent<int const*>::type

    - int const* + int const*

    +
    -
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/remove_pointer.html b/doc/html/boost_typetraits/reference/remove_pointer.html index ff55dd6..dd8e299 100644 --- a/doc/html/boost_typetraits/reference/remove_pointer.html +++ b/doc/html/boost_typetraits/reference/remove_pointer.html @@ -1,13 +1,13 @@ -remove_pointer + remove_pointer - + - - - + + + @@ -24,38 +24,37 @@
     template <class T>
     struct remove_pointer
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: The same type as T, + type: The same type as T, but with any pointer modifier removed.

    - C++ Standard Reference: 8.3.1. + C++ Standard Reference: 8.3.1.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

    - Header: #include - <boost/type_traits/remove_pointer.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/remove_pointer.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.22. Examples

    -
    +

    Table 1.22. Examples

    +
    @@ -76,74 +75,77 @@ -

    - remove_pointer<int>::type + remove_pointer<int>::type

    - int + int

    - remove_pointer<int const*>::type + remove_pointer<int const*>::type

    - int const + int const

    - remove_pointer<int const**>::type + remove_pointer<int const**>::type

    - int const* + int const*

    - remove_pointer<int&>::type + remove_pointer<int&>::type

    - int& + int&

    - remove_pointer<int*&>::type + remove_pointer<int*&>::type

    - int*& + int*&

    +
    -
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/remove_reference.html b/doc/html/boost_typetraits/reference/remove_reference.html index d247cf5..50f3a0e 100644 --- a/doc/html/boost_typetraits/reference/remove_reference.html +++ b/doc/html/boost_typetraits/reference/remove_reference.html @@ -1,13 +1,13 @@ -remove_reference + remove_reference - + - - - + + + @@ -24,38 +24,37 @@
     template <class T>
     struct remove_reference
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: The same type as T, + type: The same type as T, but with any reference modifier removed.

    - C++ Standard Reference: 8.3.2. + C++ Standard Reference: 8.3.2.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

    - Header: #include - <boost/type_traits/remove_reference.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/remove_reference.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.23. Examples

    -
    +

    Table 1.23. Examples

    +
    @@ -76,62 +75,65 @@ -

    - remove_reference<int>::type + remove_reference<int>::type

    - int + int

    - remove_reference<int const&>::type + remove_reference<int const&>::type

    - int const + int const

    - remove_reference<int*>::type + remove_reference<int*>::type

    - int* + int*

    - remove_reference<int*&>::type + remove_reference<int*&>::type

    - int* + int*

    +
    -
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/remove_volatile.html b/doc/html/boost_typetraits/reference/remove_volatile.html index 50ba5ec..3c2f3c0 100644 --- a/doc/html/boost_typetraits/reference/remove_volatile.html +++ b/doc/html/boost_typetraits/reference/remove_volatile.html @@ -1,13 +1,13 @@ -remove_volatile + remove_volatile - + - - - + + + @@ -24,38 +24,37 @@
     template <class T>
     struct remove_volatile
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: The same type as T, + type: The same type as T, but with any top level volatile-qualifier removed.

    - C++ Standard Reference: 3.9.3. + C++ Standard Reference: 3.9.3.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

    - Header: #include - <boost/type_traits/remove_volatile.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/remove_volatile.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.24. Examples

    -
    +

    Table 1.24. Examples

    +
    @@ -76,75 +75,78 @@ -

    - remove_volatile<int>::type + remove_volatile<int>::type

    - int + int

    - remove_volatile<int volatile>::type + remove_volatile<int volatile>::type

    - int + int

    - remove_volatile<int const - volatile>::type + remove_volatile<int const + volatile>::type

    - int const + int const

    - remove_volatile<int volatile&>::type + remove_volatile<int volatile&>::type

    - int const& + int const&

    - remove_volatile<int volatile*>::type + remove_volatile<int volatile*>::type

    - int const* + int const*

    +
    -
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/reference/type_with_alignment.html b/doc/html/boost_typetraits/reference/type_with_alignment.html index 7426a22..f31e85e 100644 --- a/doc/html/boost_typetraits/reference/type_with_alignment.html +++ b/doc/html/boost_typetraits/reference/type_with_alignment.html @@ -1,13 +1,13 @@ -type_with_alignment + type_with_alignment - + - - - + + + @@ -24,31 +24,34 @@
     template <std::size_t Align>
     struct type_with_alignment
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: a built-in or POD type with an alignment - that is a multiple of Align. + type: a built-in or POD type with an alignment + that is a multiple of Align.

    - Header: #include - <boost/type_traits/type_with_alignment.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/type_with_alignment.hpp> + or #include <boost/type_traits.hpp>

    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/boost_typetraits/user_defined.html b/doc/html/boost_typetraits/user_defined.html index f52b1fb..eff3602 100644 --- a/doc/html/boost_typetraits/user_defined.html +++ b/doc/html/boost_typetraits/user_defined.html @@ -1,13 +1,14 @@ -User Defined Specializations + User Defined Specializations - + - - + + @@ -24,14 +25,13 @@

    Occationally the end user may need to provide their own specialization for one of the type traits - typically where intrinsic compiler support is required to implement a specific trait fully. These specializations should derive from - boost::true_type - or boost::false_type + boost::true_type + or boost::false_type as appropriate:

    @@ -49,25 +49,29 @@
     namespace boost
     {
        template<>
    -   struct is_pod<my_pod> : public true_type{};
    +   struct is_pod<my_pod> : public true_type{};
           
        template<>
    -   struct is_pod<my_union> : public true_type{};
    +   struct is_pod<my_union> : public true_type{};
        
        template<>
    -   struct is_union<my_union> : public true_type{};
    +   struct is_union<my_union> : public true_type{};
        
        template<>
    -   struct is_class<my_union> : public false_type{};
    +   struct is_class<my_union> : public false_type{};
     }
     
    - + Ramey and Jeremy Siek

    + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> + http:/www.boost.org/LICENSE_1_0.txt </ulink>) +

    Copyright © 2000, 2006 Adobe Systems Inc, David Abrahams, +

    diff --git a/doc/html/index.html b/doc/html/index.html index e8c88d1..590c333 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -3,9 +3,9 @@ Chapter 1. Boost.TypeTraits - + - + @@ -22,12 +22,15 @@

    Chapter 1. Boost.TypeTraits

    +

    +various authors +

    -

    +

    Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <ulink url="http://www.boost.orgLICENSE_1_0.txt"> http:/www.boost.org/LICENSE_1_0.txt </ulink>) @@ -155,8 +158,8 @@

    - - + +

    Last revised: September 10, 2007 at 12:24:53 +0100

    Last revised: September 10, 2007 at 19:24:53 +0800


    Next
    From 28dba3e79993e1ff6b1a941f5d63a0ef60469d6d Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 7 Nov 2007 18:29:00 +0000 Subject: [PATCH 50/56] Added copyright. [SVN r40902] --- include/boost/type_traits/make_signed.hpp | 3 ++- include/boost/type_traits/make_unsigned.hpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/boost/type_traits/make_signed.hpp b/include/boost/type_traits/make_signed.hpp index aefd7f3..a44a640 100644 --- a/include/boost/type_traits/make_signed.hpp +++ b/include/boost/type_traits/make_signed.hpp @@ -1,5 +1,5 @@ -// (C) John Maddock 2007. +// (C) Copyright John Maddock 2007. // 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). @@ -134,3 +134,4 @@ BOOST_TT_AUX_TYPE_TRAIT_DEF1(make_signed,T,typename boost::detail::make_signed_i #include #endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED + diff --git a/include/boost/type_traits/make_unsigned.hpp b/include/boost/type_traits/make_unsigned.hpp index cd04b67..5695c7f 100644 --- a/include/boost/type_traits/make_unsigned.hpp +++ b/include/boost/type_traits/make_unsigned.hpp @@ -1,5 +1,5 @@ -// (C) John Maddock 2007. +// (C) Copyright John Maddock 2007. // 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). @@ -134,3 +134,4 @@ BOOST_TT_AUX_TYPE_TRAIT_DEF1(make_unsigned,T,typename boost::detail::make_unsign #include #endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED + From 0451d0d24f79bee6b9199017f1489eac81533656 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 7 Nov 2007 18:38:23 +0000 Subject: [PATCH 51/56] Added license info. [SVN r40903] --- doc/add_const.qbk | 8 ++++++++ doc/add_cv.qbk | 8 ++++++++ doc/add_pointer.qbk | 8 ++++++++ doc/add_reference.qbk | 8 ++++++++ doc/add_volatile.qbk | 8 ++++++++ doc/aligned_storage.qbk | 8 ++++++++ doc/alignment_of.qbk | 8 ++++++++ doc/alignment_traits.qbk | 8 ++++++++ doc/background.qbk | 8 ++++++++ doc/credits.qbk | 8 ++++++++ doc/decay.qbk | 8 ++++++++ doc/decomposing_func.qbk | 8 ++++++++ doc/examples.qbk | 8 ++++++++ doc/extent.qbk | 8 ++++++++ doc/floating_point_promotion.qbk | 8 ++++++++ doc/function_traits.qbk | 8 ++++++++ doc/has_nothrow_assign.qbk | 8 ++++++++ doc/has_nothrow_constructor.qbk | 8 ++++++++ doc/has_nothrow_copy.qbk | 8 ++++++++ doc/has_trivial_assign.qbk | 8 ++++++++ doc/has_trivial_constructor.qbk | 8 ++++++++ doc/has_trivial_copy.qbk | 8 ++++++++ doc/has_trivial_destructor.qbk | 8 ++++++++ doc/has_virtual_destructor.qbk | 8 ++++++++ doc/integral_constant.qbk | 8 ++++++++ doc/integral_promotion.qbk | 8 ++++++++ doc/intrinsics.qbk | 8 ++++++++ doc/is_abstract.qbk | 8 ++++++++ doc/is_arithmetic.qbk | 8 ++++++++ doc/is_array.qbk | 8 ++++++++ doc/is_base_of.qbk | 8 ++++++++ doc/is_class.qbk | 8 ++++++++ doc/is_complex.qbk | 8 ++++++++ doc/is_compound.qbk | 8 ++++++++ doc/is_const.qbk | 8 ++++++++ doc/is_convertible.qbk | 8 ++++++++ doc/is_empty.qbk | 8 ++++++++ doc/is_enum.qbk | 8 ++++++++ doc/is_floating_point.qbk | 8 ++++++++ doc/is_function.qbk | 8 ++++++++ doc/is_fundamental.qbk | 8 ++++++++ doc/is_integral.qbk | 8 ++++++++ doc/is_member_function_pointer.qbk | 8 ++++++++ doc/is_member_object_pointer.qbk | 8 ++++++++ doc/is_member_pointer.qbk | 8 ++++++++ doc/is_object.qbk | 8 ++++++++ doc/is_pod.qbk | 8 ++++++++ doc/is_pointer.qbk | 8 ++++++++ doc/is_polymorphic.qbk | 8 ++++++++ doc/is_reference.qbk | 8 ++++++++ doc/is_same.qbk | 8 ++++++++ doc/is_scalar.qbk | 8 ++++++++ doc/is_signed.qbk | 8 ++++++++ doc/is_stateless.qbk | 8 ++++++++ doc/is_union.qbk | 8 ++++++++ doc/is_unsigned.qbk | 8 ++++++++ doc/is_void.qbk | 8 ++++++++ doc/is_volatile.qbk | 8 ++++++++ doc/make_signed.qbk | 8 ++++++++ doc/make_unsigned.qbk | 8 ++++++++ doc/mpl.qbk | 8 ++++++++ doc/promote.qbk | 8 ++++++++ doc/rank.qbk | 8 ++++++++ doc/remove_all_extents.qbk | 8 ++++++++ doc/remove_const.qbk | 8 ++++++++ doc/remove_cv.qbk | 8 ++++++++ doc/remove_extent.qbk | 8 ++++++++ doc/remove_pointer.qbk | 8 ++++++++ doc/remove_reference.qbk | 8 ++++++++ doc/remove_volatile.qbk | 8 ++++++++ doc/transform_traits.qbk | 8 ++++++++ doc/type_traits.qbk | 8 ++++++++ doc/type_with_alignment.qbk | 8 ++++++++ doc/user_defined.qbk | 8 ++++++++ doc/value_traits.qbk | 9 ++++++++- 75 files changed, 600 insertions(+), 1 deletion(-) diff --git a/doc/add_const.qbk b/doc/add_const.qbk index a161036..ec8ed1d 100644 --- a/doc/add_const.qbk +++ b/doc/add_const.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:add_const add_const] template @@ -31,3 +38,4 @@ __header ` #include ` or ` #include @@ -31,3 +38,4 @@ __header ` #include ` or ` #include @@ -35,3 +42,4 @@ __header ` #include ` or ` #include @@ -31,3 +38,4 @@ __header ` #include ` or ` #include @@ -31,3 +38,4 @@ __header ` #include ` or ` #include @@ -12,3 +19,4 @@ that is a multiple of `Align`. __header ` #include ` or ` #include ` [endsect] + diff --git a/doc/alignment_of.qbk b/doc/alignment_of.qbk index 001b74d..eef3283 100644 --- a/doc/alignment_of.qbk +++ b/doc/alignment_of.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:alignment_of alignment_of] template struct alignment_of : public __integral_constant {}; @@ -24,3 +31,4 @@ expression with value `ALIGNOF(double)`.] [:`alignment_of::value_type` is the type `std::size_t`.] [endsect] + diff --git a/doc/alignment_traits.qbk b/doc/alignment_traits.qbk index 59b38cd..56a133c 100644 --- a/doc/alignment_traits.qbk +++ b/doc/alignment_traits.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:alignment Synthesizing Types with Specific Alignments] Some low level memory management routines need to synthesize a POD type with @@ -14,3 +21,4 @@ with a specific size and alignment. struct __aligned_storage; [endsect] + diff --git a/doc/background.qbk b/doc/background.qbk index a56d661..3ff2914 100644 --- a/doc/background.qbk +++ b/doc/background.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:background Background and Tutorial] The following is an updated version of the article "C++ Type traits" @@ -312,3 +319,4 @@ helpful comments when preparing this article. [endsect] + diff --git a/doc/credits.qbk b/doc/credits.qbk index fd804d6..f8aab31 100644 --- a/doc/credits.qbk +++ b/doc/credits.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:credits Credits] This documentation was pulled together by John Maddock, using @@ -31,3 +38,4 @@ should be directed to boost@lists.boost.org www.boost.org/more/mailing_lists.htm#main] for subscription details). [endsect] + diff --git a/doc/decay.qbk b/doc/decay.qbk index d361fff..5884a48 100644 --- a/doc/decay.qbk +++ b/doc/decay.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:decay decay] template @@ -30,3 +37,4 @@ __header ` #include ` or ` #include struct extent : public __integral_constant {}; @@ -31,3 +38,4 @@ expression that evaluates to /0/.] [:`extent::value_type` is the type `std::size_t`.] [endsect] + diff --git a/doc/floating_point_promotion.qbk b/doc/floating_point_promotion.qbk index 12257ab..bbbdc7a 100644 --- a/doc/floating_point_promotion.qbk +++ b/doc/floating_point_promotion.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:floating_point_promotion floating_point_promotion] template @@ -27,3 +34,4 @@ __header ` #include ` or ` #incl ] [endsect] + diff --git a/doc/function_traits.qbk b/doc/function_traits.qbk index 366d66d..2403d0c 100644 --- a/doc/function_traits.qbk +++ b/doc/function_traits.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:function_traits function_traits] [def __argN '''argN_type'''] @@ -46,3 +53,4 @@ type use __remove_pointer.] ] [endsect] + diff --git a/doc/has_nothrow_assign.qbk b/doc/has_nothrow_assign.qbk index 7763e3f..f71eb5c 100644 --- a/doc/has_nothrow_assign.qbk +++ b/doc/has_nothrow_assign.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:has_nothrow_assign has_nothrow_assign] template @@ -19,3 +26,4 @@ trait "just works". __header ` #include ` or ` #include ` [endsect] + diff --git a/doc/has_nothrow_constructor.qbk b/doc/has_nothrow_constructor.qbk index 1fbc052..05145e8 100644 --- a/doc/has_nothrow_constructor.qbk +++ b/doc/has_nothrow_constructor.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:has_nothrow_constructor has_nothrow_constructor] template @@ -24,3 +31,4 @@ trait "just works". __header ` #include ` or ` #include ` [endsect] + diff --git a/doc/has_nothrow_copy.qbk b/doc/has_nothrow_copy.qbk index 52b87b9..f118c80 100644 --- a/doc/has_nothrow_copy.qbk +++ b/doc/has_nothrow_copy.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:has_nothrow_copy has_nothrow_copy] template @@ -24,3 +31,4 @@ trait "just works". __header ` #include ` or ` #include ` [endsect] + diff --git a/doc/has_trivial_assign.qbk b/doc/has_trivial_assign.qbk index f356f73..8390175 100644 --- a/doc/has_trivial_assign.qbk +++ b/doc/has_trivial_assign.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:has_trivial_assign has_trivial_assign] template struct has_trivial_assign : public __tof {}; @@ -37,3 +44,4 @@ expression that evaluates to /false/.] [:`has_trivial_assign::value_type` is the type `bool`.] [endsect] + diff --git a/doc/has_trivial_constructor.qbk b/doc/has_trivial_constructor.qbk index a16fda3..b2385c2 100644 --- a/doc/has_trivial_constructor.qbk +++ b/doc/has_trivial_constructor.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:has_trivial_constructor has_trivial_constructor] template @@ -45,3 +52,4 @@ expression that evaluates to /false/.] [:`has_trivial_constructor::value_type` is the type `bool`.] [endsect] + diff --git a/doc/has_trivial_copy.qbk b/doc/has_trivial_copy.qbk index 4410d8e..220e79d 100644 --- a/doc/has_trivial_copy.qbk +++ b/doc/has_trivial_copy.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:has_trivial_copy has_trivial_copy] template @@ -43,3 +50,4 @@ expression that evaluates to /false/.] [:`has_trivial_copy::value_type` is the type `bool`.] [endsect] + diff --git a/doc/has_trivial_destructor.qbk b/doc/has_trivial_destructor.qbk index a0ed756..a15093e 100644 --- a/doc/has_trivial_destructor.qbk +++ b/doc/has_trivial_destructor.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:has_trivial_destructor has_trivial_destructor] template struct has_trivial_destructor : public __tof {}; @@ -39,3 +46,4 @@ expression that evaluates to /false/.] [:`has_trivial_destructor::value_type` is the type `bool`.] [endsect] + diff --git a/doc/has_virtual_destructor.qbk b/doc/has_virtual_destructor.qbk index 1498e88..a204922 100644 --- a/doc/has_virtual_destructor.qbk +++ b/doc/has_virtual_destructor.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:has_virtual_destructor has_virtual_destructor] template struct has_virtual_destructor : public __tof {}; @@ -18,3 +25,4 @@ __std_ref 12.4. __header ` #include ` or ` #include ` [endsect] + diff --git a/doc/integral_constant.qbk b/doc/integral_constant.qbk index 60bd815..58403cf 100644 --- a/doc/integral_constant.qbk +++ b/doc/integral_constant.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:integral_constant integral_constant] template struct integral_constant @@ -16,3 +23,4 @@ convenience: most of the value traits are Boolean properties and so will inherit one of these. [endsect] + diff --git a/doc/integral_promotion.qbk b/doc/integral_promotion.qbk index 46a2c37..a83d49b 100644 --- a/doc/integral_promotion.qbk +++ b/doc/integral_promotion.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:integral_promotion integral_promotion] template @@ -27,3 +34,4 @@ __header ` #include ` or ` #include struct is_abstract : public __tof {}; @@ -31,3 +38,4 @@ expression that evaluates to /true/.] [:`is_abstract::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_arithmetic.qbk b/doc/is_arithmetic.qbk index 68caa53..efea087 100644 --- a/doc/is_arithmetic.qbk +++ b/doc/is_arithmetic.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_arithmetic is_arithmetic] template struct is_arithmetic : public __tof {}; @@ -22,3 +29,4 @@ expression that evaluates to /true/.] [:`is_arithmetic::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_array.qbk b/doc/is_array.qbk index 7b0e87d..be384f3 100644 --- a/doc/is_array.qbk +++ b/doc/is_array.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_array is_array] template struct is_array : public __tof {}; @@ -25,3 +32,4 @@ expression that evaluates to /true/.] [:`is_array::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_base_of.qbk b/doc/is_base_of.qbk index afe1a3c..a5a4283 100644 --- a/doc/is_base_of.qbk +++ b/doc/is_base_of.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_base_of is_base_of] template struct is_base_of : public __tof {}; @@ -44,3 +51,4 @@ expression that evaluates to /true/: a class is regarded as it's own base.] [:`is_base_of::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_class.qbk b/doc/is_class.qbk index 9ef3b52..bf058c9 100644 --- a/doc/is_class.qbk +++ b/doc/is_class.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_class is_class] template struct is_class : public __tof {}; @@ -35,3 +42,4 @@ expression that evaluates to /false/.] [:`is_class::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_complex.qbk b/doc/is_complex.qbk index dae2d8a..0c4f981 100644 --- a/doc/is_complex.qbk +++ b/doc/is_complex.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_complex is_complex] template @@ -11,3 +18,4 @@ __std_ref 26.2. __header ` #include ` or ` #include ` [endsect] + diff --git a/doc/is_compound.qbk b/doc/is_compound.qbk index 385ac08..392efd5 100644 --- a/doc/is_compound.qbk +++ b/doc/is_compound.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_compound is_compound] template struct is_compound : public __tof {}; @@ -28,3 +35,4 @@ expression that evaluates to /false/.] [:`is_compound::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_const.qbk b/doc/is_const.qbk index 934aff1..ed3acaa 100644 --- a/doc/is_const.qbk +++ b/doc/is_const.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_const is_const] template @@ -33,3 +40,4 @@ expression that evaluates to /false/.] [:`is_const::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_convertible.qbk b/doc/is_convertible.qbk index a0cfe4c..dc94573 100644 --- a/doc/is_convertible.qbk +++ b/doc/is_convertible.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_convertible is_convertible] template struct is_convertible : public __tof {}; @@ -56,3 +63,4 @@ expression that evaluates to /false/.] [:`is_convertible::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_empty.qbk b/doc/is_empty.qbk index adb9b69..4739257 100644 --- a/doc/is_empty.qbk +++ b/doc/is_empty.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_empty is_empty] template struct is_empty : public __tof {}; @@ -35,3 +42,4 @@ expression that evaluates to /true/.] [:`is_empty::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_enum.qbk b/doc/is_enum.qbk index 77c54e9..d937fa6 100644 --- a/doc/is_enum.qbk +++ b/doc/is_enum.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_enum is_enum] template struct is_enum : public __tof {}; @@ -34,3 +41,4 @@ expression that evaluates to /false/.] [:`is_enum::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_floating_point.qbk b/doc/is_floating_point.qbk index 36fe350..43f043b 100644 --- a/doc/is_floating_point.qbk +++ b/doc/is_floating_point.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_floating_point is_floating_point] template struct is_floating_point : public __tof {}; @@ -21,3 +28,4 @@ expression that evaluates to /true/.] [:`is_floating_point::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_function.qbk b/doc/is_function.qbk index caa6425..06f7ed8 100644 --- a/doc/is_function.qbk +++ b/doc/is_function.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_function is_function] template @@ -64,3 +71,4 @@ __is_member_function_pointer directly. ] [endsect] + diff --git a/doc/is_fundamental.qbk b/doc/is_fundamental.qbk index 724e130..8e4b4b0 100644 --- a/doc/is_fundamental.qbk +++ b/doc/is_fundamental.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_fundamental is_fundamental] template struct is_fundamental : public __tof {}; @@ -22,3 +29,4 @@ expression that evaluates to /true/.] [:`is_fundamental::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_integral.qbk b/doc/is_integral.qbk index 439dd6b..5d4add2 100644 --- a/doc/is_integral.qbk +++ b/doc/is_integral.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_integral is_integral] template struct is_integral : public __tof {}; @@ -21,3 +28,4 @@ expression that evaluates to /true/.] [:`is_integral::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_member_function_pointer.qbk b/doc/is_member_function_pointer.qbk index c992f8e..673b306 100644 --- a/doc/is_member_function_pointer.qbk +++ b/doc/is_member_function_pointer.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_member_function_pointer is_member_function_pointer] template struct is_member_function_pointer : public __tof {}; @@ -27,3 +34,4 @@ and __is_member_pointer] [:`is_member_function_pointer::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_member_object_pointer.qbk b/doc/is_member_object_pointer.qbk index f2471ad..87510a9 100644 --- a/doc/is_member_object_pointer.qbk +++ b/doc/is_member_object_pointer.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_member_object_pointer is_member_object_pointer] template struct is_member_object_pointer : public __tof {}; @@ -27,3 +34,4 @@ and __is_member_pointer] [:`is_member_object_pointer::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_member_pointer.qbk b/doc/is_member_pointer.qbk index 62cdf59..f45372f 100644 --- a/doc/is_member_pointer.qbk +++ b/doc/is_member_pointer.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_member_pointer is_member_pointer] template struct is_member_pointer : public __tof {}; @@ -23,3 +30,4 @@ expression that evaluates to /true/.] [:`is_member_pointer::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_object.qbk b/doc/is_object.qbk index 5f1049a..4f14c44 100644 --- a/doc/is_object.qbk +++ b/doc/is_object.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_object is_object] template struct is_object : public __tof {}; @@ -35,3 +42,4 @@ expression that evaluates to /false/: void is not an object type] [:`is_object::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_pod.qbk b/doc/is_pod.qbk index 9105cb2..c61c5df 100644 --- a/doc/is_pod.qbk +++ b/doc/is_pod.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_pod is_pod] template struct is_pod : public __tof {}; @@ -41,3 +48,4 @@ expression that evaluates to /false/.] [:`is_pod::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_pointer.qbk b/doc/is_pointer.qbk index 3587a5b..da57229 100644 --- a/doc/is_pointer.qbk +++ b/doc/is_pointer.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_pointer is_pointer] template struct is_pointer : public __tof {}; @@ -35,3 +42,4 @@ However, note that there is no way in general to auto-magically detect smart poi so such a trait would have to be partially specialised for each supported smart pointer type.] [endsect] + diff --git a/doc/is_polymorphic.qbk b/doc/is_polymorphic.qbk index d2994ac..c4ace04 100644 --- a/doc/is_polymorphic.qbk +++ b/doc/is_polymorphic.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_polymorphic is_polymorphic] template struct is_polymorphic : public __tof {}; @@ -27,3 +34,4 @@ expression that evaluates to /true/.] [:`is_polymorphic::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_reference.qbk b/doc/is_reference.qbk index 5767a77..fa3a712 100644 --- a/doc/is_reference.qbk +++ b/doc/is_reference.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_reference is_reference] template struct is_reference : public __tof {}; @@ -27,3 +34,4 @@ a reference to a function).] [:`is_reference::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_same.qbk b/doc/is_same.qbk index 39273d4..2ed48b2 100644 --- a/doc/is_same.qbk +++ b/doc/is_same.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_same is_same] template struct is_same : public __tof {}; @@ -28,3 +35,4 @@ expression that evaluates to /false/.] [:`is_same::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_scalar.qbk b/doc/is_scalar.qbk index 7e7b4a5..4ec966c 100644 --- a/doc/is_scalar.qbk +++ b/doc/is_scalar.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_scalar is_scalar] template struct is_scalar : public __tof {}; @@ -34,3 +41,4 @@ expression that evaluates to /true/.] [:`is_scalar::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_signed.qbk b/doc/is_signed.qbk index 1b0ad56..8d43c91 100644 --- a/doc/is_signed.qbk +++ b/doc/is_signed.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_signed is_signed] template @@ -32,3 +39,4 @@ expression that evaluates to /true/.] [:`is_signed::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_stateless.qbk b/doc/is_stateless.qbk index f63856e..22f9648 100644 --- a/doc/is_stateless.qbk +++ b/doc/is_stateless.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_stateless is_stateless] template struct is_stateless : public __tof {}; @@ -30,3 +37,4 @@ if possibly sub-optimal. Currently (May 2005) only MWCW 9 and Visual C++ 8 have compiler __intrinsics to make this template work automatically. [endsect] + diff --git a/doc/is_union.qbk b/doc/is_union.qbk index 8da752f..0227fe8 100644 --- a/doc/is_union.qbk +++ b/doc/is_union.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_union is_union] template struct is_union : public __tof {}; @@ -33,3 +40,4 @@ expression that evaluates to /false/.] [:`is_union::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_unsigned.qbk b/doc/is_unsigned.qbk index 84a5f62..adf1926 100644 --- a/doc/is_unsigned.qbk +++ b/doc/is_unsigned.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_unsigned is_unsigned] template @@ -32,3 +39,4 @@ expression that evaluates to /true/.] [:`is_unsigned::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_void.qbk b/doc/is_void.qbk index c5e62ce..b99e586 100644 --- a/doc/is_void.qbk +++ b/doc/is_void.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_void is_void] template struct is_void : public __tof {}; @@ -24,3 +31,4 @@ expression that evaluates to /false/.] [:`is_void::value_type` is the type `bool`.] [endsect] + diff --git a/doc/is_volatile.qbk b/doc/is_volatile.qbk index 95a3f66..4ce311a 100644 --- a/doc/is_volatile.qbk +++ b/doc/is_volatile.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:is_volatile is_volatile] template struct is_volatile : public __tof {}; @@ -25,3 +32,4 @@ at the top level in this case.] [:`is_volatile::value_type` is the type `bool`.] [endsect] + diff --git a/doc/make_signed.qbk b/doc/make_signed.qbk index 08ae175..87fa3ac 100644 --- a/doc/make_signed.qbk +++ b/doc/make_signed.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:make_signed make_signed] template @@ -37,3 +44,4 @@ __header ` #include ` or ` #include @@ -37,3 +44,4 @@ __header ` #include ` or ` #include `] (provided `T` is not `bool`) [endsect] + diff --git a/doc/promote.qbk b/doc/promote.qbk index 08cc45f..3ed5c6f 100644 --- a/doc/promote.qbk +++ b/doc/promote.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:promote promote] template @@ -28,3 +35,4 @@ __header ` #include ` or ` #include struct rank : public __integral_constant {}; @@ -27,3 +34,4 @@ expression that evaluates to /0/.] [:`rank::value_type` is the type `std::size_t`.] [endsect] + diff --git a/doc/remove_all_extents.qbk b/doc/remove_all_extents.qbk index e9b3dfb..3ab9899 100644 --- a/doc/remove_all_extents.qbk +++ b/doc/remove_all_extents.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:remove_all_extents remove_all_extents] template @@ -34,3 +41,4 @@ __header ` #include ` or ` #include @@ -33,3 +40,4 @@ __header ` #include ` or ` #include @@ -33,3 +40,4 @@ __header ` #include ` or ` #include @@ -34,3 +41,4 @@ __header ` #include ` or ` #include @@ -33,3 +40,4 @@ __header ` #include ` or ` #include @@ -31,3 +38,4 @@ __header ` #include ` or ` #include @@ -33,3 +40,4 @@ __header ` #include ` or ` #include @@ -12,3 +19,4 @@ that is a multiple of `Align`. __header ` #include ` or ` #include ` [endsect] + diff --git a/doc/user_defined.qbk b/doc/user_defined.qbk index 020f06b..cb0636b 100644 --- a/doc/user_defined.qbk +++ b/doc/user_defined.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:user_defined User Defined Specializations] Occationally the end user may need to provide their own specialization @@ -33,3 +40,4 @@ as appropriate: } [endsect] + diff --git a/doc/value_traits.qbk b/doc/value_traits.qbk index a8bc197..beaa664 100644 --- a/doc/value_traits.qbk +++ b/doc/value_traits.qbk @@ -1,3 +1,10 @@ +[/ + Copyright 2007 John Maddock. + 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). +] + [section:value_traits Type Traits that Describe the Properties of a Type] These traits are all /value traits/, which is to say the traits classes all @@ -184,4 +191,4 @@ between two types: [endsect] -[endsect] \ No newline at end of file +[endsect] From 2d33f4a1bf1340a91797a16ac5532f2ae6d044a4 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Thu, 8 Nov 2007 09:38:22 +0000 Subject: [PATCH 52/56] Fixed license text. [SVN r40925] --- doc/html/boost_typetraits/background.html | 205 +++++++++--------- doc/html/boost_typetraits/category.html | 15 +- .../boost_typetraits/category/alignment.html | 32 ++- .../boost_typetraits/category/function.html | 29 ++- .../boost_typetraits/category/transform.html | 77 +++---- .../category/value_traits.html | 29 ++- .../category/value_traits/primary.html | 79 +++---- .../category/value_traits/properties.html | 77 +++---- .../category/value_traits/relate.html | 31 ++- doc/html/boost_typetraits/credits.html | 14 +- doc/html/boost_typetraits/examples.html | 15 +- doc/html/boost_typetraits/examples/copy.html | 33 ++- .../boost_typetraits/examples/destruct.html | 30 ++- doc/html/boost_typetraits/examples/fill.html | 36 ++- doc/html/boost_typetraits/examples/iter.html | 40 ++-- .../boost_typetraits/examples/to_double.html | 21 +- doc/html/boost_typetraits/intrinsics.html | 61 +++--- doc/html/boost_typetraits/intro.html | 18 +- doc/html/boost_typetraits/mpl.html | 30 +-- doc/html/boost_typetraits/reference.html | 15 +- .../boost_typetraits/reference/add_const.html | 61 +++--- .../boost_typetraits/reference/add_cv.html | 67 +++--- .../reference/add_pointer.html | 61 +++--- .../reference/add_reference.html | 59 ++--- .../reference/add_volatile.html | 63 +++--- .../reference/aligned_storage.html | 30 +-- .../reference/alignment_of.html | 46 ++-- .../boost_typetraits/reference/decay.html | 63 +++--- .../boost_typetraits/reference/extent.html | 59 +++-- .../reference/floating_point_promotion.html | 61 +++--- .../reference/function_traits.html | 90 ++++---- .../reference/has_no_throw_def_cons.html | 19 +- .../reference/has_nothrow_assign.html | 37 ++-- .../reference/has_nothrow_constructor.html | 44 ++-- .../reference/has_nothrow_copy.html | 41 ++-- .../reference/has_nothrow_cp_cons.html | 18 +- .../reference/has_trivial_assign.html | 53 +++-- .../reference/has_trivial_constructor.html | 58 +++-- .../reference/has_trivial_copy.html | 55 +++-- .../reference/has_trivial_cp_cons.html | 18 +- .../reference/has_trivial_def_cons.html | 19 +- .../reference/has_trivial_destructor.html | 52 ++--- .../reference/has_virtual_destructor.html | 40 ++-- .../reference/integral_constant.html | 20 +- .../reference/integral_promotion.html | 57 ++--- .../reference/is_abstract.html | 50 ++--- .../reference/is_arithmetic.html | 48 ++-- .../boost_typetraits/reference/is_array.html | 46 ++-- .../reference/is_base_of.html | 70 +++--- .../boost_typetraits/reference/is_class.html | 60 ++--- .../reference/is_complex.html | 32 +-- .../reference/is_compound.html | 50 ++--- .../boost_typetraits/reference/is_const.html | 48 ++-- .../reference/is_convertible.html | 74 +++---- .../boost_typetraits/reference/is_empty.html | 54 ++--- .../boost_typetraits/reference/is_enum.html | 58 ++--- .../reference/is_floating_point.html | 44 ++-- .../reference/is_function.html | 79 ++++--- .../reference/is_fundamental.html | 52 ++--- .../reference/is_integral.html | 47 ++-- .../reference/is_member_function_pointer.html | 58 +++-- .../reference/is_member_object_pointer.html | 58 +++-- .../reference/is_member_pointer.html | 45 ++-- .../boost_typetraits/reference/is_object.html | 52 ++--- .../boost_typetraits/reference/is_pod.html | 48 ++-- .../reference/is_pointer.html | 54 ++--- .../reference/is_polymorphic.html | 52 ++--- .../reference/is_reference.html | 48 ++-- .../boost_typetraits/reference/is_same.html | 48 ++-- .../boost_typetraits/reference/is_scalar.html | 52 ++--- .../boost_typetraits/reference/is_signed.html | 52 ++--- .../reference/is_stateless.html | 42 ++-- .../boost_typetraits/reference/is_union.html | 54 ++--- .../reference/is_unsigned.html | 56 ++--- .../boost_typetraits/reference/is_void.html | 48 ++-- .../reference/is_volatile.html | 46 ++-- .../reference/make_signed.html | 59 ++--- .../reference/make_unsigned.html | 61 +++--- .../boost_typetraits/reference/promote.html | 60 ++--- doc/html/boost_typetraits/reference/rank.html | 52 ++--- .../reference/remove_all_extents.html | 65 +++--- .../reference/remove_const.html | 63 +++--- .../boost_typetraits/reference/remove_cv.html | 63 +++--- .../reference/remove_extent.html | 63 +++--- .../reference/remove_pointer.html | 61 +++--- .../reference/remove_reference.html | 57 ++--- .../reference/remove_volatile.html | 63 +++--- .../reference/type_with_alignment.html | 28 +-- doc/html/boost_typetraits/user_defined.html | 27 ++- doc/html/index.html | 11 +- doc/type_traits.qbk | 9 +- 91 files changed, 2188 insertions(+), 2257 deletions(-) diff --git a/doc/html/boost_typetraits/background.html b/doc/html/boost_typetraits/background.html index be75eb7..64d11c0 100644 --- a/doc/html/boost_typetraits/background.html +++ b/doc/html/boost_typetraits/background.html @@ -1,13 +1,13 @@ - Background and Tutorial +Background and Tutorial - + - - + + @@ -24,7 +24,8 @@

    The following is an updated version of the article "C++ Type traits" by John Maddock and Steve Cleary that appeared in the October 2000 issue of @@ -45,29 +46,29 @@ Consider an example: when working with character strings, one common operation is to determine the length of a null terminated string. Clearly it's possible to write generic code that can do this, but it turns out that there are much - more efficient methods available: for example, the C library functions strlen and wcslen + more efficient methods available: for example, the C library functions strlen and wcslen are usually written in assembler, and with suitable hardware support can be considerably faster than a generic version written in C++. The authors of the - C++ standard library realized this, and abstracted the properties of char and wchar_t - into the class char_traits. - Generic code that works with character strings can simply use char_traits<>::length to determine the length of a null - terminated string, safe in the knowledge that specializations of char_traits will use the most appropriate + C++ standard library realized this, and abstracted the properties of char and wchar_t + into the class char_traits. + Generic code that works with character strings can simply use char_traits<>::length to determine the length of a null + terminated string, safe in the knowledge that specializations of char_traits will use the most appropriate method available to them.

    -

    - +

    + Type Traits -
    +

    - Class char_traits is a classic + Class char_traits is a classic example of a collection of type specific properties wrapped up in a single class - what Nathan Myers termed a baggage class[1]. In the Boost type-traits library, we[2] have written a set of very specific traits classes, each of which encapsulate a single trait from the C++ type system; for example, is a type a pointer or a reference type? Or does a type have a trivial constructor, or a const-qualifier? The type-traits classes - share a unified design: each class inherits from a the type true_type - if the type has the specified property and inherits from false_type + share a unified design: each class inherits from a the type true_type + if the type has the specified property and inherits from false_type otherwise. As we will show, these classes can be used in generic programming to determine the properties of a given type and introduce optimizations that are appropriate for that case. @@ -76,51 +77,51 @@ The type-traits library also contains a set of classes that perform a specific transformation on a type; for example, they can remove a top-level const or volatile qualifier from a type. Each class that performs a transformation defines - a single typedef-member type + a single typedef-member type that is the result of the transformation. All of the type-traits classes are - defined inside namespace boost; + defined inside namespace boost; for brevity, namespace-qualification is omitted in most of the code samples given.

    -

    - +

    + Implementation -
    +

    There are far too many separate classes contained in the type-traits library to give a full implementation here - see the source code in the Boost library for the full details - however, most of the implementation is fairly repetitive anyway, so here we will just give you a flavor for how some of the classes are implemented. Beginning with possibly the simplest class in the library, - is_void<T> inherits - from true_type - only if T is void. + is_void<T> inherits + from true_type + only if T is void.

     template <typename T> 
    -struct is_void : public false_type{};
    +struct is_void : public false_type{};
     
     template <> 
    -struct is_void<void> : public true_type{};
    +struct is_void<void> : public true_type{};
     

    - Here we define a primary version of the template class is_void, - and provide a full-specialization when T - is void. While full specialization + Here we define a primary version of the template class is_void, + and provide a full-specialization when T + is void. While full specialization of a template class is an important technique, sometimes we need a solution that is halfway between a fully generic solution, and a full specialization. This is exactly the situation for which the standards committee defined partial - template-class specialization. As an example, consider the class boost::is_pointer<T>: + template-class specialization. As an example, consider the class boost::is_pointer<T>: here we needed a primary version that handles all the cases where T is not a pointer, and a partial specialization to handle all the cases where T is a pointer:

     template <typename T> 
    -struct is_pointer : public false_type{};
    +struct is_pointer : public false_type{};
     
     template <typename T> 
    -struct is_pointer<T*> : public true_type{};
    +struct is_pointer<T*> : public true_type{};
     

    The syntax for partial specialization is somewhat arcane and could easily occupy @@ -152,35 +153,35 @@ and close enough to the actual rule to be useful for everyday use.

    - As a more complex example of partial specialization consider the class remove_extent<T>. This - class defines a single typedef-member type + As a more complex example of partial specialization consider the class remove_extent<T>. This + class defines a single typedef-member type that is the same type as T but with any top-level array bounds removed; this is an example of a traits class that performs a transformation on a type:

     template <typename T> 
    -struct remove_extent
    +struct remove_extent
     { typedef T type; };
     
     template <typename T, std::size_t N> 
    -struct remove_extent<T[N]>
    +struct remove_extent<T[N]>
     { typedef T type; };
     

    - The aim of remove_extent + The aim of remove_extent is this: imagine a generic algorithm that is passed an array type as a template - parameter, remove_extent + parameter, remove_extent provides a means of determining the underlying type of the array. For example - remove_extent<int[4][5]>::type would evaluate to the type int[5]. This example also shows that the number of + remove_extent<int[4][5]>::type would evaluate to the type int[5]. This example also shows that the number of template parameters in a partial specialization does not have to match the number in the default template. However, the number of parameters that appear after the class name do have to match the number and type of the parameters in the default template.

    -

    - +

    + Optimized copy -
    +

    As an example of how the type traits classes can be used, consider the standard library algorithm copy: @@ -191,24 +192,24 @@

    Obviously, there's no problem writing a generic version of copy that works - for all iterator types Iter1 - and Iter2; however, there are + for all iterator types Iter1 + and Iter2; however, there are some circumstances when the copy operation can best be performed by a call - to memcpy. In order to implement - copy in terms of memcpy all + to memcpy. In order to implement + copy in terms of memcpy all of the following conditions need to be met:

    • - Both of the iterator types Iter1 - and Iter2 must be pointers. + Both of the iterator types Iter1 + and Iter2 must be pointers.
    • - Both Iter1 and Iter2 must point to the same type - excluding + Both Iter1 and Iter2 must point to the same type - excluding const and volatile-qualifiers.
    • - The type pointed to by Iter1 + The type pointed to by Iter1 must have a trivial assignment operator.
    @@ -228,34 +229,33 @@

    - If all these conditions are met then a type can be copied using memcpy rather than using a compiler generated - assignment operator. The type-traits library provides a class has_trivial_assign, - such that has_trivial_assign<T>::value is true only if T has a trivial assignment + If all these conditions are met then a type can be copied using memcpy rather than using a compiler generated + assignment operator. The type-traits library provides a class has_trivial_assign, + such that has_trivial_assign<T>::value is true only if T has a trivial assignment operator. This class "just works" for scalar types, but has to be explicitly specialised for class/struct types that also happen to have a trivial - assignment operator. In other words if has_trivial_assign + assignment operator. In other words if has_trivial_assign gives the wrong answer, it will give the "safe" wrong answer - that trivial assignment is not allowable.

    - The code for an optimized version of copy that uses memcpy - where appropriate is given in the - examples. The code begins by defining a template function do_copy that performs a "slow but safe" - copy. The last parameter passed to this function may be either a true_type - or a false_type. + The code for an optimized version of copy that uses memcpy + where appropriate is given in the + examples. The code begins by defining a template function do_copy that performs a "slow but safe" + copy. The last parameter passed to this function may be either a true_type + or a false_type. Following that there is an overload of docopy that uses `memcpy`: this time the iterators are required to actually be pointers - to the same type, and the final parameter must be a `_true_type. Finally, the version - of copy calls - docopy`, passing `_has_trivial_assign<value_type>()` + to the same type, and the final parameter must be a `_true_type. Finally, the version + of copy calls + docopy`, passing `_has_trivial_assign<value_type>()` as the final parameter: this will dispatch to the optimized version where appropriate, otherwise it will call the "slow but safe version".

    -

    - +

    + Was it worth it? -
    +

    It has often been repeated in these columns that "premature optimization is the root of all evil" [4]. @@ -286,9 +286,9 @@

    -

    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)

    -
    @@ -382,12 +382,12 @@ -
    +
    -

    - +

    + Pair of References -
    +

    The optimized copy example shows how type traits may be used to perform optimization decisions at compile-time. Another important usage of type traits is to allow @@ -397,7 +397,7 @@ references [6].

    - First, let us examine the definition of std::pair, omitting + First, let us examine the definition of std::pair, omitting the comparison operators, default constructor, and template copy constructor for simplicity:

    @@ -423,8 +423,8 @@ to hold non-reference types, references, and constant references:

    -

    Table 1.2. Required Constructor Argument Types

    - +

    Table 1.2. Required Constructor Argument Types

    +
    @@ -432,7 +432,7 @@ -

    - Type of T1 + Type of T1

    @@ -479,18 +479,18 @@
    +
    -

    +

    A little familiarity with the type traits classes allows us to construct a single mapping that allows us to determine the type of parameter from the type - of the contained class. The type traits classes provide a transformation add_reference, which + of the contained class. The type traits classes provide a transformation add_reference, which 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

    -
    @@ -500,17 +500,17 @@ @@ -567,10 +567,10 @@ -

    - Type of T1 + Type of T1

    - Type of const T1 + Type of const T1

    - Type of add_reference<const T1>::type + Type of add_reference<const T1>::type

    +
    -

    - This allows us to build a primary template definition for pair +

    + This allows us to build a primary template definition for pair that can contain non-reference types, reference types, and constant reference types:

    @@ -584,20 +584,20 @@ T1 first; T2 second; -pair(boost::add_reference<const T1>::type nfirst, - boost::add_reference<const T2>::type nsecond) +pair(boost::add_reference<const T1>::type nfirst, + boost::add_reference<const T2>::type nsecond) :first(nfirst), second(nsecond) { } };

    Add back in the standard comparison operators, default constructor, and template - copy constructor (which are all the same), and you have a std::pair that + copy constructor (which are all the same), and you have a std::pair that can hold reference types!

    This same extension could have been done using partial template specialization - of pair, but to specialize - pair in this way would require + of pair, but to specialize + pair in this way would require three partial specializations, plus the primary template. Type traits allows us to define a single primary template that adjusts itself auto-magically to any of these partial specializations, instead of a brute-force partial specialization @@ -605,10 +605,10 @@ partial specialization to the type traits classes, resulting in code that is easier to maintain and easier to understand.

    -

    - +

    + Conclusion -
    +

    We hope that in this article we have been able to give you some idea of what type-traits are all about. A more complete listing of the available classes @@ -618,18 +618,18 @@ does not have to sink to the lowest common denominator, and that templates can be optimal as well as generic.

    -

    - +

    + Acknowledgements -
    +

    The authors would like to thank Beman Dawes and Howard Hinnant for their helpful comments when preparing this article.

    -

    - +

    + References -
    +
    1. Nathan C. Myers, C++ Report, June 1995. @@ -682,8 +682,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/category.html b/doc/html/boost_typetraits/category.html index 430f830..a089195 100644 --- a/doc/html/boost_typetraits/category.html +++ b/doc/html/boost_typetraits/category.html @@ -1,14 +1,13 @@ - Type Traits by Category +Type Traits by Category - + - - + + @@ -25,7 +24,8 @@
    Type Traits that Describe the Properties of a Type
    @@ -52,8 +52,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/category/alignment.html b/doc/html/boost_typetraits/category/alignment.html index 39ba2ad..93ee9ed 100644 --- a/doc/html/boost_typetraits/category/alignment.html +++ b/doc/html/boost_typetraits/category/alignment.html @@ -1,16 +1,13 @@ - Synthesizing Types - with Specific Alignments +Synthesizing Types with Specific Alignments - + - - - + + + @@ -27,24 +24,24 @@

    Some low level memory management routines need to synthesize a POD type with - specific alignment properties. The template type_with_alignment - finds the smallest type with a specified alignment, while template aligned_storage + specific alignment properties. The template type_with_alignment + finds the smallest type with a specified alignment, while template aligned_storage creates a type with a specific size and alignment.

    - Synopsis + Synopsis

     template <std::size_t Align>
    -struct type_with_alignment;
    +struct type_with_alignment;
     
     template <std::size_t Size, std::size_t Align>
    -struct aligned_storage;
    +struct aligned_storage;
     
    @@ -54,8 +51,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/category/function.html b/doc/html/boost_typetraits/category/function.html index 3da077d..9c601a6 100644 --- a/doc/html/boost_typetraits/category/function.html +++ b/doc/html/boost_typetraits/category/function.html @@ -1,15 +1,13 @@ - Decomposing Function - Types +Decomposing Function Types - + - - - + + + @@ -26,21 +24,21 @@

    - The class template function_traits - extracts information from function types (see also is_function). + The class template function_traits + extracts information from function types (see also is_function). This traits class allows you to tell how many arguments a function takes, what those argument types are, and what the return type is.

    - Synopsis + Synopsis

     template <std::size_t Align>
    -struct function_traits;
    +struct function_traits;
     
    @@ -50,8 +48,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/category/transform.html b/doc/html/boost_typetraits/category/transform.html index 0ddfae9..f4805fc 100644 --- a/doc/html/boost_typetraits/category/transform.html +++ b/doc/html/boost_typetraits/category/transform.html @@ -1,16 +1,13 @@ - Type Traits that - Transform One Type to Another +Type Traits that Transform One Type to Another - + - - - + + + @@ -27,79 +24,78 @@

    The following templates transform one type to another, based upon some well-defined - rule. Each template has a single member called type + rule. Each template has a single member called type that is the result of applying the transformation to the template argument - T. + T.

    - Synopsis: + Synopsis:

     template <class T>
    -struct add_const;
    +struct add_const;
     
     template <class T>
    -struct add_cv;
    +struct add_cv;
     
     template <class T>
    -struct add_pointer;
    +struct add_pointer;
     
     template <class T>
    -struct add_reference;
    +struct add_reference;
     
     template <class T>
    -struct add_volatile;
    +struct add_volatile;
     
     template <class T>
    -struct decay;
    +struct decay;
     
     template <class T>
    -struct floating_point_promotion;
    +struct floating_point_promotion;
     
     template <class T>
    -struct integral_promotion;
    +struct integral_promotion;
     
     template <class T>
    -struct make_signed;
    +struct make_signed;
     
     template <class T>
    -struct make_unsigned;
    +struct make_unsigned;
     
     template <class T>
    -struct promote;
    +struct promote;
     
     template <class T>
    -struct remove_all_extents;
    +struct remove_all_extents;
     
     template <class T>
    -struct remove_const;
    +struct remove_const;
     
     template <class T>
    -struct remove_cv;
    +struct remove_cv;
     
     template <class T>
    -struct remove_extent;
    +struct remove_extent;
     
     template <class T>
    -struct remove_pointer;
    +struct remove_pointer;
     
     template <class T>
    -struct remove_reference;
    +struct remove_reference;
     
     template <class T>
    -struct remove_volatile;
    +struct remove_volatile;
     
    -

    - +

    + Broken Compiler Workarounds: -
    +

    For all of these templates support for partial specialization of class templates is required to correctly implement the transformation. On the other hand, @@ -133,8 +129,8 @@

    and the second part provides the library's users with a mechanism to make - the above code work not only for char, - int or other built-in type, + the above code work not only for char, + int or other built-in type, but for their own types as well:

    @@ -150,7 +146,7 @@
     

    Note that the macro BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION evaluates - to nothing on those compilers that do support + to nothing on those compilers that do support partial specialization.

    @@ -161,8 +157,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/category/value_traits.html b/doc/html/boost_typetraits/category/value_traits.html index 2c59bcc..2be34d3 100644 --- a/doc/html/boost_typetraits/category/value_traits.html +++ b/doc/html/boost_typetraits/category/value_traits.html @@ -1,15 +1,13 @@ - Type Traits - that Describe the Properties of a Type +Type Traits that Describe the Properties of a Type - + - - - + + + @@ -26,9 +24,9 @@
    Categorizing a Type
    @@ -39,13 +37,13 @@

    These traits are all value traits, which is to say the - traits classes all inherit from integral_constant, + traits classes all inherit from integral_constant, and are used to access some numerical property of a type. Often this is a simple true or false Boolean value, but in a few cases may be some other integer value (for example when dealing with type alignments, or array bounds: - see alignment_of, - rank - and extent). + see alignment_of, + rank + and extent).

    @@ -55,8 +53,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/category/value_traits/primary.html b/doc/html/boost_typetraits/category/value_traits/primary.html index 2235fc4..bb82e5f 100644 --- a/doc/html/boost_typetraits/category/value_traits/primary.html +++ b/doc/html/boost_typetraits/category/value_traits/primary.html @@ -1,17 +1,13 @@ - Categorizing - a Type +Categorizing a Type - + - - - + + + @@ -28,71 +24,69 @@

    - These traits identify what "kind" of type some type T is. These are split into two groups: + These traits identify what "kind" of type some type T is. These are split into two groups: primary traits which are all mutually exclusive, and composite traits that are compositions of one or more primary traits.

    - For any given type, exactly one primary type trait will inherit from true_type, - and all the others will inherit from false_type, + For any given type, exactly one primary type trait will inherit from true_type, + and all the others will inherit from false_type, in other words these traits are mutually exclusive.

    - This means that is_integral<T>::value - and is_floating_point<T>::value + This means that is_integral<T>::value + and is_floating_point<T>::value will only ever be true for built-in types; if you want to check for a user-defined class type that behaves "as if" it is an integral or floating - point type, then use the std::numeric_limits - template instead. + point type, then use the std::numeric_limits + template instead.

    - Synopsis: + Synopsis:

     template <class T>
    -struct is_array<T>;
    +struct is_array<T>;
       
     template <class T>
    -struct is_class<T>;
    +struct is_class<T>;
     
     template <class T>
    -struct is_complex<T>;
    +struct is_complex<T>;
       
     template <class T>
    -struct is_enum<T>;
    +struct is_enum<T>;
       
     template <class T>
    -struct is_floating_point<T>;
    +struct is_floating_point<T>;
       
     template <class T>
    -struct is_function<T>;
    +struct is_function<T>;
     
     template <class T>
    -struct is_integral<T>;
    +struct is_integral<T>;
       
     template <class T>
    -struct is_member_function_pointer<T>;
    +struct is_member_function_pointer<T>;
       
     template <class T>
    -struct is_member_object_pointer<T>;
    +struct is_member_object_pointer<T>;
       
     template <class T>
    -struct is_pointer<T>;
    +struct is_pointer<T>;
       
     template <class T>
    -struct is_reference<T>;
    +struct is_reference<T>;
       
     template <class T>
    -struct is_union<T>;
    +struct is_union<T>;
       
     template <class T>
    -struct is_void<T>;
    +struct is_void<T>;
     

    The following traits are made up of the union of one or more type categorizations. @@ -101,22 +95,22 @@

     template <class T>
    -struct is_arithmetic;
    +struct is_arithmetic;
     
     template <class T>
    -struct is_compound;
    +struct is_compound;
     
     template <class T>
    -struct is_fundamental;
    +struct is_fundamental;
     
     template <class T>
    -struct is_member_pointer;
    +struct is_member_pointer;
     
     template <class T>
    -struct is_object;
    +struct is_object;
     
     template <class T>
    -struct is_scalar;
    +struct is_scalar;
     
    @@ -126,8 +120,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/category/value_traits/properties.html b/doc/html/boost_typetraits/category/value_traits/properties.html index 96e6482..cbe6c24 100644 --- a/doc/html/boost_typetraits/category/value_traits/properties.html +++ b/doc/html/boost_typetraits/category/value_traits/properties.html @@ -1,17 +1,13 @@ - - General Type Properties +General Type Properties - + - - - + + + @@ -28,91 +24,87 @@

    The following templates describe the general properties of a type.

    - Synopsis: + Synopsis:

     template <class T>
    -struct alignment_of;
    +struct alignment_of;
     
     template <class T>
    -struct has_nothrow_assign;
    +struct has_nothrow_assign;
     
     template <class T>
    -struct has_nothrow_constructor;
    +struct has_nothrow_constructor;
     
     template <class T>
    -struct has_nothrow_default_constructor;
    +struct has_nothrow_default_constructor;
     
     template <class T>
    -struct has_nothrow_copy;
    +struct has_nothrow_copy;
     
     template <class T>
    -struct has_nothrow_copy_constructor;
    +struct has_nothrow_copy_constructor;
     
     template <class T>
    -struct has_trivial_assign;
    +struct has_trivial_assign;
     
     template <class T>
    -struct has_trivial_constructor;
    +struct has_trivial_constructor;
     
     template <class T>
    -struct has_trivial_default_constructor;
    +struct has_trivial_default_constructor;
     
     template <class T>
    -struct has_trivial_copy;
    +struct has_trivial_copy;
     
     template <class T>
    -struct has_trivial_copy_constructor;
    +struct has_trivial_copy_constructor;
     
     template <class T>
    -struct has_trivial_destructor;
    +struct has_trivial_destructor;
     
     template <class T>
    -struct has_virtual_destructor;
    +struct has_virtual_destructor;
     
     template <class T>
    -struct is_abstract;
    +struct is_abstract;
     
     template <class T>
    -struct is_const;
    +struct is_const;
     
     template <class T>
    -struct is_empty;
    +struct is_empty;
     
     template <class T>
    -struct is_stateless;
    +struct is_stateless;
     
     template <class T>
    -struct is_pod;
    +struct is_pod;
     
     template <class T>
    -struct is_polymorphic;
    +struct is_polymorphic;
     
     template <class T>
    -struct is_signed;
    +struct is_signed;
     
     template <class T>
    -struct is_unsigned;
    +struct is_unsigned;
     
     template <class T>
    -struct is_volatile;
    +struct is_volatile;
     
     template <class T, std::size_t N = 0>
    -struct extent;
    +struct extent;
     
     template <class T>
    -struct rank;
    +struct rank;
     
    @@ -122,8 +114,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/category/value_traits/relate.html b/doc/html/boost_typetraits/category/value_traits/relate.html index 65ae0d5..2ec8d13 100644 --- a/doc/html/boost_typetraits/category/value_traits/relate.html +++ b/doc/html/boost_typetraits/category/value_traits/relate.html @@ -1,17 +1,13 @@ - Relationships - Between Two Types +Relationships Between Two Types - + - - - + + + @@ -28,25 +24,25 @@

    These templates determine the whether there is a relationship between two types:

    - Synopsis: + Synopsis:

     template <class Base, class Derived>
    -struct is_base_of;
    +struct is_base_of;
     
     template <class From, class To>
    -struct is_convertible;
    +struct is_convertible;
     
     template <class T, class U>
    -struct is_same;
    +struct is_same;
     
    @@ -56,8 +52,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/credits.html b/doc/html/boost_typetraits/credits.html index ef9135e..954bff6 100644 --- a/doc/html/boost_typetraits/credits.html +++ b/doc/html/boost_typetraits/credits.html @@ -1,12 +1,12 @@ - Credits +Credits - + - + @@ -23,7 +23,8 @@

    This documentation was pulled together by John Maddock, using Boost.Quickbook and Boost.DocBook. @@ -48,7 +49,7 @@ Aleksey Gurtovoy added MPL integration to the library.

    - The is_convertible + The is_convertible template is based on code originally devised by Andrei Alexandrescu, see "Generic<Programming>: Mappings between Types and Values".

    @@ -65,8 +66,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/examples.html b/doc/html/boost_typetraits/examples.html index 232541b..f3966c9 100644 --- a/doc/html/boost_typetraits/examples.html +++ b/doc/html/boost_typetraits/examples.html @@ -1,14 +1,13 @@ - Examples +Examples - + - - + + @@ -25,7 +24,8 @@
    An Optimized Version of std::copy
    @@ -46,8 +46,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/examples/copy.html b/doc/html/boost_typetraits/examples/copy.html index 9ada6be..bc55a07 100644 --- a/doc/html/boost_typetraits/examples/copy.html +++ b/doc/html/boost_typetraits/examples/copy.html @@ -1,15 +1,13 @@ - An Optimized Version - of std::copy +An Optimized Version of std::copy - + - - - + + + @@ -26,13 +24,13 @@

    - Demonstrates a version of std::copy - that uses has_trivial_assign - to determine whether to use memcpy + Demonstrates a version of std::copy + that uses has_trivial_assign + to determine whether to use memcpy to optimise the copy operation (see copy_example.cpp):

    @@ -45,7 +43,7 @@
     namespace detail{
     
     template<typename I1, typename I2, bool b>
    -I2 copy_imp(I1 first, I1 last, I2 out, const boost::integral_constant<bool, b>&)
    +I2 copy_imp(I1 first, I1 last, I2 out, const boost::integral_constant<bool, b>&)
     {
        while(first != last)
        {
    @@ -57,7 +55,7 @@
     }
     
     template<typename T>
    -T* copy_imp(const T* first, const T* last, T* out, const boost::true_type&)
    +T* copy_imp(const T* first, const T* last, T* out, const boost::true_type&)
     {
        memcpy(out, first, (last-first)*sizeof(T));
        return out+(last-first);
    @@ -75,7 +73,7 @@
        // requirement we detect with overload resolution):
        //
        typedef typename std::iterator_traits<I1>::value_type value_type;
    -   return detail::copy_imp(first, last, out, boost::has_trivial_assign<value_type>());
    +   return detail::copy_imp(first, last, out, boost::has_trivial_assign<value_type>());
     }
     
    @@ -86,8 +84,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/examples/destruct.html b/doc/html/boost_typetraits/examples/destruct.html index 2a3d2d4..de97cb2 100644 --- a/doc/html/boost_typetraits/examples/destruct.html +++ b/doc/html/boost_typetraits/examples/destruct.html @@ -1,16 +1,13 @@ - An Example that - Omits Destructor Calls For Types with Trivial Destructors +An Example that Omits Destructor Calls For Types with Trivial Destructors - + - - - + + + @@ -27,11 +24,11 @@

    - Demonstrates a simple algorithm that uses __has_trivial_destruct + Demonstrates a simple algorithm that uses __has_trivial_destruct to determine whether to destructors need to be called (see trivial_destructor_example.cpp):

    @@ -44,7 +41,7 @@
     namespace detail{
     
     template <class T>
    -void do_destroy_array(T* first, T* last, const boost::false_type&)
    +void do_destroy_array(T* first, T* last, const boost::false_type&)
     {
        while(first != last)
        {
    @@ -54,7 +51,7 @@
     }
     
     template <class T>
    -inline void do_destroy_array(T* first, T* last, const boost::true_type&)
    +inline void do_destroy_array(T* first, T* last, const boost::true_type&)
     {
     }
     
    @@ -63,7 +60,7 @@
     template <class T>
     inline void destroy_array(T* p1, T* p2)
     {
    -   detail::do_destroy_array(p1, p2, ::boost::has_trivial_destructor<T>());
    +   detail::do_destroy_array(p1, p2, ::boost::has_trivial_destructor<T>());
     }
     
    @@ -74,8 +71,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/examples/fill.html b/doc/html/boost_typetraits/examples/fill.html index 48d62c6..d371390 100644 --- a/doc/html/boost_typetraits/examples/fill.html +++ b/doc/html/boost_typetraits/examples/fill.html @@ -1,16 +1,13 @@ - An Optimised Version - of std::fill +An Optimised Version of std::fill - + - - - + + + @@ -27,13 +24,13 @@

    - Demonstrates a version of std::fill - that uses has_trivial_assign - to determine whether to use memset + Demonstrates a version of std::fill + that uses has_trivial_assign + to determine whether to use memset to optimise the fill operation (see fill_example.cpp):

    @@ -44,7 +41,7 @@
     namespace detail{
     
     template <typename I, typename T, bool b>
    -void do_fill(I first, I last, const T& val, const boost::integral_constant<bool, b>&)
    +void do_fill(I first, I last, const T& val, const boost::integral_constant<bool, b>&)
     {
        while(first != last)
        {
    @@ -54,7 +51,7 @@
     }
     
     template <typename T>
    -void do_fill(T* first, T* last, const T& val, const boost::true_type&)
    +void do_fill(T* first, T* last, const T& val, const boost::true_type&)
     {
        std::memset(first, val, last-first);
     }
    @@ -68,8 +65,8 @@
        // We can do an optimised fill if T has a trivial assignment 
        // operator and if it's size is one:
        //
    -   typedef boost::integral_constant<bool, 
    -      ::boost::has_trivial_assign<T>::value && (sizeof(T) == 1)> truth_type;
    +   typedef boost::integral_constant<bool, 
    +      ::boost::has_trivial_assign<T>::value && (sizeof(T) == 1)> truth_type;
        detail::do_fill(first, last, val, truth_type());
     }
     
    @@ -81,8 +78,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/examples/iter.html b/doc/html/boost_typetraits/examples/iter.html index 7573ba9..f3c1318 100644 --- a/doc/html/boost_typetraits/examples/iter.html +++ b/doc/html/boost_typetraits/examples/iter.html @@ -1,16 +1,13 @@ - An improved Version - of std::iter_swap +An improved Version of std::iter_swap - + - - - + + + @@ -27,14 +24,14 @@

    - Demonstrates a version of std::iter_swap + Demonstrates a version of std::iter_swap that use type traits to determine whether an it's arguments are proxying - iterators or not, if they're not then it just does a std::swap - of it's dereferenced arguments (the same as std::iter_swap + iterators or not, if they're not then it just does a std::swap + of it's dereferenced arguments (the same as std::iter_swap does), however if they are proxying iterators then takes special care over the swap to ensure that the algorithm works correctly for both proxying iterators, and even iterators of different types (see iter_swap_example.cpp): @@ -48,7 +45,7 @@ namespace detail{ template <typename I> -static void do_swap(I one, I two, const boost::false_type&) +static void do_swap(I one, I two, const boost::false_type&) { typedef typename std::iterator_traits<I>::value_type v_t; v_t v = *one; @@ -56,7 +53,7 @@ *two = v; } template <typename I> -static void do_swap(I one, I two, const boost::true_type&) +static void do_swap(I one, I two, const boost::true_type&) { using std::swap; swap(*one, *two); @@ -74,10 +71,10 @@ typedef typename std::iterator_traits<I1>::reference r1_t; typedef typename std::iterator_traits<I2>::reference r2_t; - typedef boost::integral_constant<bool, - ::boost::is_reference<r1_t>::value - && ::boost::is_reference<r2_t>::value - && ::boost::is_same<r1_t, r2_t>::value> truth_type; + typedef boost::integral_constant<bool, + ::boost::is_reference<r1_t>::value + && ::boost::is_reference<r2_t>::value + && ::boost::is_same<r1_t, r2_t>::value> truth_type; detail::do_swap(one, two, truth_type()); } @@ -90,8 +87,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/examples/to_double.html b/doc/html/boost_typetraits/examples/to_double.html index 6cac92b..c1a59f0 100644 --- a/doc/html/boost_typetraits/examples/to_double.html +++ b/doc/html/boost_typetraits/examples/to_double.html @@ -1,15 +1,13 @@ - Convert Numeric - Types and Enums to double +Convert Numeric Types and Enums to double - + - - - + + + @@ -26,9 +24,9 @@

    Demonstrates a conversion of Numeric Types and enum types to double: @@ -49,8 +47,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/intrinsics.html b/doc/html/boost_typetraits/intrinsics.html index acc298b..8c40bbe 100644 --- a/doc/html/boost_typetraits/intrinsics.html +++ b/doc/html/boost_typetraits/intrinsics.html @@ -1,13 +1,13 @@ - Support for Compiler Intrinsics +Support for Compiler Intrinsics - + - - + + @@ -24,7 +24,8 @@

    There are some traits that can not be implemented within the current C++ language: to make these traits "just work" with user defined types, some kind @@ -37,18 +38,16 @@ for all types (but all have safe fallback positions if this support is unavailable):

    The following traits classes can't be portably implemented in the C++ language, @@ -56,15 +55,15 @@ all the compilers we know about:

    The following traits classes are dependent on one or more of the above:

    The hooks for compiler-intrinsic support are defined in boost/type_traits/intrinsics.hpp, @@ -72,8 +71,8 @@ of the following macros:

    -

    Table 1.4. Macros for Compiler Intrinsics

    -
    +

    Table 1.4. Macros for Compiler Intrinsics

    +
    @@ -175,8 +174,8 @@ @@ -189,7 +188,7 @@ @@ -201,11 +200,11 @@ @@ -222,8 +221,9 @@ -

    - Should evaluate to true if T - x; + Should evaluate to true if T + x; can not throw

    - Should evaluate to true if T(t) can not throw + Should evaluate to true if T(t) can not throw

    - Should evaluate to true if T + Should evaluate to true if T t, u; t = - u can not throw + u can not throw

    +
    +
    @@ -232,8 +232,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/intro.html b/doc/html/boost_typetraits/intro.html index df2f346..d0e1cca 100644 --- a/doc/html/boost_typetraits/intro.html +++ b/doc/html/boost_typetraits/intro.html @@ -1,13 +1,13 @@ - Introduction +Introduction - + - + @@ -24,7 +24,8 @@

    The Boost type-traits library contains a set of very specific traits classes, each of which encapsulate a single trait from the C++ type system; for example, @@ -33,15 +34,15 @@

    The type-traits classes share a unified design: each class inherits from a - the type true_type - if the type has the specified property and inherits from false_type + the type true_type + if the type has the specified property and inherits from false_type otherwise.

    The type-traits library also contains a set of classes that perform a specific transformation on a type; for example, they can remove a top-level const or volatile qualifier from a type. Each class that performs a transformation defines - a single typedef-member type + a single typedef-member type that is the result of the transformation.

    @@ -52,8 +53,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/mpl.html b/doc/html/boost_typetraits/mpl.html index e4d5ae0..3eddb4a 100644 --- a/doc/html/boost_typetraits/mpl.html +++ b/doc/html/boost_typetraits/mpl.html @@ -1,13 +1,13 @@ - MPL Interoperability +MPL Interoperability - + - - + + @@ -24,7 +24,8 @@

    All the value based traits in this library conform to MPL's requirements for an Integral @@ -32,14 +33,14 @@ for broken compilers.

    - Purely as an implementation detail, this means that true_type - inherits from boost::mpl::true_, - false_type - inherits from boost::mpl::false_, - and integral_constant<T, - v> - inherits from boost::mpl::integral_c<T,v> - (provided T is not bool) + Purely as an implementation detail, this means that true_type + inherits from boost::mpl::true_, + false_type + inherits from boost::mpl::false_, + and integral_constant<T, + v> + inherits from boost::mpl::integral_c<T,v> + (provided T is not bool)

    @@ -49,8 +50,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference.html b/doc/html/boost_typetraits/reference.html index 3512f1e..e0200a3 100644 --- a/doc/html/boost_typetraits/reference.html +++ b/doc/html/boost_typetraits/reference.html @@ -1,14 +1,13 @@ - Alphabetical Reference +Alphabetical Reference - + - - + + @@ -25,7 +24,8 @@
    add_const
    add_cv
    @@ -109,8 +109,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/add_const.html b/doc/html/boost_typetraits/reference/add_const.html index 01782bd..90feb0b 100644 --- a/doc/html/boost_typetraits/reference/add_const.html +++ b/doc/html/boost_typetraits/reference/add_const.html @@ -1,13 +1,13 @@ - add_const +add_const - + - - - + + + @@ -24,37 +24,38 @@
     template <class T>
     struct add_const
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: The same type as T - const for all T. + type: The same type as T + const for all T.

    - C++ Standard Reference: 3.9.3. + C++ Standard Reference: 3.9.3.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

    - Header: #include - <boost/type_traits/add_const.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/add_const.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.5. Examples

    -
    +

    Table 1.5. Examples

    +
    @@ -75,55 +76,56 @@ -

    - add_const<int>::type + add_const<int>::type

    - int const + int const

    - add_const<int&>::type + add_const<int&>::type

    - int& + int&

    - add_const<int*>::type + add_const<int*>::type

    - int* - const + int* + const

    - add_const<int const>::type + add_const<int const>::type

    - int const + int const

    +
    +
    @@ -132,8 +134,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/add_cv.html b/doc/html/boost_typetraits/reference/add_cv.html index 22249d5..81da4df 100644 --- a/doc/html/boost_typetraits/reference/add_cv.html +++ b/doc/html/boost_typetraits/reference/add_cv.html @@ -1,13 +1,13 @@ - add_cv +add_cv - + - - - + + + @@ -24,38 +24,39 @@
     template <class T>
     struct add_cv
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: The same type as T - const volatile - for all T. + type: The same type as T + const volatile + for all T.

    - C++ Standard Reference: 3.9.3. + C++ Standard Reference: 3.9.3.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

    - Header: #include - <boost/type_traits/add_cv.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/add_cv.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.6. Examples

    -
    +

    Table 1.6. Examples

    +
    @@ -76,57 +77,58 @@ -

    - add_cv<int>::type + add_cv<int>::type

    - int const - volatile + int const + volatile

    - add_cv<int&>::type + add_cv<int&>::type

    - int& + int&

    - add_cv<int*>::type + add_cv<int*>::type

    - int* - const volatile + int* + const volatile

    - add_cv<int const>::type + add_cv<int const>::type

    - int const - volatile + int const + volatile

    +
    +
    @@ -135,8 +137,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/add_pointer.html b/doc/html/boost_typetraits/reference/add_pointer.html index 6c46a15..b6588e1 100644 --- a/doc/html/boost_typetraits/reference/add_pointer.html +++ b/doc/html/boost_typetraits/reference/add_pointer.html @@ -1,13 +1,13 @@ - add_pointer +add_pointer - + - - - + + + @@ -24,40 +24,41 @@
     template <class T>
     struct add_pointer
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: The same type as remove_reference<T>::type*. + type: The same type as remove_reference<T>::type*.

    - The rationale for this template is that it produces the same type as TYPEOF(&t), where - t is an object of type T. + The rationale for this template is that it produces the same type as TYPEOF(&t), where + t is an object of type T.

    - C++ Standard Reference: 8.3.1. + C++ Standard Reference: 8.3.1.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

    - Header: #include - <boost/type_traits/add_pointer.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/add_pointer.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.7. Examples

    -
    +

    Table 1.7. Examples

    +
    @@ -78,54 +79,55 @@ -

    - add_pointer<int>::type + add_pointer<int>::type

    - int* + int*

    - add_pointer<int const&>::type + add_pointer<int const&>::type

    - int const* + int const*

    - add_pointer<int*>::type + add_pointer<int*>::type

    - int** + int**

    - add_pointer<int*&>::type + add_pointer<int*&>::type

    - int** + int**

    +
    +
    @@ -134,8 +136,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/add_reference.html b/doc/html/boost_typetraits/reference/add_reference.html index 9d48aa3..15fd08a 100644 --- a/doc/html/boost_typetraits/reference/add_reference.html +++ b/doc/html/boost_typetraits/reference/add_reference.html @@ -1,13 +1,13 @@ - add_reference +add_reference - + - - - + + + @@ -24,37 +24,38 @@
     template <class T>
     struct add_reference
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: If T - is not a reference type then T&, otherwise T. + type: If T + is not a reference type then T&, otherwise T.

    - C++ Standard Reference: 8.3.2. + C++ Standard Reference: 8.3.2.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

    - Header: #include - <boost/type_traits/add_reference.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/add_reference.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.8. Examples

    -
    +

    Table 1.8. Examples

    +
    @@ -75,54 +76,55 @@ -

    - add_reference<int>::type + add_reference<int>::type

    - int& + int&

    - add_reference<int const&>::type + add_reference<int const&>::type

    - int const& + int const&

    - add_reference<int*>::type + add_reference<int*>::type

    - int*& + int*&

    - add_reference<int*&>::type + add_reference<int*&>::type

    - int*& + int*&

    +
    +
    @@ -131,8 +133,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/add_volatile.html b/doc/html/boost_typetraits/reference/add_volatile.html index c11e104..0dd76f7 100644 --- a/doc/html/boost_typetraits/reference/add_volatile.html +++ b/doc/html/boost_typetraits/reference/add_volatile.html @@ -1,13 +1,13 @@ - add_volatile +add_volatile - + - - - + + + @@ -24,37 +24,38 @@
     template <class T>
     struct add_volatile
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: The same type as T - volatile for all T. + type: The same type as T + volatile for all T.

    - C++ Standard Reference: 3.9.3. + C++ Standard Reference: 3.9.3.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

    - Header: #include - <boost/type_traits/add_volatile.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/add_volatile.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.9. Examples

    -
    +

    Table 1.9. Examples

    +
    @@ -75,56 +76,57 @@ -

    - add_volatile<int>::type + add_volatile<int>::type

    - int volatile + int volatile

    - add_volatile<int&>::type + add_volatile<int&>::type

    - int& + int&

    - add_volatile<int*>::type + add_volatile<int*>::type

    - int* - volatile + int* + volatile

    - add_volatile<int const>::type + add_volatile<int const>::type

    - int const - volatile + int const + volatile

    +
    +
    @@ -133,8 +135,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/aligned_storage.html b/doc/html/boost_typetraits/reference/aligned_storage.html index 9521fbb..5c2ee56 100644 --- a/doc/html/boost_typetraits/reference/aligned_storage.html +++ b/doc/html/boost_typetraits/reference/aligned_storage.html @@ -1,13 +1,13 @@ - aligned_storage +aligned_storage - + - - - + + + @@ -24,23 +24,24 @@
     template <std::size_t Size, std::size_t Align>
     struct aligned_storage
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: a built-in or POD type with size - Size and an alignment that - is a multiple of Align. + type: a built-in or POD type with size + Size and an alignment that + is a multiple of Align.

    - Header: #include - <boost/type_traits/aligned_storage.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/aligned_storage.hpp> + or #include <boost/type_traits.hpp>

    @@ -50,8 +51,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/alignment_of.html b/doc/html/boost_typetraits/reference/alignment_of.html index c089b70..1759dc0 100644 --- a/doc/html/boost_typetraits/reference/alignment_of.html +++ b/doc/html/boost_typetraits/reference/alignment_of.html @@ -1,13 +1,13 @@ - alignment_of +alignment_of - + - - - + + + @@ -24,35 +24,36 @@
     template <class T>
    -struct alignment_of : public integral_constant<std::size_t, ALIGNOF(T)> {};
    +struct alignment_of : public integral_constant<std::size_t, ALIGNOF(T)> {};
     

    - Inherits: Class template alignmentof inherits from `_integral_constant<std::size_t, - ALIGNOF(T)>, where - ALIGNOF(T)` is the alignment of type T. + Inherits: Class template alignmentof inherits from `_integral_constant<std::size_t, + ALIGNOF(T)>, where + ALIGNOF(T)` is the alignment of type T.

    - Note: strictly speaking you should only rely on the value of ALIGNOF(T) being + Note: strictly speaking you should only rely on the value of ALIGNOF(T) being a multiple of the true alignment of T, although in practice it does compute the correct value in all the cases we know about.

    - Header: #include - <boost/type_traits/alignment_of.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/alignment_of.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - alignment_of<int> - inherits from integral_constant<std::size_t, ALIGNOF(int)>. + alignment_of<int> + inherits from integral_constant<std::size_t, ALIGNOF(int)>.

    @@ -61,7 +62,7 @@

    - alignment_of<char>::type is the type integral_constant<std::size_t, ALIGNOF(char)>. + alignment_of<char>::type is the type integral_constant<std::size_t, ALIGNOF(char)>.

    @@ -70,8 +71,8 @@

    - alignment_of<double>::value is an integral constant expression - with value ALIGNOF(double). + alignment_of<double>::value is an integral constant expression + with value ALIGNOF(double).

    @@ -80,7 +81,7 @@

    - alignment_of<T>::value_type is the type std::size_t. + alignment_of<T>::value_type is the type std::size_t.

    @@ -93,8 +94,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/decay.html b/doc/html/boost_typetraits/reference/decay.html index c6b24d0..c3f7d2e 100644 --- a/doc/html/boost_typetraits/reference/decay.html +++ b/doc/html/boost_typetraits/reference/decay.html @@ -1,13 +1,13 @@ - decay +decay - + - - - + + + @@ -24,32 +24,33 @@
     template <class T>
     struct decay
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: Let U - be the result of remove_reference<T>::type, then if U - is an array type, the result is remove_extent<U>*, - otherwise if U is a function - type then the result is U*, otherwise the result is U. + type: Let U + be the result of remove_reference<T>::type, then if U + is an array type, the result is remove_extent<U>*, + otherwise if U is a function + type then the result is U*, otherwise the result is U.

    - C++ Standard Reference: 3.9.1. + C++ Standard Reference: 3.9.1.

    - Header: #include - <boost/type_traits/decay.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/decay.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.10. Examples

    -
    +

    Table 1.10. Examples

    +
    @@ -70,66 +71,67 @@ -

    - decay<int[2][3]>::type + decay<int[2][3]>::type

    - int[2]* + int[2]*

    - decay<int(&)[2]>::type + decay<int(&)[2]>::type

    - int* + int*

    - decay<int(&)(double)>::type + decay<int(&)(double)>::type

    - int(*)(double) + int(*)(double)

    - int(*)(double + int(*)(double

    - int(*)(double) + int(*)(double)

    - int(double) + int(double)

    - int(*)(double) + int(*)(double)

    + +
    @@ -138,8 +140,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/extent.html b/doc/html/boost_typetraits/reference/extent.html index 841df98..caa6195 100644 --- a/doc/html/boost_typetraits/reference/extent.html +++ b/doc/html/boost_typetraits/reference/extent.html @@ -1,14 +1,13 @@ - extent +extent - + - - - + + + @@ -25,36 +24,37 @@
     template <class T, std::size_t N = 0>
    -struct extent : public integral_constant<std::size_t, EXTENT(T,N)> {};
    +struct extent : public integral_constant<std::size_t, EXTENT(T,N)> {};
     

    - Inherits: Class template extent inherits - from integral_constant<std::size_t, EXTENT(T,N)>, - where EXTENT(T,N) is the number of elements in the N'th array - dimention of type T. + Inherits: Class template extent inherits + from integral_constant<std::size_t, EXTENT(T,N)>, + where EXTENT(T,N) is the number of elements in the N'th array + dimention of type T.

    - If T is not an array type, - or if N > - rank<T>::value, or if the N'th array bound is incomplete, - then EXTENT(T,N) is zero. + If T is not an array type, + or if N > + rank<T>::value, or if the N'th array bound is incomplete, + then EXTENT(T,N) is zero.

    - Header: #include - <boost/type_traits/extent.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/extent.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - extent<int[1]> inherits from integral_constant<std::size_t, 1>. + extent<int[1]> inherits from integral_constant<std::size_t, 1>.

    @@ -63,8 +63,8 @@

    - extent<double[2][3][4], - 1>::type is the type integral_constant<std::size_t, 3>. + extent<double[2][3][4], + 1>::type is the type integral_constant<std::size_t, 3>.

    @@ -73,7 +73,7 @@

    - extent<int[4]>::value + extent<int[4]>::value is an integral constant expression that evaluates to 4.

    @@ -83,7 +83,7 @@

    - extent<int[][2]>::value is an integral constant expression + extent<int[][2]>::value is an integral constant expression that evaluates to 0.

    @@ -93,7 +93,7 @@

    - extent<int[][2], 1>::value + extent<int[][2], 1>::value is an integral constant expression that evaluates to 2.

    @@ -103,7 +103,7 @@

    - extent<int*>::value is an integral constant expression + extent<int*>::value is an integral constant expression that evaluates to 0.

    @@ -113,7 +113,7 @@

    - extent<T>::value_type is the type std::size_t. + extent<T>::value_type is the type std::size_t.

    @@ -126,8 +126,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/floating_point_promotion.html b/doc/html/boost_typetraits/reference/floating_point_promotion.html index 45b057b..b1dbd38 100644 --- a/doc/html/boost_typetraits/reference/floating_point_promotion.html +++ b/doc/html/boost_typetraits/reference/floating_point_promotion.html @@ -1,14 +1,13 @@ - - floating_point_promotion +floating_point_promotion - + - - - + + + @@ -25,34 +24,34 @@
     template <class T>
     struct floating_point_promotion
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: If floating point promotion can be - applied to an rvalue of type T, - then applies floating point promotion to T - and keeps cv-qualifiers of T, - otherwise leaves T unchanged. + type: If floating point promotion can be + applied to an rvalue of type T, + then applies floating point promotion to T + and keeps cv-qualifiers of T, + otherwise leaves T unchanged.

    - C++ Standard Reference: 4.6. + C++ Standard Reference: 4.6.

    - Header: #include - <boost/type_traits/floating_point_promotion.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/floating_point_promotion.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.11. Examples

    -
    +

    Table 1.11. Examples

    +
    @@ -73,43 +72,44 @@ -

    - floating_point_promotion<float - const>::type + floating_point_promotion<float + const>::type

    - double const + double const

    - floating_point_promotion<float&>::type + floating_point_promotion<float&>::type

    - float& + float&

    - floating_point_promotion<short>::type + floating_point_promotion<short>::type

    - short + short

    + +
    @@ -118,8 +118,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/function_traits.html b/doc/html/boost_typetraits/reference/function_traits.html index 0e0a357..3ca347b 100644 --- a/doc/html/boost_typetraits/reference/function_traits.html +++ b/doc/html/boost_typetraits/reference/function_traits.html @@ -1,14 +1,13 @@ - function_traits +function_traits - + - - - + + + @@ -25,14 +24,15 @@
     template <class T>
     struct function_traits
     {
    -   static const std::size_t    arity = see-below;
    -   typedef see-below           result_type;
    -   typedef see-below           argN_type; 
    +   static const std::size_t    arity = see-below;
    +   typedef see-below           result_type;
    +   typedef see-below           argN_type; 
     };
     

    @@ -43,8 +43,8 @@ The compiler supports partial specialization of class templates.

  • - The template argument T - is a function type, note that this is not the same thing as a pointer + The template argument T + is a function type, note that this is not the same thing as a pointer to a function.
  • @@ -53,15 +53,15 @@ -
    [Tip] Tip

    +

    function_traits is intended to introspect only C++ functions of the form R (), R( A1 ), R ( A1, ... etc. ) and not function pointers or class member - functions. To convert a function pointer type to a suitable type use remove_pointer. + functions. To convert a function pointer type to a suitable type use remove_pointer.

    -

    Table 1.12. Function Traits Members

    - +

    Table 1.12. Function Traits Members

    +
    @@ -82,49 +82,49 @@ -

    - function_traits<T>::arity + function_traits<T>::arity

    An integral constant expression that gives the number of arguments - accepted by the function type F. + accepted by the function type F.

    - function_traits<T>::result_type + function_traits<T>::result_type

    - The type returned by function type F. + The type returned by function type F.

    - function_traits<T>::argN_type + function_traits<T>::argN_type

    - The Nth argument type of function type F, - where 1 <= + The Nth argument type of function type F, + where 1 <= N <= - arity of F. + arity of F.

    +
    -
    -

    Table 1.13. Examples

    - +
    +

    Table 1.13. Examples

    +
    @@ -145,7 +145,7 @@ @@ -242,7 +242,7 @@ -

    - function_traits<void (void)>::arity + function_traits<void (void)>::arity

    @@ -157,7 +157,7 @@

    - function_traits<long (int)>::arity + function_traits<long (int)>::arity

    @@ -169,7 +169,7 @@

    - function_traits<long (int, long, double, void*)>::arity + function_traits<long (int, long, double, void*)>::arity

    @@ -181,60 +181,60 @@

    - function_traits<void (void)>::result_type + function_traits<void (void)>::result_type

    - The type void. + The type void.

    - function_traits<long (int)>::result_type + function_traits<long (int)>::result_type

    - The type long. + The type long.

    - function_traits<long (int)>::arg1_type + function_traits<long (int)>::arg1_type

    - The type int. + The type int.

    - function_traits<long (int, long, double, void*)>::arg4_type + function_traits<long (int, long, double, void*)>::arg4_type

    - The type void*. + The type void*.

    - function_traits<long (int, long, double, void*)>::arg5_type + function_traits<long (int, long, double, void*)>::arg5_type

    - A compiler error: there is no arg4_type + A compiler error: there is no arg4_type since there are only three arguments.

    - function_traits<long (*)(void)>::arity + function_traits<long (*)(void)>::arity

    @@ -253,8 +253,9 @@
    +
    +
    @@ -263,8 +264,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/has_no_throw_def_cons.html b/doc/html/boost_typetraits/reference/has_no_throw_def_cons.html index 16ef48b..b71350d 100644 --- a/doc/html/boost_typetraits/reference/has_no_throw_def_cons.html +++ b/doc/html/boost_typetraits/reference/has_no_throw_def_cons.html @@ -1,13 +1,13 @@ - has_nothrow_default_constructor +has_nothrow_default_constructor - + - - - + + + @@ -24,10 +24,10 @@

    - See has_nothrow_constructor. + See has_nothrow_constructor.

    @@ -37,8 +37,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/has_nothrow_assign.html b/doc/html/boost_typetraits/reference/has_nothrow_assign.html index 55d9259..669a827 100644 --- a/doc/html/boost_typetraits/reference/has_nothrow_assign.html +++ b/doc/html/boost_typetraits/reference/has_nothrow_assign.html @@ -1,14 +1,13 @@ - has_nothrow_assign +has_nothrow_assign - + - - - + + + @@ -25,34 +24,35 @@
     template <class T>
    -struct has_nothrow_assign : public true_type-or-false_type {};
    +struct has_nothrow_assign : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - type with a non-throwing assignment-operator then inherits from true_type, - otherwise inherits from false_type. - Type T must be a complete + Inherits: If T is a (possibly cv-qualified) + type with a non-throwing assignment-operator then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete type.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: 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, has_nothrow_assign + Without some (as yet unspecified) help from the compiler, has_nothrow_assign will never report that a class or struct has a non-throwing assignment-operator; this is always safe, if possibly sub-optimal. Currently (May 2005) only Visual C++ 8 has the necessary compiler support to ensure that this trait "just works".

    - Header: #include - <boost/type_traits/has_nothrow_assign.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/has_nothrow_assign.hpp> + or #include <boost/type_traits.hpp>

    @@ -62,8 +62,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/has_nothrow_constructor.html b/doc/html/boost_typetraits/reference/has_nothrow_constructor.html index 7ad0ce3..1406f0f 100644 --- a/doc/html/boost_typetraits/reference/has_nothrow_constructor.html +++ b/doc/html/boost_typetraits/reference/has_nothrow_constructor.html @@ -1,14 +1,13 @@ - - has_nothrow_constructor +has_nothrow_constructor - + - - - + + + @@ -25,42 +24,42 @@
     template <class T>
    -struct has_nothrow_constructor : public true_type-or-false_type {};
    +struct has_nothrow_constructor : public true_type-or-false_type {};
     
     template <class T>
    -struct has_nothrow_default_constructor : public true_type-or-false_type {};
    +struct has_nothrow_default_constructor : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - type with a non-throwing default-constructor then inherits from true_type, - otherwise inherits from false_type. - Type T must be a complete + Inherits: If T is a (possibly cv-qualified) + type with a non-throwing default-constructor then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete type.

    These two traits are synonyms for each other.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: 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, has_nothrow_constructor + Without some (as yet 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 + C++ 8 has the necessary compiler intrinsics to ensure that this trait "just works".

    - Header: #include - <boost/type_traits/has_nothrow_constructor.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/has_nothrow_constructor.hpp> + or #include <boost/type_traits.hpp>

    @@ -70,8 +69,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/has_nothrow_copy.html b/doc/html/boost_typetraits/reference/has_nothrow_copy.html index 72e6967..20b5fd7 100644 --- a/doc/html/boost_typetraits/reference/has_nothrow_copy.html +++ b/doc/html/boost_typetraits/reference/has_nothrow_copy.html @@ -1,14 +1,13 @@ - has_nothrow_copy +has_nothrow_copy - + - - - + + + @@ -25,40 +24,41 @@
     template <class T>
    -struct has_nothrow_copy : public true_type-or-false_type {};
    +struct has_nothrow_copy : public true_type-or-false_type {};
     
     template <class T>
    -struct has_nothrow_copy_constructor : public true_type-or-false_type {};
    +struct has_nothrow_copy_constructor : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - type with a non-throwing copy-constructor then inherits from true_type, - otherwise inherits from false_type. - Type T must be a complete + Inherits: If T is a (possibly cv-qualified) + type with a non-throwing copy-constructor then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete type.

    These two traits are synonyms for each other.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: 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, has_nothrow_copy + 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 + C++ 8 has the necessary compiler intrinsics to ensure that this trait "just works".

    - Header: #include - <boost/type_traits/has_nothrow_copy.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/has_nothrow_copy.hpp> + or #include <boost/type_traits.hpp>

    @@ -68,8 +68,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/has_nothrow_cp_cons.html b/doc/html/boost_typetraits/reference/has_nothrow_cp_cons.html index ee57829..1ef91c3 100644 --- a/doc/html/boost_typetraits/reference/has_nothrow_cp_cons.html +++ b/doc/html/boost_typetraits/reference/has_nothrow_cp_cons.html @@ -1,13 +1,13 @@ - has_nothrow_copy_constructor +has_nothrow_copy_constructor - + - - - + + + @@ -24,9 +24,10 @@

    - See has_nothrow_copy. + See has_nothrow_copy.

    @@ -36,8 +37,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/has_trivial_assign.html b/doc/html/boost_typetraits/reference/has_trivial_assign.html index 88ced5d..968064d 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_assign.html +++ b/doc/html/boost_typetraits/reference/has_trivial_assign.html @@ -1,14 +1,13 @@ - has_trivial_assign +has_trivial_assign - + - - - + + + @@ -25,23 +24,24 @@
     template <class T>
    -struct has_trivial_assign : public true_type-or-false_type {};
    +struct has_trivial_assign : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - type with a trivial assignment-operator then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + type with a trivial assignment-operator then inherits from true_type, + otherwise inherits from false_type.

    If a type has a trivial assignment-operator then the operator has the same effect as copying the bits of one object to the other: calls to the operator - can be safely replaced with a call to memcpy. + can be safely replaced with a call to memcpy.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template can not be used with function types.

    @@ -49,26 +49,26 @@ 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 + 9 and Visual C++ 8 have the necessary compiler intrinsics to detect user-defined classes with trivial constructors.

    - C++ Standard Reference: 12.8p11. + C++ Standard Reference: 12.8p11.

    - Header: #include - <boost/type_traits/has_trivial_assign.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/has_trivial_assign.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - has_trivial_assign<int> - inherits from true_type. + has_trivial_assign<int> + inherits from true_type.

    @@ -77,7 +77,7 @@

    - has_trivial_assign<char*>::type is the type true_type. + has_trivial_assign<char*>::type is the type true_type.

    @@ -86,7 +86,7 @@

    - has_trivial_assign<int (*)(long)>::value is an integral constant expression + has_trivial_assign<int (*)(long)>::value is an integral constant expression that evaluates to true.

    @@ -96,7 +96,7 @@

    - has_trivial_assign<MyClass>::value is an integral constant expression + has_trivial_assign<MyClass>::value is an integral constant expression that evaluates to false.

    @@ -106,7 +106,7 @@

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

    @@ -119,8 +119,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/has_trivial_constructor.html b/doc/html/boost_typetraits/reference/has_trivial_constructor.html index 9e59ba2..0960f00 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_constructor.html +++ b/doc/html/boost_typetraits/reference/has_trivial_constructor.html @@ -1,14 +1,13 @@ - - has_trivial_constructor +has_trivial_constructor - + - - - + + + @@ -25,20 +24,20 @@
     template <class T>
    -struct has_trivial_constructor : public true_type-or-false_type {};
    +struct has_trivial_constructor : public true_type-or-false_type {};
     
     template <class T>
    -struct has_trivial_default_constructor : public true_type-or-false_type {};
    +struct has_trivial_default_constructor : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - type with a trivial default-constructor then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + type with a trivial default-constructor then inherits from true_type, + otherwise inherits from false_type.

    These two traits are synonyms for each other. @@ -51,7 +50,7 @@ some benefit in terms of code size and speed can be obtained.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template can not be used with function types.

    @@ -59,25 +58,25 @@ 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 + 9 and Visual C++ 8 have the necessary compiler intrinsics to detect user-defined classes with trivial constructors.

    - C++ Standard Reference: 12.1p6. + C++ Standard Reference: 12.1p6.

    - Header: #include - <boost/type_traits/has_trivial_constructor.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/has_trivial_constructor.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - has_trivial_constructor<int> inherits from true_type. + has_trivial_constructor<int> inherits from true_type.

    @@ -86,8 +85,8 @@

    - has_trivial_constructor<char*>::type - is the type true_type. + has_trivial_constructor<char*>::type + is the type true_type.

    @@ -96,7 +95,7 @@

    - has_trivial_constructor<int (*)(long)>::value + has_trivial_constructor<int (*)(long)>::value is an integral constant expression that evaluates to true.

    @@ -106,7 +105,7 @@

    - has_trivial_constructor<MyClass>::value + has_trivial_constructor<MyClass>::value is an integral constant expression that evaluates to false.

    @@ -116,8 +115,8 @@

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

    @@ -130,8 +129,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/has_trivial_copy.html b/doc/html/boost_typetraits/reference/has_trivial_copy.html index 566ac98..124a2e7 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_copy.html +++ b/doc/html/boost_typetraits/reference/has_trivial_copy.html @@ -1,14 +1,13 @@ - has_trivial_copy +has_trivial_copy - + - - - + + + @@ -25,18 +24,19 @@
     template <class T>
    -struct has_trivial_copy : public true_type-or-false_type {};
    +struct has_trivial_copy : public true_type-or-false_type {};
     
     template <class T>
    -struct has_trivial_copy_constructor : public true_type-or-false_type {};
    +struct has_trivial_copy_constructor : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - type with a trivial copy-constructor then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + type with a trivial copy-constructor then inherits from true_type, + otherwise inherits from false_type.

    These two traits are synonyms for each other. @@ -44,10 +44,10 @@

    If a type has a trivial copy-constructor then the constructor has the same effect as copying the bits of one object to the other: calls to the constructor - can be safely replaced with a call to memcpy. + can be safely replaced with a call to memcpy.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template can not be used with function types.

    @@ -55,26 +55,26 @@ 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 + 9 and Visual C++ 8 have the necessary compiler intrinsics to detect user-defined classes with trivial constructors.

    - C++ Standard Reference: 12.8p6. + C++ Standard Reference: 12.8p6.

    - Header: #include - <boost/type_traits/has_trivial_copy.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/has_trivial_copy.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - has_trivial_copy<int> - inherits from true_type. + has_trivial_copy<int> + inherits from true_type.

    @@ -83,7 +83,7 @@

    - has_trivial_copy<char*>::type is the type true_type. + has_trivial_copy<char*>::type is the type true_type.

    @@ -92,7 +92,7 @@

    - has_trivial_copy<int (*)(long)>::value is an integral constant expression + has_trivial_copy<int (*)(long)>::value is an integral constant expression that evaluates to true.

    @@ -102,7 +102,7 @@

    - has_trivial_copy<MyClass>::value is an integral constant expression + has_trivial_copy<MyClass>::value is an integral constant expression that evaluates to false.

    @@ -112,7 +112,7 @@

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

    @@ -125,8 +125,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/has_trivial_cp_cons.html b/doc/html/boost_typetraits/reference/has_trivial_cp_cons.html index bcd3a36..2cc9178 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_cp_cons.html +++ b/doc/html/boost_typetraits/reference/has_trivial_cp_cons.html @@ -1,13 +1,13 @@ - has_trivial_copy_constructor +has_trivial_copy_constructor - + - - - + + + @@ -24,9 +24,10 @@

    - See has_trivial_copy. + See has_trivial_copy.

    @@ -36,8 +37,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/has_trivial_def_cons.html b/doc/html/boost_typetraits/reference/has_trivial_def_cons.html index e1bc71e..5af22bb 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_def_cons.html +++ b/doc/html/boost_typetraits/reference/has_trivial_def_cons.html @@ -1,13 +1,13 @@ - has_trivial_default_constructor +has_trivial_default_constructor - + - - - + + + @@ -24,10 +24,10 @@

    - See has_trivial_constructor. + See has_trivial_constructor.

    @@ -37,8 +37,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/has_trivial_destructor.html b/doc/html/boost_typetraits/reference/has_trivial_destructor.html index d65f45e..740179f 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_destructor.html +++ b/doc/html/boost_typetraits/reference/has_trivial_destructor.html @@ -1,13 +1,13 @@ - has_trivial_destructor +has_trivial_destructor - + - - - + + + @@ -24,15 +24,16 @@
     template <class T>
    -struct has_trivial_destructor : public true_type-or-false_type {};
    +struct has_trivial_destructor : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - type with a trivial destructor then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + type with a trivial destructor then inherits from true_type, + otherwise inherits from false_type.

    If a type has a trivial destructor then the destructor has no effect: calls @@ -42,7 +43,7 @@ some benefit in terms of code size and speed can be obtained.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template can not be used with function types.

    @@ -50,25 +51,25 @@ 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 + 9 and Visual C++ 8 have the necessary compiler intrinsics to detect user-defined classes with trivial constructors.

    - C++ Standard Reference: 12.4p3. + C++ Standard Reference: 12.4p3.

    - Header: #include - <boost/type_traits/has_trivial_destructor.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/has_trivial_destructor.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - has_trivial_destructor<int> inherits from true_type. + has_trivial_destructor<int> inherits from true_type.

    @@ -77,8 +78,8 @@

    - has_trivial_destructor<char*>::type - is the type true_type. + has_trivial_destructor<char*>::type + is the type true_type.

    @@ -87,7 +88,7 @@

    - has_trivial_destructor<int (*)(long)>::value + has_trivial_destructor<int (*)(long)>::value is an integral constant expression that evaluates to true.

    @@ -97,7 +98,7 @@

    - has_trivial_destructor<MyClass>::value + has_trivial_destructor<MyClass>::value is an integral constant expression that evaluates to false.

    @@ -107,8 +108,8 @@

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

    @@ -121,8 +122,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/has_virtual_destructor.html b/doc/html/boost_typetraits/reference/has_virtual_destructor.html index 3f74200..43810e2 100644 --- a/doc/html/boost_typetraits/reference/has_virtual_destructor.html +++ b/doc/html/boost_typetraits/reference/has_virtual_destructor.html @@ -1,13 +1,13 @@ - has_virtual_destructor +has_virtual_destructor - + - - - + + + @@ -24,33 +24,34 @@
     template <class T>
    -struct has_virtual_destructor : public true_type-or-false_type {};
    +struct has_virtual_destructor : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - type with a virtual destructor then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + type with a virtual destructor then inherits from true_type, + otherwise inherits from false_type.

    - Compiler Compatibility: This trait is provided + Compiler Compatibility: This trait is provided for completeness, since it's part of the 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, + 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 + the compiler used has compiler intrinsics that enable the trait to do the right thing: currently (May 2005) only Visual - C++ 8 has the necessary intrinsics. + C++ 8 has the necessary intrinsics.

    - C++ Standard Reference: 12.4. + C++ Standard Reference: 12.4.

    - Header: #include - <boost/type_traits/has_virtual_destructor.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/has_virtual_destructor.hpp> + or #include <boost/type_traits.hpp>

    @@ -60,8 +61,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/integral_constant.html b/doc/html/boost_typetraits/reference/integral_constant.html index 8862bdc..e6384e8 100644 --- a/doc/html/boost_typetraits/reference/integral_constant.html +++ b/doc/html/boost_typetraits/reference/integral_constant.html @@ -1,13 +1,13 @@ - integral_constant +integral_constant - + - - - + + + @@ -24,7 +24,8 @@
     template <class T, T val>
     struct integral_constant
    @@ -38,9 +39,9 @@
     typedef integral_constant<bool, false> false_type;
     

    - Class template integral_constant + Class template integral_constant is the common base class for all the value-based type traits. The two typedef's - true_type and false_type are provided for convenience: + true_type and false_type are provided for convenience: most of the value traits are Boolean properties and so will inherit from one of these.

    @@ -52,8 +53,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/integral_promotion.html b/doc/html/boost_typetraits/reference/integral_promotion.html index c08b749..908a74e 100644 --- a/doc/html/boost_typetraits/reference/integral_promotion.html +++ b/doc/html/boost_typetraits/reference/integral_promotion.html @@ -1,13 +1,13 @@ - integral_promotion +integral_promotion - + - - - + + + @@ -24,33 +24,34 @@
     template <class T>
     struct integral_promotion
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: If integral promotion can be applied - to an rvalue of type T, then - applies integral promotion to T - and keeps cv-qualifiers of T, - otherwise leaves T unchanged. + type: If integral promotion can be applied + to an rvalue of type T, then + applies integral promotion to T + and keeps cv-qualifiers of T, + otherwise leaves T unchanged.

    - C++ Standard Reference: 4.5 except 4.5/3 + C++ Standard Reference: 4.5 except 4.5/3 (integral bit-field).

    - Header: #include - <boost/type_traits/integral_promotion.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/integral_promotion.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.14. Examples

    -
    +

    Table 1.14. Examples

    +
    @@ -71,43 +72,44 @@ -

    - integral_promotion<short - const>::type + integral_promotion<short + const>::type

    - int const + int const

    - integral_promotion<short&>::type + integral_promotion<short&>::type

    - short& + short&

    - integral_promotion<enum std::float_round_style>::type + integral_promotion<enum std::float_round_style>::type

    - int + int

    + +
    @@ -116,8 +118,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_abstract.html b/doc/html/boost_typetraits/reference/is_abstract.html index f83feba..79c4770 100644 --- a/doc/html/boost_typetraits/reference/is_abstract.html +++ b/doc/html/boost_typetraits/reference/is_abstract.html @@ -1,13 +1,13 @@ - is_abstract +is_abstract - + - - - + + + @@ -24,28 +24,29 @@
     template <class T>
    -struct is_abstract : public true_type-or-false_type {};
    +struct is_abstract : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - abstract type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + abstract type then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 10.3. + C++ Standard Reference: 10.3.

    - Header: #include - <boost/type_traits/is_abstract.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_abstract.hpp> + or #include <boost/type_traits.hpp>

    - Compiler Compatibility: The compiler must + Compiler Compatibility: The compiler must support DR337 (as of April 2005: GCC 3.4, VC++ 7.1 (and later), Intel C++ - 7 (and later), and Comeau 4.3.2). Otherwise behaves the same as is_polymorphic; + 7 (and later), and Comeau 4.3.2). Otherwise behaves the same as is_polymorphic; this is the "safe fallback position" for which polymorphic types are always regarded as potentially abstract. The macro BOOST_NO_IS_ABSTRACT is used to signify that the implementation is buggy, users should check for @@ -53,13 +54,13 @@ their particular use-case.

    - Examples: + Examples:

    - Given: class abc{ virtual ~abc() = 0; }; + Given: class abc{ virtual ~abc() = 0; };

    @@ -68,8 +69,8 @@

    - is_abstract<abc> - inherits from true_type. + is_abstract<abc> + inherits from true_type.

    @@ -78,7 +79,7 @@

    - is_abstract<abc>::type is the type true_type. + is_abstract<abc>::type is the type true_type.

    @@ -87,7 +88,7 @@

    - is_abstract<abc const>::value + is_abstract<abc const>::value is an integral constant expression that evaluates to true.

    @@ -97,7 +98,7 @@

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

    @@ -110,8 +111,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_arithmetic.html b/doc/html/boost_typetraits/reference/is_arithmetic.html index 84b7284..757785a 100644 --- a/doc/html/boost_typetraits/reference/is_arithmetic.html +++ b/doc/html/boost_typetraits/reference/is_arithmetic.html @@ -1,13 +1,13 @@ - is_arithmetic +is_arithmetic - + - - - + + + @@ -24,35 +24,36 @@
     template <class T>
    -struct is_arithmetic : public true_type-or-false_type {};
    +struct is_arithmetic : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - arithmetic type then inherits from true_type, - otherwise inherits from false_type. - Arithmetic types include integral and floating point types (see also is_integral and - is_floating_point). + Inherits: If T is a (possibly cv-qualified) + arithmetic type then inherits from true_type, + otherwise inherits from false_type. + Arithmetic types include integral and floating point types (see also is_integral and + is_floating_point).

    - C++ Standard Reference: 3.9.1p8. + C++ Standard Reference: 3.9.1p8.

    - Header: #include - <boost/type_traits/is_arithmetic.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_arithmetic.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_arithmetic<int> - inherits from true_type. + is_arithmetic<int> + inherits from true_type.

    @@ -61,7 +62,7 @@

    - is_arithmetic<char>::type is the type true_type. + is_arithmetic<char>::type is the type true_type.

    @@ -70,7 +71,7 @@

    - is_arithmetic<double>::value is an integral constant expression + is_arithmetic<double>::value is an integral constant expression that evaluates to true.

    @@ -80,7 +81,7 @@

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

    @@ -93,8 +94,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_array.html b/doc/html/boost_typetraits/reference/is_array.html index a065229..1862cd6 100644 --- a/doc/html/boost_typetraits/reference/is_array.html +++ b/doc/html/boost_typetraits/reference/is_array.html @@ -1,13 +1,13 @@ - is_array +is_array - + - - - + + + @@ -24,37 +24,38 @@
     template <class T>
    -struct is_array : public true_type-or-false_type {};
    +struct is_array : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - array type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + array type then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.2 and 8.3.4. + C++ Standard Reference: 3.9.2 and 8.3.4.

    - Header: #include - <boost/type_traits/is_array.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_array.hpp> + or #include <boost/type_traits.hpp>

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template can give the wrong result with function types.

    - Examples: + Examples:

    - is_array<int[2]> inherits from true_type. + is_array<int[2]> inherits from true_type.

    @@ -63,8 +64,8 @@

    - is_array<char[2][3]>::type - is the type true_type. + is_array<char[2][3]>::type + is the type true_type.

    @@ -73,7 +74,7 @@

    - is_array<double[]>::value is an integral constant expression + is_array<double[]>::value is an integral constant expression that evaluates to true.

    @@ -83,7 +84,7 @@

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

    @@ -96,8 +97,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_base_of.html b/doc/html/boost_typetraits/reference/is_base_of.html index 2533dfc..b64c5fa 100644 --- a/doc/html/boost_typetraits/reference/is_base_of.html +++ b/doc/html/boost_typetraits/reference/is_base_of.html @@ -1,13 +1,13 @@ - is_base_of +is_base_of - + - - - + + + @@ -24,56 +24,57 @@
     template <class Base, class Derived>
    -struct is_base_of : public true_type-or-false_type {};
    +struct is_base_of : public true_type-or-false_type {};
     

    - Inherits: If Base is base class of type - Derived or if both types are the same then inherits from true_type, - otherwise inherits from false_type. + Inherits: If Base is base class of type + Derived or if both types are the same then inherits from true_type, + otherwise inherits from false_type.

    This template will detect non-public base classes, and ambiguous base classes.

    - Note that is_base_of<X,X> will always inherit from true_type. - This is the case even if X - is not a class type. This is a change in behaviour from Boost-1.33 + Note that is_base_of<X,X> will always inherit from true_type. + This is the case even if X + is not a class type. This is a change in behaviour from Boost-1.33 in order to track the Technical Report on C++ Library Extensions.

    - Types Base and Derived must not be incomplete types. + Types Base and Derived must not be incomplete types.

    - C++ Standard Reference: 10. + C++ Standard Reference: 10.

    - Header: #include - <boost/type_traits/is_base_of.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_base_of.hpp> + or #include <boost/type_traits.hpp>

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template can not be used with function types. There are some older compilers which - will produce compiler errors if Base - is a private base class of Derived, - or if Base is an ambiguous - base of Derived. These compilers + will produce compiler errors if Base + is a private base class of Derived, + or if Base is an ambiguous + base of Derived. These compilers include Borland C++, older versions of Sun Forte C++, Digital Mars C++, and older versions of EDG based compilers.

    - Examples: + Examples:

    - Given: class Base{}; class Derived : - public Base{}; + Given: class Base{}; class Derived : + public Base{};

    @@ -82,8 +83,8 @@

    - is_base_of<Base, Derived> - inherits from true_type. + is_base_of<Base, Derived> + inherits from true_type.

    @@ -92,7 +93,7 @@

    - is_base_of<Base, Derived>::type is the type true_type. + is_base_of<Base, Derived>::type is the type true_type.

    @@ -101,7 +102,7 @@

    - is_base_of<Base, Derived>::value is an integral constant expression + is_base_of<Base, Derived>::value is an integral constant expression that evaluates to true.

    @@ -111,7 +112,7 @@

    - is_base_of<Base, Derived>::value is an integral constant expression + is_base_of<Base, Derived>::value is an integral constant expression that evaluates to true.

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

    - is_base_of<Base, Base>::value is an integral constant expression + is_base_of<Base, Base>::value is an integral constant expression that evaluates to true: a class is regarded as it's own base.

    @@ -132,7 +133,7 @@

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

    @@ -145,8 +146,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_class.html b/doc/html/boost_typetraits/reference/is_class.html index 6d34c76..ee73ee6 100644 --- a/doc/html/boost_typetraits/reference/is_class.html +++ b/doc/html/boost_typetraits/reference/is_class.html @@ -1,13 +1,13 @@ - is_class +is_class - + - - - + + + @@ -24,40 +24,41 @@
     template <class T>
    -struct is_class : public true_type-or-false_type {};
    +struct is_class : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - class type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + class type then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.2 and 9.2. + C++ Standard Reference: 3.9.2 and 9.2.

    - Header: #include - <boost/type_traits/is_class.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_class.hpp> + or #include <boost/type_traits.hpp>

    - Compiler Compatibility: Without (some as + Compiler Compatibility: Without (some as 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 + 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.

    - Examples: + Examples:

    - Given: class MyClass; then: + Given: class MyClass; then:

    @@ -66,8 +67,8 @@

    - is_class<MyClass> - inherits from true_type. + is_class<MyClass> + inherits from true_type.

    @@ -76,8 +77,8 @@

    - is_class<MyClass const>::type - is the type true_type. + is_class<MyClass const>::type + is the type true_type.

    @@ -86,7 +87,7 @@

    - is_class<MyClass>::value is an integral constant expression + is_class<MyClass>::value is an integral constant expression that evaluates to true.

    @@ -96,7 +97,7 @@

    - is_class<MyClass&>::value is an integral constant expression + is_class<MyClass&>::value is an integral constant expression that evaluates to false.

    @@ -106,7 +107,7 @@

    - is_class<MyClass*>::value is an integral constant expression + is_class<MyClass*>::value is an integral constant expression that evaluates to false.

    @@ -116,7 +117,7 @@

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

    @@ -129,8 +130,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_complex.html b/doc/html/boost_typetraits/reference/is_complex.html index 15d6fa5..7b51fbf 100644 --- a/doc/html/boost_typetraits/reference/is_complex.html +++ b/doc/html/boost_typetraits/reference/is_complex.html @@ -1,13 +1,13 @@ - is_complex +is_complex - + - - - + + + @@ -24,24 +24,25 @@
     template <class T>
    -struct is_complex : public true_type-or-false_type {};
    +struct is_complex : public true_type-or-false_type {};
     

    - Inherits: If T - is a complex number type then true (of type std::complex<U> - for some type U), otherwise + Inherits: If T + is a complex number type then true (of type std::complex<U> + for some type U), otherwise false.

    - C++ Standard Reference: 26.2. + C++ Standard Reference: 26.2.

    - Header: #include - <boost/type_traits/is_complex.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_complex.hpp> + or #include <boost/type_traits.hpp>

    @@ -51,8 +52,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_compound.html b/doc/html/boost_typetraits/reference/is_compound.html index 88a04c3..d23e651 100644 --- a/doc/html/boost_typetraits/reference/is_compound.html +++ b/doc/html/boost_typetraits/reference/is_compound.html @@ -1,13 +1,13 @@ - is_compound +is_compound - + - - - + + + @@ -24,34 +24,35 @@
     template <class T>
    -struct is_compound : public true_type-or-false_type {};
    +struct is_compound : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - compound type then inherits from true_type, - otherwise inherits from false_type. - Any type that is not a fundamental type is a compound type (see also is_fundamental). + Inherits: If T is a (possibly cv-qualified) + compound type then inherits from true_type, + otherwise inherits from false_type. + Any type that is not a fundamental type is a compound type (see also is_fundamental).

    - C++ Standard Reference: 3.9.2. + C++ Standard Reference: 3.9.2.

    - Header: #include - <boost/type_traits/is_compound.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_compound.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_compound<MyClass> - inherits from true_type. + is_compound<MyClass> + inherits from true_type.

    @@ -60,7 +61,7 @@

    - is_compound<MyEnum>::type is the type true_type. + is_compound<MyEnum>::type is the type true_type.

    @@ -69,7 +70,7 @@

    - is_compound<int*>::value is an integral constant expression + is_compound<int*>::value is an integral constant expression that evaluates to true.

    @@ -79,7 +80,7 @@

    - is_compound<int&>::value is an integral constant expression + is_compound<int&>::value is an integral constant expression that evaluates to true.

    @@ -89,7 +90,7 @@

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

    @@ -99,7 +100,7 @@

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

    @@ -112,8 +113,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_const.html b/doc/html/boost_typetraits/reference/is_const.html index 2c085d7..b774a2d 100644 --- a/doc/html/boost_typetraits/reference/is_const.html +++ b/doc/html/boost_typetraits/reference/is_const.html @@ -1,13 +1,13 @@ - is_const +is_const - + - - - + + + @@ -24,32 +24,33 @@
     template <class T>
    -struct is_const : public true_type-or-false_type {};
    +struct is_const : public true_type-or-false_type {};
     

    - Inherits: If T is a (top level) const-qualified - type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (top level) const-qualified + type then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.3. + C++ Standard Reference: 3.9.3.

    - Header: #include - <boost/type_traits/is_const.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_const.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_const<int const> inherits from true_type. + is_const<int const> inherits from true_type.

    @@ -58,7 +59,7 @@

    - is_const<int const volatile>::type is the type true_type. + is_const<int const volatile>::type is the type true_type.

    @@ -67,7 +68,7 @@

    - is_const<int* const>::value is an integral constant expression + is_const<int* const>::value is an integral constant expression that evaluates to true.

    @@ -77,7 +78,7 @@

    - is_const<int const*>::value + is_const<int const*>::value is an integral constant expression that evaluates to false: the const-qualifier is not at the top level in this case.

    @@ -88,7 +89,7 @@

    - is_const<int const&>::value + is_const<int const&>::value is an integral constant expression that evaluates to false: the const-qualifier is not at the top level in this case.

    @@ -99,7 +100,7 @@

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

    @@ -109,7 +110,7 @@

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

    @@ -122,8 +123,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_convertible.html b/doc/html/boost_typetraits/reference/is_convertible.html index aaf3b1b..363adc2 100644 --- a/doc/html/boost_typetraits/reference/is_convertible.html +++ b/doc/html/boost_typetraits/reference/is_convertible.html @@ -1,13 +1,13 @@ - is_convertible +is_convertible - + - - - + + + @@ -24,16 +24,17 @@
     template <class From, class To>
    -struct is_convertible : public true_type-or-false_type {};
    +struct is_convertible : public true_type-or-false_type {};
     

    - Inherits: If an imaginary lvalue of type - From is convertible to type - To then inherits from true_type, - otherwise inherits from false_type. + Inherits: If an imaginary lvalue of type + From is convertible to type + To then inherits from true_type, + otherwise inherits from false_type.

    Type From must not be an incomplete type. @@ -46,12 +47,12 @@ types.

    - This template can not detect whether a converting-constructor is public or not: if type To - has a private converting constructor - from type From then instantiating - is_convertible<From, To> - will produce a compiler error. For this reason is_convertible - can not be used to determine whether a type has a public + This template can not detect whether a converting-constructor is public or not: if type To + has a private converting constructor + from type From then instantiating + is_convertible<From, To> + will produce a compiler error. For this reason is_convertible + can not be used to determine whether a type has a public copy-constructor or not.

    @@ -67,30 +68,30 @@ bool const y = boost::is_convertible<D*,A*>::value;

    - C++ Standard Reference: 4 and 8.5. + C++ Standard Reference: 4 and 8.5.

    - Compiler Compatibility: This template is + Compiler Compatibility: This template is currently broken with Borland C++ Builder 5 (and earlier), for constructor-based conversions, and for the Metrowerks 7 (and earlier) compiler in all cases. - If the compiler does not support is_abstract, - then the template parameter To + If the compiler does not support is_abstract, + then the template parameter To must not be an abstract type.

    - Header: #include - <boost/type_traits/is_convertible.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_convertible.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_convertible<int, double> - inherits from true_type. + is_convertible<int, double> + inherits from true_type.

    @@ -99,8 +100,8 @@

    - is_convertible<const int, double>::type - is the type true_type. + is_convertible<const int, double>::type + is the type true_type.

    @@ -109,7 +110,7 @@

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

    @@ -119,9 +120,9 @@

    - is_convertible<int const*, int*>::value + is_convertible<int const*, int*>::value is an integral constant expression that evaluates to false: - the conversion would require a const_cast. + the conversion would require a const_cast.

    @@ -130,7 +131,7 @@

    - is_convertible<int const&, long>::value + is_convertible<int const&, long>::value is an integral constant expression that evaluates to true.

    @@ -140,7 +141,7 @@

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

    @@ -150,7 +151,7 @@

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

    @@ -163,8 +164,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_empty.html b/doc/html/boost_typetraits/reference/is_empty.html index a7b5cb2..17cf607 100644 --- a/doc/html/boost_typetraits/reference/is_empty.html +++ b/doc/html/boost_typetraits/reference/is_empty.html @@ -1,13 +1,13 @@ - is_empty +is_empty - + - - - + + + @@ -24,26 +24,27 @@
     template <class T>
    -struct is_empty : public true_type-or-false_type {};
    +struct is_empty : public true_type-or-false_type {};
     

    - Inherits: If T is an empty class type then - inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is an empty class type then + inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 10p5. + C++ Standard Reference: 10p5.

    - Header: #include - <boost/type_traits/is_empty.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_empty.hpp> + or #include <boost/type_traits.hpp>

    - Compiler Compatibility: In order to correctly + Compiler Compatibility: In order to correctly detect empty classes this trait relies on either:

      @@ -51,7 +52,7 @@ the compiler implementing zero sized empty base classes, or
    • - the compiler providing intrinsics + the compiler providing intrinsics to detect empty classes.
    @@ -66,14 +67,14 @@ then this template can not be used with abstract types.

    - Examples: + Examples:

    - Given: struct empty_class - {}; + Given: struct empty_class + {};

    @@ -82,8 +83,8 @@

    - is_empty<empty_class> - inherits from true_type. + is_empty<empty_class> + inherits from true_type.

    @@ -92,8 +93,8 @@

    - is_empty<empty_class const>::type - is the type true_type. + is_empty<empty_class const>::type + is the type true_type.

    @@ -102,7 +103,7 @@

    - is_empty<empty_class>::value is an integral constant expression + is_empty<empty_class>::value is an integral constant expression that evaluates to true.

    @@ -112,7 +113,7 @@

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

    @@ -125,8 +126,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_enum.html b/doc/html/boost_typetraits/reference/is_enum.html index 3c46a39..081eb22 100644 --- a/doc/html/boost_typetraits/reference/is_enum.html +++ b/doc/html/boost_typetraits/reference/is_enum.html @@ -1,13 +1,13 @@ - is_enum +is_enum - + - - - + + + @@ -24,40 +24,41 @@
     template <class T>
    -struct is_enum : public true_type-or-false_type {};
    +struct is_enum : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - enum type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + enum type then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.2 and 7.2. + C++ Standard Reference: 3.9.2 and 7.2.

    - Header: #include - <boost/type_traits/is_enum.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_enum.hpp> + or #include <boost/type_traits.hpp>

    - Compiler Compatibility: Requires a correctly - functioning is_convertible + Compiler Compatibility: Requires a correctly + functioning is_convertible template; this means that is_enum is currently broken under Borland C++ Builder 5, and for the Metrowerks compiler prior to version 8, other compilers should handle this template just fine.

    - Examples: + Examples:

    - Given: enum my_enum - { one, two }; + Given: enum my_enum + { one, two };

    @@ -66,8 +67,8 @@

    - is_enum<my_enum> - inherits from true_type. + is_enum<my_enum> + inherits from true_type.

    @@ -76,8 +77,8 @@

    - is_enum<my_enum const>::type - is the type true_type. + is_enum<my_enum const>::type + is the type true_type.

    @@ -86,7 +87,7 @@

    - is_enum<my_enum>::value is an integral constant expression + is_enum<my_enum>::value is an integral constant expression that evaluates to true.

    @@ -96,7 +97,7 @@

    - is_enum<my_enum&>::value is an integral constant expression + is_enum<my_enum&>::value is an integral constant expression that evaluates to false.

    @@ -106,7 +107,7 @@

    - is_enum<my_enum*>::value is an integral constant expression + is_enum<my_enum*>::value is an integral constant expression that evaluates to false.

    @@ -116,7 +117,7 @@

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

    @@ -129,8 +130,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_floating_point.html b/doc/html/boost_typetraits/reference/is_floating_point.html index b59bb90..e839de5 100644 --- a/doc/html/boost_typetraits/reference/is_floating_point.html +++ b/doc/html/boost_typetraits/reference/is_floating_point.html @@ -1,13 +1,13 @@ - is_floating_point +is_floating_point - + - - - + + + @@ -24,33 +24,34 @@
     template <class T>
    -struct is_floating_point : public true_type-or-false_type {};
    +struct is_floating_point : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - floating point type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + floating point type then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.1p8. + C++ Standard Reference: 3.9.1p8.

    - Header: #include - <boost/type_traits/is_floating_point.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_floating_point.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_floating_point<float> - inherits from true_type. + is_floating_point<float> + inherits from true_type.

    @@ -59,7 +60,7 @@

    - is_floating_point<double>::type is the type true_type. + is_floating_point<double>::type is the type true_type.

    @@ -68,7 +69,7 @@

    - is_floating_point<long double>::value + is_floating_point<long double>::value is an integral constant expression that evaluates to true.

    @@ -78,7 +79,7 @@

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

    @@ -91,8 +92,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_function.html b/doc/html/boost_typetraits/reference/is_function.html index 78c22a4..79c3b36 100644 --- a/doc/html/boost_typetraits/reference/is_function.html +++ b/doc/html/boost_typetraits/reference/is_function.html @@ -1,13 +1,13 @@ - is_function +is_function - + - - - + + + @@ -24,17 +24,18 @@
     template <class T>
    -struct is_function : public true_type-or-false_type {};
    +struct is_function : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - function type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + function type then inherits from true_type, + otherwise inherits from false_type. Note that this template does not detect pointers to functions, - or references to functions, these are detected by is_pointer and is_reference respectively: + or references to functions, these are detected by is_pointer and is_reference respectively:

     typedef int f1();      // f1 is of function type.
    @@ -42,22 +43,22 @@
     typedef int (f3&)();   // f3 is a reference to a function.
     

    - C++ Standard Reference: 3.9.2p1 and 8.3.5. + C++ Standard Reference: 3.9.2p1 and 8.3.5.

    - Header: #include - <boost/type_traits/is_function.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_function.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_function<int (void)> - inherits from true_type. + is_function<int (void)> + inherits from true_type.

    @@ -66,7 +67,7 @@

    - is_function<long (double, int)>::type is the type true_type. + is_function<long (double, int)>::type is the type true_type.

    @@ -75,7 +76,7 @@

    - is_function<long (double, int)>::value is an integral constant expression + is_function<long (double, int)>::value is an integral constant expression that evaluates to true.

    @@ -85,7 +86,7 @@

    - is_function<long (*)(double, int)>::value is an integral constant expression + is_function<long (*)(double, int)>::value is an integral constant expression that evaluates to false: the argument in this case is a pointer type, not a function type.

    @@ -96,7 +97,7 @@

    - is_function<long (&)(double, int)>::value is an integral constant expression + is_function<long (&)(double, int)>::value is an integral constant expression that evaluates to false: the argument in this case is a reference to a function, not a function type.

    @@ -107,7 +108,7 @@

    - is_function<long (MyClass::*)(double, int)>::value is an integral constant expression + is_function<long (MyClass::*)(double, int)>::value is an integral constant expression that evaluates to false: the argument in this case is a pointer to a member function.

    @@ -118,7 +119,7 @@

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

    @@ -128,46 +129,45 @@
    - @@ -180,8 +180,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

    [Tip] Tip
    +

    Don't confuse function-types with pointers to functions:

    - typedef int - f(double); + typedef int + f(double);

    defines a function type,

    - f foo; + f foo;

    - declares a prototype for a function of type f, + declares a prototype for a function of type f,

    - f* + f* pf = - foo; + foo;

    - f& + f& fr = - foo; + foo;

    - declares a pointer and a reference to the function foo. + declares a pointer and a reference to the function foo.

    If you want to detect whether some type is a pointer-to-function then use:

    - is_function<remove_pointer<T>::type>::value - && is_pointer<T>::value + is_function<remove_pointer<T>::type>::value + && is_pointer<T>::value

    - or for pointers to member functions you can just use is_member_function_pointer + or for pointers to member functions you can just use is_member_function_pointer directly.


    diff --git a/doc/html/boost_typetraits/reference/is_fundamental.html b/doc/html/boost_typetraits/reference/is_fundamental.html index bb416a7..9f78751 100644 --- a/doc/html/boost_typetraits/reference/is_fundamental.html +++ b/doc/html/boost_typetraits/reference/is_fundamental.html @@ -1,13 +1,13 @@ - is_fundamental +is_fundamental - + - - - + + + @@ -24,37 +24,38 @@
     template <class T>
    -struct is_fundamental : public true_type-or-false_type {};
    +struct is_fundamental : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - fundamental type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + fundamental type then inherits from true_type, + otherwise inherits from false_type. Fundamental types include integral, floating point and void types (see also - is_integral, - is_floating_point - and is_void) + is_integral, + is_floating_point + and is_void)

    - C++ Standard Reference: 3.9.1. + C++ Standard Reference: 3.9.1.

    - Header: #include - <boost/type_traits/is_fundamental.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_fundamental.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_fundamental<int)> - inherits from true_type. + is_fundamental<int)> + inherits from true_type.

    @@ -63,8 +64,8 @@

    - is_fundamental<double const>::type - is the type true_type. + is_fundamental<double const>::type + is the type true_type.

    @@ -73,7 +74,7 @@

    - is_fundamental<void>::value is an integral constant expression + is_fundamental<void>::value is an integral constant expression that evaluates to true.

    @@ -83,7 +84,7 @@

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

    @@ -96,8 +97,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_integral.html b/doc/html/boost_typetraits/reference/is_integral.html index 658359c..e4dbb1e 100644 --- a/doc/html/boost_typetraits/reference/is_integral.html +++ b/doc/html/boost_typetraits/reference/is_integral.html @@ -1,14 +1,13 @@ - is_integral +is_integral - + - - - + + + @@ -25,33 +24,34 @@
     template <class T>
    -struct is_integral : public true_type-or-false_type {};
    +struct is_integral : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - integral type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + integral type then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.1p7. + C++ Standard Reference: 3.9.1p7.

    - Header: #include - <boost/type_traits/is_integral.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_integral.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_integral<int> - inherits from true_type. + is_integral<int> + inherits from true_type.

    @@ -60,8 +60,8 @@

    - is_integral<const char>::type - is the type true_type. + is_integral<const char>::type + is the type true_type.

    @@ -70,7 +70,7 @@

    - is_integral<long>::value is an integral constant expression + is_integral<long>::value is an integral constant expression that evaluates to true.

    @@ -80,7 +80,7 @@

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

    @@ -93,8 +93,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_member_function_pointer.html b/doc/html/boost_typetraits/reference/is_member_function_pointer.html index 0b1c012..d658c82 100644 --- a/doc/html/boost_typetraits/reference/is_member_function_pointer.html +++ b/doc/html/boost_typetraits/reference/is_member_function_pointer.html @@ -1,15 +1,13 @@ - - is_member_function_pointer +is_member_function_pointer - + - - - + + + @@ -26,34 +24,34 @@
     template <class T>
    -struct is_member_function_pointer : public true_type-or-false_type {};
    +struct is_member_function_pointer : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - pointer to a member function then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + pointer to a member function then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.2 and 8.3.3. + C++ Standard Reference: 3.9.2 and 8.3.3.

    - Header: #include - <boost/type_traits/is_member_function_pointer.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_member_function_pointer.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_member_function_pointer<int (MyClass::*)(void)> inherits from true_type. + is_member_function_pointer<int (MyClass::*)(void)> inherits from true_type.

    @@ -62,8 +60,8 @@

    - is_member_function_pointer<int (MyClass::*)(char)>::type - is the type true_type. + is_member_function_pointer<int (MyClass::*)(char)>::type + is the type true_type.

    @@ -72,7 +70,7 @@

    - is_member_function_pointer<int (MyClass::*)(void)const>::value + is_member_function_pointer<int (MyClass::*)(void)const>::value is an integral constant expression that evaluates to true.

    @@ -82,12 +80,11 @@

    - is_member_function_pointer<int (MyClass::*)>::value + is_member_function_pointer<int (MyClass::*)>::value is an integral constant expression that evaluates to false: the argument in this case is a pointer to a data member and not a member - function, see is_member_object_pointer - and is_member_pointer + function, see is_member_object_pointer + and is_member_pointer

    @@ -96,8 +93,8 @@

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

    @@ -110,8 +107,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_member_object_pointer.html b/doc/html/boost_typetraits/reference/is_member_object_pointer.html index 9985f9d..47affae 100644 --- a/doc/html/boost_typetraits/reference/is_member_object_pointer.html +++ b/doc/html/boost_typetraits/reference/is_member_object_pointer.html @@ -1,15 +1,13 @@ - - is_member_object_pointer +is_member_object_pointer - + - - - + + + @@ -26,34 +24,34 @@
     template <class T>
    -struct is_member_object_pointer : public true_type-or-false_type {};
    +struct is_member_object_pointer : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - pointer to a member object (a data member) then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + pointer to a member object (a data member) then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.2 and 8.3.3. + C++ Standard Reference: 3.9.2 and 8.3.3.

    - Header: #include - <boost/type_traits/is_member_object_pointer.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_member_object_pointer.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_member_object_pointer<int (MyClass::*)> inherits from true_type. + is_member_object_pointer<int (MyClass::*)> inherits from true_type.

    @@ -62,8 +60,8 @@

    - is_member_object_pointer<double (MyClass::*)>::type - is the type true_type. + is_member_object_pointer<double (MyClass::*)>::type + is the type true_type.

    @@ -72,7 +70,7 @@

    - is_member_object_pointer<const int (MyClass::*)>::value is an integral constant expression + is_member_object_pointer<const int (MyClass::*)>::value is an integral constant expression that evaluates to true.

    @@ -82,12 +80,11 @@

    - is_member_object_pointer<int (MyClass::*)(void)>::value + is_member_object_pointer<int (MyClass::*)(void)>::value is an integral constant expression that evaluates to false: the argument in this case is a pointer to a member function and not a - member object, see is_member_function_pointer - and is_member_pointer + member object, see is_member_function_pointer + and is_member_pointer

    @@ -96,8 +93,8 @@

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

    @@ -110,8 +107,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_member_pointer.html b/doc/html/boost_typetraits/reference/is_member_pointer.html index 9abd0ca..8af5ac9 100644 --- a/doc/html/boost_typetraits/reference/is_member_pointer.html +++ b/doc/html/boost_typetraits/reference/is_member_pointer.html @@ -1,14 +1,13 @@ - is_member_pointer +is_member_pointer - + - - - + + + @@ -25,34 +24,35 @@
     template <class T>
    -struct is_member_pointer : public true_type-or-false_type {};
    +struct is_member_pointer : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) + Inherits: If T is a (possibly cv-qualified) pointer to a member (either a function or a data member) then inherits from - true_type, - otherwise inherits from false_type. + true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.2 and 8.3.3. + C++ Standard Reference: 3.9.2 and 8.3.3.

    - Header: #include - <boost/type_traits/is_member_pointer.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_member_pointer.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_member_pointer<int (MyClass::*)> - inherits from true_type. + is_member_pointer<int (MyClass::*)> + inherits from true_type.

    @@ -61,7 +61,7 @@

    - is_member_pointer<int (MyClass::*)(char)>::type is the type true_type. + is_member_pointer<int (MyClass::*)(char)>::type is the type true_type.

    @@ -70,7 +70,7 @@

    - is_member_pointer<int (MyClass::*)(void)const>::value is an integral constant expression + is_member_pointer<int (MyClass::*)(void)const>::value is an integral constant expression that evaluates to true.

    @@ -80,7 +80,7 @@

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

    @@ -93,8 +93,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_object.html b/doc/html/boost_typetraits/reference/is_object.html index ef116f9..4db0775 100644 --- a/doc/html/boost_typetraits/reference/is_object.html +++ b/doc/html/boost_typetraits/reference/is_object.html @@ -1,13 +1,13 @@ - is_object +is_object - + - - - + + + @@ -24,34 +24,35 @@
     template <class T>
    -struct is_object : public true_type-or-false_type {};
    +struct is_object : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - object type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + object type then inherits from true_type, + otherwise inherits from false_type. All types are object types except references, void, and function types.

    - C++ Standard Reference: 3.9p9. + C++ Standard Reference: 3.9p9.

    - Header: #include - <boost/type_traits/is_object.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_object.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_object<int> - inherits from true_type. + is_object<int> + inherits from true_type.

    @@ -60,7 +61,7 @@

    - is_object<int*>::type is the type true_type. + is_object<int*>::type is the type true_type.

    @@ -69,7 +70,7 @@

    - is_object<int (*)(void)>::value is an integral constant expression + is_object<int (*)(void)>::value is an integral constant expression that evaluates to true.

    @@ -79,7 +80,7 @@

    - is_object<int (MyClass::*)(void)const>::value is an integral constant expression + is_object<int (MyClass::*)(void)const>::value is an integral constant expression that evaluates to true.

    @@ -89,7 +90,7 @@

    - is_object<int &>::value is an integral constant expression + is_object<int &>::value is an integral constant expression that evaluates to false: reference types are not objects

    @@ -100,7 +101,7 @@

    - is_object<int (double)>::value is an integral constant expression + is_object<int (double)>::value is an integral constant expression that evaluates to false: function types are not objects

    @@ -111,7 +112,7 @@

    - is_object<const void>::value + is_object<const void>::value is an integral constant expression that evaluates to false: void is not an object type

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

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

    @@ -135,8 +136,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_pod.html b/doc/html/boost_typetraits/reference/is_pod.html index fd46d8e..848267b 100644 --- a/doc/html/boost_typetraits/reference/is_pod.html +++ b/doc/html/boost_typetraits/reference/is_pod.html @@ -1,13 +1,13 @@ - is_pod +is_pod - + - - - + + + @@ -24,15 +24,16 @@
     template <class T>
    -struct is_pod : public true_type-or-false_type {};
    +struct is_pod : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - POD type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + POD type then inherits from true_type, + otherwise inherits from false_type.

    POD stands for "Plain old data". Arithmetic types, and enumeration @@ -44,11 +45,11 @@ array of PODs.

    - C++ Standard Reference: 3.9p10 and 9p4 (Note + C++ Standard Reference: 3.9p10 and 9p4 (Note that POD's are also aggregates, see 8.5.1).

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template can not be used with function types.

    @@ -59,19 +60,19 @@ the necessary compiler-_intrinsics.

    - Header: #include - <boost/type_traits/is_pod.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_pod.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_pod<int> - inherits from true_type. + is_pod<int> + inherits from true_type.

    @@ -80,7 +81,7 @@

    - is_pod<char*>::type is the type true_type. + is_pod<char*>::type is the type true_type.

    @@ -89,7 +90,7 @@

    - is_pod<int (*)(long)>::value is an integral constant expression + is_pod<int (*)(long)>::value is an integral constant expression that evaluates to true.

    @@ -99,7 +100,7 @@

    - is_pod<MyClass>::value is an integral constant expression + is_pod<MyClass>::value is an integral constant expression that evaluates to false.

    @@ -109,7 +110,7 @@

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

    @@ -122,8 +123,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_pointer.html b/doc/html/boost_typetraits/reference/is_pointer.html index 322009d..9f1fa46 100644 --- a/doc/html/boost_typetraits/reference/is_pointer.html +++ b/doc/html/boost_typetraits/reference/is_pointer.html @@ -1,13 +1,13 @@ - is_pointer +is_pointer - + - - - + + + @@ -24,34 +24,35 @@
     template <class T>
    -struct is_pointer : public true_type-or-false_type {};
    +struct is_pointer : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) + Inherits: If T is a (possibly cv-qualified) pointer type (includes function pointers, but excludes pointers to members) - then inherits from true_type, - otherwise inherits from false_type. + then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.2p2 and 8.3.1. + C++ Standard Reference: 3.9.2p2 and 8.3.1.

    - Header: #include - <boost/type_traits/is_pointer.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_pointer.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_pointer<int*> - inherits from true_type. + is_pointer<int*> + inherits from true_type.

    @@ -60,7 +61,7 @@

    - is_pointer<char* const>::type is the type true_type. + is_pointer<char* const>::type is the type true_type.

    @@ -69,7 +70,7 @@

    - is_pointer<int (*)(long)>::value is an integral constant expression + is_pointer<int (*)(long)>::value is an integral constant expression that evaluates to true.

    @@ -79,7 +80,7 @@

    - is_pointer<int (MyClass::*)(long)>::value is an integral constant expression + is_pointer<int (MyClass::*)(long)>::value is an integral constant expression that evaluates to false.

    @@ -89,7 +90,7 @@

    - is_pointer<int (MyClass::*)>::value is an integral constant expression + is_pointer<int (MyClass::*)>::value is an integral constant expression that evaluates to false.

    @@ -99,7 +100,7 @@

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

    @@ -109,10 +110,10 @@
    -
    [Important] Important

    - is_pointer detects "real" +

    + is_pointer detects "real" pointer types only, and not smart pointers. Users - should not specialise is_pointer + should not specialise is_pointer for smart pointer types, as doing so may cause Boost (and other third party) code to fail to function correctly. Users wanting a trait to detect smart pointers should create their own. However, note that there is no way in @@ -128,8 +129,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_polymorphic.html b/doc/html/boost_typetraits/reference/is_polymorphic.html index 439eb74..5f48303 100644 --- a/doc/html/boost_typetraits/reference/is_polymorphic.html +++ b/doc/html/boost_typetraits/reference/is_polymorphic.html @@ -1,13 +1,13 @@ - is_polymorphic +is_polymorphic - + - - - + + + @@ -24,39 +24,40 @@
     template <class T>
    -struct is_polymorphic : public true_type-or-false_type {};
    +struct is_polymorphic : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - polymorphic type then inherits from true_type, - otherwise inherits from false_type. - Type T must be a complete + Inherits: If T is a (possibly cv-qualified) + polymorphic type then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete type.

    - C++ Standard Reference: 10.3. + C++ Standard Reference: 10.3.

    - Compiler Compatibility: The implementation + Compiler Compatibility: The implementation requires some knowledge of the compilers ABI, it does actually seem to work with the majority of compilers though.

    - Header: #include - <boost/type_traits/is_polymorphic.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_polymorphic.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - Given: class poly{ virtual ~poly(); }; + Given: class poly{ virtual ~poly(); };

    @@ -65,8 +66,8 @@

    - is_polymorphic<poly> - inherits from true_type. + is_polymorphic<poly> + inherits from true_type.

    @@ -75,8 +76,8 @@

    - is_polymorphic<poly const>::type - is the type true_type. + is_polymorphic<poly const>::type + is the type true_type.

    @@ -85,7 +86,7 @@

    - is_polymorphic<poly>::value is an integral constant expression + is_polymorphic<poly>::value is an integral constant expression that evaluates to true.

    @@ -95,7 +96,7 @@

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

    @@ -108,8 +109,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_reference.html b/doc/html/boost_typetraits/reference/is_reference.html index 0c8bca0..c4e4b58 100644 --- a/doc/html/boost_typetraits/reference/is_reference.html +++ b/doc/html/boost_typetraits/reference/is_reference.html @@ -1,13 +1,13 @@ - is_reference +is_reference - + - - - + + + @@ -24,39 +24,40 @@
     template <class T>
    -struct is_reference : public true_type-or-false_type {};
    +struct is_reference : public true_type-or-false_type {};
     

    - Inherits: If T is a reference pointer type - then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a reference pointer type + then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.2 and 8.3.2. + C++ Standard Reference: 3.9.2 and 8.3.2.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template may report the wrong result for function types, and for types that are both const and volatile qualified.

    - Header: #include - <boost/type_traits/is_reference.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_reference.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_reference<int&> - inherits from true_type. + is_reference<int&> + inherits from true_type.

    @@ -65,8 +66,8 @@

    - is_reference<int const&>::type - is the type true_type. + is_reference<int const&>::type + is the type true_type.

    @@ -75,7 +76,7 @@

    - is_reference<int (&)(long)>::value is an integral constant expression + is_reference<int (&)(long)>::value is an integral constant expression that evaluates to true (the argument in this case is a reference to a function).

    @@ -86,7 +87,7 @@

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

    @@ -99,8 +100,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_same.html b/doc/html/boost_typetraits/reference/is_same.html index c1bcceb..efda38a 100644 --- a/doc/html/boost_typetraits/reference/is_same.html +++ b/doc/html/boost_typetraits/reference/is_same.html @@ -1,13 +1,13 @@ - is_same +is_same - + - - - + + + @@ -24,35 +24,36 @@
     template <class T, class U>
    -struct is_same : public true_type-or-false_type {};
    +struct is_same : public true_type-or-false_type {};
     

    - Inherits: If T and U are the same types - then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T and U are the same types + then inherits from true_type, + otherwise inherits from false_type.

    - Header: #include - <boost/type_traits/is_same.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_same.hpp> + or #include <boost/type_traits.hpp>

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template can not be used with abstract, incomplete or function types.

    - Examples: + Examples:

    - is_same<int, int> - inherits from true_type. + is_same<int, int> + inherits from true_type.

    @@ -61,7 +62,7 @@

    - is_same<int, int>::type is the type true_type. + is_same<int, int>::type is the type true_type.

    @@ -70,7 +71,7 @@

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

    @@ -80,7 +81,7 @@

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

    @@ -90,7 +91,7 @@

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

    @@ -100,7 +101,7 @@

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

    @@ -113,8 +114,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_scalar.html b/doc/html/boost_typetraits/reference/is_scalar.html index daa6286..b791cbc 100644 --- a/doc/html/boost_typetraits/reference/is_scalar.html +++ b/doc/html/boost_typetraits/reference/is_scalar.html @@ -1,13 +1,13 @@ - is_scalar +is_scalar - + - - - + + + @@ -24,40 +24,41 @@
     template <class T>
    -struct is_scalar : public true_type-or-false_type {};
    +struct is_scalar : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - scalar type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + scalar type then inherits from true_type, + otherwise inherits from false_type. Scalar types include integral, floating point, enumeration, pointer, and pointer-to-member types.

    - C++ Standard Reference: 3.9p10. + C++ Standard Reference: 3.9p10.

    - Header: #include - <boost/type_traits/is_scalar.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_scalar.hpp> + or #include <boost/type_traits.hpp>

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template can not be used with function types.

    - Examples: + Examples:

    - is_scalar<int*> - inherits from true_type. + is_scalar<int*> + inherits from true_type.

    @@ -66,7 +67,7 @@

    - is_scalar<int>::type is the type true_type. + is_scalar<int>::type is the type true_type.

    @@ -75,7 +76,7 @@

    - is_scalar<double>::value is an integral constant expression + is_scalar<double>::value is an integral constant expression that evaluates to true.

    @@ -85,7 +86,7 @@

    - is_scalar<int (*)(long)>::value is an integral constant expression + is_scalar<int (*)(long)>::value is an integral constant expression that evaluates to true.

    @@ -95,7 +96,7 @@

    - is_scalar<int (MyClass::*)(long)>::value is an integral constant expression + is_scalar<int (MyClass::*)(long)>::value is an integral constant expression that evaluates to true.

    @@ -105,7 +106,7 @@

    - is_scalar<int (MyClass::*)>::value is an integral constant expression + is_scalar<int (MyClass::*)>::value is an integral constant expression that evaluates to true.

    @@ -115,7 +116,7 @@

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

    @@ -128,8 +129,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_signed.html b/doc/html/boost_typetraits/reference/is_signed.html index e367498..ee0a985 100644 --- a/doc/html/boost_typetraits/reference/is_signed.html +++ b/doc/html/boost_typetraits/reference/is_signed.html @@ -1,13 +1,13 @@ - is_signed +is_signed - + - - - + + + @@ -24,34 +24,35 @@
     template <class T>
    -struct is_signed : public true_type-or-false_type {};
    +struct is_signed : public true_type-or-false_type {};
     

    - Inherits: If T is an signed integer type + Inherits: If T is an signed integer type or an enumerated type with an underlying signed integer type, then inherits - from true_type, - otherwise inherits from false_type. + from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.1, 7.2. + C++ Standard Reference: 3.9.1, 7.2.

    - Header: #include - <boost/type_traits/is_signed.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_signed.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_signed<int> - inherits from true_type. + is_signed<int> + inherits from true_type.

    @@ -60,7 +61,7 @@

    - is_signed<int const volatile>::type is the type true_type. + is_signed<int const volatile>::type is the type true_type.

    @@ -69,7 +70,7 @@

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

    @@ -79,7 +80,7 @@

    - is_signed<myclass>::value is an integral constant expression + is_signed<myclass>::value is an integral constant expression that evaluates to false.

    @@ -89,8 +90,8 @@

    - is_signed<char>::value is an integral constant expression - whose value depends upon the signedness of type char. + is_signed<char>::value is an integral constant expression + whose value depends upon the signedness of type char.

    @@ -99,7 +100,7 @@

    - is_signed<long long>::value + is_signed<long long>::value is an integral constant expression that evaluates to true.

    @@ -109,7 +110,7 @@

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

    @@ -122,8 +123,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_stateless.html b/doc/html/boost_typetraits/reference/is_stateless.html index af9f386..a81c185 100644 --- a/doc/html/boost_typetraits/reference/is_stateless.html +++ b/doc/html/boost_typetraits/reference/is_stateless.html @@ -1,13 +1,13 @@ - is_stateless +is_stateless - + - - - + + + @@ -24,24 +24,25 @@
     template <class T>
    -struct is_stateless : public true_type-or-false_type {};
    +struct is_stateless : public true_type-or-false_type {};
     

    - Inherits: Ff T is a stateless type then - inherits from true_type, - otherwise from false_type. + Inherits: Ff T is a stateless type then + inherits from true_type, + otherwise from false_type.

    Type T must be a complete type.

    A stateless type is a type that has no storage and whose constructors and - destructors are trivial. That means that is_stateless - only inherits from true_type - if the following expression is true: + destructors are trivial. That means that is_stateless + only inherits from true_type + if the following expression is true:

     ::boost::has_trivial_constructor<T>::value
    @@ -51,15 +52,15 @@
     && ::boost::is_empty<T>::value
     

    - C++ Standard Reference: 3.9p10. + C++ Standard Reference: 3.9p10.

    - Header: #include - <boost/type_traits/is_stateless.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_stateless.hpp> + or #include <boost/type_traits.hpp>

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial-specialization of class templates, then this template can not be used with function types.

    @@ -67,7 +68,7 @@ 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 + the necessary compiler intrinsics to make this template work automatically.

    @@ -78,8 +79,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_union.html b/doc/html/boost_typetraits/reference/is_union.html index 16a82bc..e74b394 100644 --- a/doc/html/boost_typetraits/reference/is_union.html +++ b/doc/html/boost_typetraits/reference/is_union.html @@ -1,13 +1,13 @@ - is_union +is_union - + - - - + + + @@ -24,46 +24,47 @@
     template <class T>
    -struct is_union : public true_type-or-false_type {};
    +struct is_union : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - union type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + union type then inherits from true_type, + otherwise inherits from false_type. Currently requires some kind of compiler support, otherwise unions are identified as classes.

    - C++ Standard Reference: 3.9.2 and 9.5. + C++ Standard Reference: 3.9.2 and 9.5.

    - Compiler Compatibility: Without (some as + Compiler Compatibility: 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, + 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 + the necessary compiler intrinsics to make this trait "just work" without user intervention.

    - Header: #include - <boost/type_traits/is_union.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_union.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_union<void> - inherits from true_type. + is_union<void> + inherits from true_type.

    @@ -72,8 +73,8 @@

    - is_union<const void>::type - is the type true_type. + is_union<const void>::type + is the type true_type.

    @@ -82,7 +83,7 @@

    - is_union<void>::value is an integral constant expression + is_union<void>::value is an integral constant expression that evaluates to true.

    @@ -92,7 +93,7 @@

    - is_union<void*>::value is an integral constant expression + is_union<void*>::value is an integral constant expression that evaluates to false.

    @@ -102,7 +103,7 @@

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

    @@ -115,8 +116,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_unsigned.html b/doc/html/boost_typetraits/reference/is_unsigned.html index fa0c65a..a8f3121 100644 --- a/doc/html/boost_typetraits/reference/is_unsigned.html +++ b/doc/html/boost_typetraits/reference/is_unsigned.html @@ -1,13 +1,13 @@ - is_unsigned +is_unsigned - + - - - + + + @@ -24,33 +24,34 @@
     template <class T>
    -struct is_unsigned : public true_type-or-false_type {};
    +struct is_unsigned : public true_type-or-false_type {};
     

    - Inherits: If T is an unsigned integer type + Inherits: If T is an unsigned integer type or an enumerated type with an underlying unsigned integer type, then inherits - from true_type, - otherwise inherits from false_type. + from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.1, 7.2. + C++ Standard Reference: 3.9.1, 7.2.

    - Header: #include - <boost/type_traits/is_unsigned.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_unsigned.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_unsigned<unsigned int> inherits from true_type. + is_unsigned<unsigned int> inherits from true_type.

    @@ -59,9 +60,9 @@

    - is_unsigned<unsigned int - const volatile>::type - is the type true_type. + is_unsigned<unsigned int + const volatile>::type + is the type true_type.

    @@ -70,7 +71,7 @@

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

    @@ -80,7 +81,7 @@

    - is_unsigned<myclass>::value is an integral constant expression + is_unsigned<myclass>::value is an integral constant expression that evaluates to false.

    @@ -90,8 +91,8 @@

    - is_unsigned<char>::value is an integral constant expression - whose value depends upon the signedness of type char. + is_unsigned<char>::value is an integral constant expression + whose value depends upon the signedness of type char.

    @@ -100,8 +101,8 @@

    - is_unsigned<unsigned long - long>::value is an integral constant expression + is_unsigned<unsigned long + long>::value is an integral constant expression that evaluates to true.

    @@ -111,7 +112,7 @@

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

    @@ -124,8 +125,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_void.html b/doc/html/boost_typetraits/reference/is_void.html index 89063d7..4e06720 100644 --- a/doc/html/boost_typetraits/reference/is_void.html +++ b/doc/html/boost_typetraits/reference/is_void.html @@ -1,13 +1,13 @@ - is_void +is_void - + - - - + + + @@ -24,33 +24,34 @@
     template <class T>
    -struct is_void : public true_type-or-false_type {};
    +struct is_void : public true_type-or-false_type {};
     

    - Inherits: If T is a (possibly cv-qualified) - void type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (possibly cv-qualified) + void type then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.1p9. + C++ Standard Reference: 3.9.1p9.

    - Header: #include - <boost/type_traits/is_void.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_void.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_void<void> - inherits from true_type. + is_void<void> + inherits from true_type.

    @@ -59,8 +60,8 @@

    - is_void<const void>::type - is the type true_type. + is_void<const void>::type + is the type true_type.

    @@ -69,7 +70,7 @@

    - is_void<void>::value is an integral constant expression + is_void<void>::value is an integral constant expression that evaluates to true.

    @@ -79,7 +80,7 @@

    - is_void<void*>::value is an integral constant expression + is_void<void*>::value is an integral constant expression that evaluates to false.

    @@ -89,7 +90,7 @@

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

    @@ -102,8 +103,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/is_volatile.html b/doc/html/boost_typetraits/reference/is_volatile.html index 3cb0ed2..450a824 100644 --- a/doc/html/boost_typetraits/reference/is_volatile.html +++ b/doc/html/boost_typetraits/reference/is_volatile.html @@ -1,13 +1,13 @@ - is_volatile +is_volatile - + - - - + + + @@ -24,32 +24,33 @@
     template <class T>
    -struct is_volatile : public true_type-or-false_type {};
    +struct is_volatile : public true_type-or-false_type {};
     

    - Inherits: If T is a (top level) volatile-qualified - type then inherits from true_type, - otherwise inherits from false_type. + Inherits: If T is a (top level) volatile-qualified + type then inherits from true_type, + otherwise inherits from false_type.

    - C++ Standard Reference: 3.9.3. + C++ Standard Reference: 3.9.3.

    - Header: #include - <boost/type_traits/is_volatile.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/is_volatile.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - is_volatile<volatile int> inherits from true_type. + is_volatile<volatile int> inherits from true_type.

    @@ -58,8 +59,8 @@

    - is_volatile<const volatile - int>::type is the type true_type. + is_volatile<const volatile + int>::type is the type true_type.

    @@ -68,7 +69,7 @@

    - is_volatile<int* volatile>::value is an integral constant expression + is_volatile<int* volatile>::value is an integral constant expression that evaluates to true.

    @@ -78,7 +79,7 @@

    - is_volatile<int volatile*>::value + is_volatile<int volatile*>::value is an integral constant expression that evaluates to false: the volatile qualifier is not at the top level in this case.

    @@ -89,7 +90,7 @@

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

    @@ -102,8 +103,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/make_signed.html b/doc/html/boost_typetraits/reference/make_signed.html index de6a3f7..d7ee39c 100644 --- a/doc/html/boost_typetraits/reference/make_signed.html +++ b/doc/html/boost_typetraits/reference/make_signed.html @@ -1,13 +1,13 @@ - make_signed +make_signed - + - - - + + + @@ -24,16 +24,17 @@
     template <class T>
     struct make_signed
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: If T is a signed integer type then + type: If T is a signed integer type then the same type as T, if T is an unsigned integer type then the corresponding signed type. Otherwise if T is an enumerated or character type (char or wchar_t) then a signed integer type with the same width as T. @@ -42,20 +43,20 @@ If T has any cv-qualifiers then these are also present on the result type.

    - Requires: T must be an integer or enumerated + Requires: T must be an integer or enumerated type, and must not be the type bool.

    - C++ Standard Reference: 3.9.1. + C++ Standard Reference: 3.9.1.

    - Header: #include - <boost/type_traits/make_signed.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/make_signed.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.15. Examples

    -
    +

    Table 1.15. Examples

    +
    @@ -76,46 +77,46 @@ -

    - make_signed<int>::type + make_signed<int>::type

    - int + int

    - make_signed<unsigned int - const>::type + make_signed<unsigned int + const>::type

    - int const + int const

    - make_signed<const unsigned - long long>::type + make_signed<const unsigned + long long>::type

    - const long - long + const long + long

    - make_signed<my_enum>::type + make_signed<my_enum>::type

    @@ -127,7 +128,7 @@

    - make_signed<wchar_t>::type + make_signed<wchar_t>::type

    @@ -137,8 +138,9 @@
    + +
    @@ -147,8 +149,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/make_unsigned.html b/doc/html/boost_typetraits/reference/make_unsigned.html index 1b86312..18eb27f 100644 --- a/doc/html/boost_typetraits/reference/make_unsigned.html +++ b/doc/html/boost_typetraits/reference/make_unsigned.html @@ -1,13 +1,13 @@ - make_unsigned +make_unsigned - + - - - + + + @@ -24,16 +24,17 @@
     template <class T>
     struct make_unsigned
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: If T is a unsigned integer type then + type: If T is a unsigned integer type then the same type as T, if T is an signed integer type then the corresponding unsigned type. Otherwise if T is an enumerated or character type (char or wchar_t) then an unsigned integer type with the same width as T. @@ -42,20 +43,20 @@ If T has any cv-qualifiers then these are also present on the result type.

    - Requires: T must be an integer or enumerated + Requires: T must be an integer or enumerated type, and must not be the type bool.

    - C++ Standard Reference: 3.9.1. + C++ Standard Reference: 3.9.1.

    - Header: #include - <boost/type_traits/make_unsigned.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/make_unsigned.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.16. Examples

    -
    +

    Table 1.16. Examples

    +
    @@ -76,47 +77,47 @@ -

    - make_signed<int>::type + make_signed<int>::type

    - unsigned int + unsigned int

    - make_signed<unsigned int - const>::type + make_signed<unsigned int + const>::type

    - unsigned int - const + unsigned int + const

    - make_signed<const unsigned - long long>::type + make_signed<const unsigned + long long>::type

    - const unsigned - long long + const unsigned + long long

    - make_signed<my_enum>::type + make_signed<my_enum>::type

    @@ -128,7 +129,7 @@

    - make_signed<wchar_t>::type + make_signed<wchar_t>::type

    @@ -138,8 +139,9 @@
    + +
    @@ -148,8 +150,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/promote.html b/doc/html/boost_typetraits/reference/promote.html index 8a833eb..7e8a7ed 100644 --- a/doc/html/boost_typetraits/reference/promote.html +++ b/doc/html/boost_typetraits/reference/promote.html @@ -1,13 +1,13 @@ - promote +promote - + - - - + + + @@ -24,36 +24,36 @@
     template <class T>
     struct promote
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: If integral or floating point promotion - can be applied to an rvalue of type T, - then applies integral and floating point promotions to T - and keeps cv-qualifiers of T, - otherwise leaves T unchanged. - See also integral_promotion - and floating_point_promotion. + type: If integral or floating point promotion + can be applied to an rvalue of type T, + then applies integral and floating point promotions to T + and keeps cv-qualifiers of T, + otherwise leaves T unchanged. + See also integral_promotion + and floating_point_promotion.

    - C++ Standard Reference: 4.5 except 4.5/3 + C++ Standard Reference: 4.5 except 4.5/3 (integral bit-field) and 4.6.

    - Header: #include - <boost/type_traits/promote.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/promote.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.17. Examples

    -
    +

    Table 1.17. Examples

    +
    @@ -74,42 +74,43 @@ -

    - promote<short volatile>::type + promote<short volatile>::type

    - int volatile + int volatile

    - promote<float const>::type + promote<float const>::type

    - double const + double const

    - promote<short&>::type + promote<short&>::type

    - short& + short&

    + +
    @@ -118,8 +119,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/rank.html b/doc/html/boost_typetraits/reference/rank.html index 4510d27..177322f 100644 --- a/doc/html/boost_typetraits/reference/rank.html +++ b/doc/html/boost_typetraits/reference/rank.html @@ -1,13 +1,13 @@ - rank +rank - + - - - + + + @@ -24,35 +24,36 @@
     template <class T>
    -struct rank : public integral_constant<std::size_t, RANK(T)> {};
    +struct rank : public integral_constant<std::size_t, RANK(T)> {};
     

    - Inherits: Class template rank inherits from - integral_constant<std::size_t, RANK(T)>, - where RANK(T) is the - number of array dimensions in type T. + Inherits: Class template rank inherits from + integral_constant<std::size_t, RANK(T)>, + where RANK(T) is the + number of array dimensions in type T.

    - If T is not an array type, - then RANK(T) is zero. + If T is not an array type, + then RANK(T) is zero.

    - Header: #include - <boost/type_traits/rank.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/rank.hpp> + or #include <boost/type_traits.hpp>

    - Examples: + Examples:

    - rank<int[]> - inherits from integral_constant<std::size_t, 1>. + rank<int[]> + inherits from integral_constant<std::size_t, 1>.

    @@ -61,7 +62,7 @@

    - rank<double[2][3][4]>::type is the type integral_constant<std::size_t, 3>. + rank<double[2][3][4]>::type is the type integral_constant<std::size_t, 3>.

    @@ -70,7 +71,7 @@

    - rank<int[1]>::value + rank<int[1]>::value is an integral constant expression that evaluates to 1.

    @@ -80,7 +81,7 @@

    - rank<int[][2]>::value is an integral constant expression + rank<int[][2]>::value is an integral constant expression that evaluates to 2.

    @@ -90,7 +91,7 @@

    - rank<int*>::value is an integral constant expression + rank<int*>::value is an integral constant expression that evaluates to 0.

    @@ -100,7 +101,7 @@

    - rank<T>::value_type is the type std::size_t. + rank<T>::value_type is the type std::size_t.

    @@ -113,8 +114,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/remove_all_extents.html b/doc/html/boost_typetraits/reference/remove_all_extents.html index 89104df..0c578e3 100644 --- a/doc/html/boost_typetraits/reference/remove_all_extents.html +++ b/doc/html/boost_typetraits/reference/remove_all_extents.html @@ -1,13 +1,13 @@ - remove_all_extents +remove_all_extents - + - - - + + + @@ -24,38 +24,39 @@
     template <class T>
     struct remove_all_extents
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: If T - is an array type, then removes all of the array bounds on T, - otherwise leaves T unchanged. + type: If T + is an array type, then removes all of the array bounds on T, + otherwise leaves T unchanged.

    - C++ Standard Reference: 8.3.4. + C++ Standard Reference: 8.3.4.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

    - Header: #include - <boost/type_traits/remove_all_extents.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/remove_all_extents.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.18. Examples

    -
    +

    Table 1.18. Examples

    +
    @@ -76,66 +77,67 @@ -

    - remove_all_extents<int>::type + remove_all_extents<int>::type

    - int + int

    - remove_all_extents<int const[2]>::type + remove_all_extents<int const[2]>::type

    - int const + int const

    - remove_all_extents<int[][2]>::type + remove_all_extents<int[][2]>::type

    - int + int

    - remove_all_extents<int[2][3][4]>::type + remove_all_extents<int[2][3][4]>::type

    - int + int

    - remove_all_extents<int const*>::type + remove_all_extents<int const*>::type

    - int const* + int const*

    + +
    @@ -144,8 +146,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/remove_const.html b/doc/html/boost_typetraits/reference/remove_const.html index bf4643a..d9701f5 100644 --- a/doc/html/boost_typetraits/reference/remove_const.html +++ b/doc/html/boost_typetraits/reference/remove_const.html @@ -1,13 +1,13 @@ - remove_const +remove_const - + - - - + + + @@ -24,37 +24,38 @@
     template <class T>
     struct remove_const
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: The same type as T, + type: The same type as T, but with any top level const-qualifier removed.

    - C++ Standard Reference: 3.9.3. + C++ Standard Reference: 3.9.3.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

    - Header: #include - <boost/type_traits/remove_const.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/remove_const.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.19. Examples

    -
    +

    Table 1.19. Examples

    +
    @@ -75,67 +76,68 @@ -

    - remove_const<int>::type + remove_const<int>::type

    - int + int

    - remove_const<int const>::type + remove_const<int const>::type

    - int + int

    - remove_const<int const - volatile>::type + remove_const<int const + volatile>::type

    - int volatile + int volatile

    - remove_const<int const&>::type + remove_const<int const&>::type

    - int const& + int const&

    - remove_const<int const*>::type + remove_const<int const*>::type

    - int const* + int const*

    + +
    @@ -144,8 +146,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/remove_cv.html b/doc/html/boost_typetraits/reference/remove_cv.html index 845be09..5ddec45 100644 --- a/doc/html/boost_typetraits/reference/remove_cv.html +++ b/doc/html/boost_typetraits/reference/remove_cv.html @@ -1,13 +1,13 @@ - remove_cv +remove_cv - + - - - + + + @@ -24,37 +24,38 @@
     template <class T>
     struct remove_cv
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: The same type as T, + type: The same type as T, but with any top level cv-qualifiers removed.

    - C++ Standard Reference: 3.9.3. + C++ Standard Reference: 3.9.3.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

    - Header: #include - <boost/type_traits/remove_cv.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/remove_cv.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.20. Examples

    -
    +

    Table 1.20. Examples

    +
    @@ -75,67 +76,68 @@ -

    - remove_cv<int>::type + remove_cv<int>::type

    - int + int

    - remove_cv<int const>::type + remove_cv<int const>::type

    - int + int

    - remove_cv<int const - volatile>::type + remove_cv<int const + volatile>::type

    - int + int

    - remove_cv<int const&>::type + remove_cv<int const&>::type

    - int const& + int const&

    - remove_cv<int const*>::type + remove_cv<int const*>::type

    - int const* + int const*

    + +
    @@ -144,8 +146,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/remove_extent.html b/doc/html/boost_typetraits/reference/remove_extent.html index f899db9..1d79cf4 100644 --- a/doc/html/boost_typetraits/reference/remove_extent.html +++ b/doc/html/boost_typetraits/reference/remove_extent.html @@ -1,13 +1,13 @@ - remove_extent +remove_extent - + - - - + + + @@ -24,38 +24,39 @@
     template <class T>
     struct remove_extent
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: If T + type: If T is an array type, then removes the topmost array bound, otherwise leaves - T unchanged. + T unchanged.

    - C++ Standard Reference: 8.3.4. + C++ Standard Reference: 8.3.4.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

    - Header: #include - <boost/type_traits/remove_extent.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/remove_extent.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.21. Examples

    -
    +

    Table 1.21. Examples

    +
    @@ -76,66 +77,67 @@ -

    - remove_extent<int>::type + remove_extent<int>::type

    - int + int

    - remove_extent<int const[2]>::type + remove_extent<int const[2]>::type

    - int const + int const

    - remove_extent<int[2][4]>::type + remove_extent<int[2][4]>::type

    - int[4] + int[4]

    - remove_extent<int[][2]>::type + remove_extent<int[][2]>::type

    - int[2] + int[2]

    - remove_extent<int const*>::type + remove_extent<int const*>::type

    - int const* + int const*

    + +
    @@ -144,8 +146,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/remove_pointer.html b/doc/html/boost_typetraits/reference/remove_pointer.html index dd8e299..f651a79 100644 --- a/doc/html/boost_typetraits/reference/remove_pointer.html +++ b/doc/html/boost_typetraits/reference/remove_pointer.html @@ -1,13 +1,13 @@ - remove_pointer +remove_pointer - + - - - + + + @@ -24,37 +24,38 @@
     template <class T>
     struct remove_pointer
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: The same type as T, + type: The same type as T, but with any pointer modifier removed.

    - C++ Standard Reference: 8.3.1. + C++ Standard Reference: 8.3.1.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

    - Header: #include - <boost/type_traits/remove_pointer.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/remove_pointer.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.22. Examples

    -
    +

    Table 1.22. Examples

    +
    @@ -75,66 +76,67 @@ -

    - remove_pointer<int>::type + remove_pointer<int>::type

    - int + int

    - remove_pointer<int const*>::type + remove_pointer<int const*>::type

    - int const + int const

    - remove_pointer<int const**>::type + remove_pointer<int const**>::type

    - int const* + int const*

    - remove_pointer<int&>::type + remove_pointer<int&>::type

    - int& + int&

    - remove_pointer<int*&>::type + remove_pointer<int*&>::type

    - int*& + int*&

    + +
    @@ -143,8 +145,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/remove_reference.html b/doc/html/boost_typetraits/reference/remove_reference.html index 50f3a0e..4aa377e 100644 --- a/doc/html/boost_typetraits/reference/remove_reference.html +++ b/doc/html/boost_typetraits/reference/remove_reference.html @@ -1,13 +1,13 @@ - remove_reference +remove_reference - + - - - + + + @@ -24,37 +24,38 @@
     template <class T>
     struct remove_reference
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: The same type as T, + type: The same type as T, but with any reference modifier removed.

    - C++ Standard Reference: 8.3.2. + C++ Standard Reference: 8.3.2.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

    - Header: #include - <boost/type_traits/remove_reference.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/remove_reference.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.23. Examples

    -
    +

    Table 1.23. Examples

    +
    @@ -75,54 +76,55 @@ -

    - remove_reference<int>::type + remove_reference<int>::type

    - int + int

    - remove_reference<int const&>::type + remove_reference<int const&>::type

    - int const + int const

    - remove_reference<int*>::type + remove_reference<int*>::type

    - int* + int*

    - remove_reference<int*&>::type + remove_reference<int*&>::type

    - int* + int*

    + +
    @@ -131,8 +133,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/remove_volatile.html b/doc/html/boost_typetraits/reference/remove_volatile.html index 3c2f3c0..333f9d3 100644 --- a/doc/html/boost_typetraits/reference/remove_volatile.html +++ b/doc/html/boost_typetraits/reference/remove_volatile.html @@ -1,13 +1,13 @@ - remove_volatile +remove_volatile - + - - - + + + @@ -24,37 +24,38 @@
     template <class T>
     struct remove_volatile
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: The same type as T, + type: The same type as T, but with any top level volatile-qualifier removed.

    - C++ Standard Reference: 3.9.3. + C++ Standard Reference: 3.9.3.

    - Compiler Compatibility: If the compiler + Compiler Compatibility: If the compiler does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T + will compile, but the member type + will always be the same as type T except where compiler workarounds have been applied.

    - Header: #include - <boost/type_traits/remove_volatile.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/remove_volatile.hpp> + or #include <boost/type_traits.hpp>

    -

    Table 1.24. Examples

    -
    +

    Table 1.24. Examples

    +
    @@ -75,67 +76,68 @@ -

    - remove_volatile<int>::type + remove_volatile<int>::type

    - int + int

    - remove_volatile<int volatile>::type + remove_volatile<int volatile>::type

    - int + int

    - remove_volatile<int const - volatile>::type + remove_volatile<int const + volatile>::type

    - int const + int const

    - remove_volatile<int volatile&>::type + remove_volatile<int volatile&>::type

    - int const& + int const&

    - remove_volatile<int volatile*>::type + remove_volatile<int volatile*>::type

    - int const* + int const*

    + +
    @@ -144,8 +146,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/reference/type_with_alignment.html b/doc/html/boost_typetraits/reference/type_with_alignment.html index f31e85e..c0cabeb 100644 --- a/doc/html/boost_typetraits/reference/type_with_alignment.html +++ b/doc/html/boost_typetraits/reference/type_with_alignment.html @@ -1,13 +1,13 @@ - type_with_alignment +type_with_alignment - + - - - + + + @@ -24,22 +24,23 @@
     template <std::size_t Align>
     struct type_with_alignment
     {
    -   typedef see-below type;
    +   typedef see-below type;
     };
     

    - type: a built-in or POD type with an alignment - that is a multiple of Align. + type: a built-in or POD type with an alignment + that is a multiple of Align.

    - Header: #include - <boost/type_traits/type_with_alignment.hpp> - or #include <boost/type_traits.hpp> + Header: #include + <boost/type_traits/type_with_alignment.hpp> + or #include <boost/type_traits.hpp>

    @@ -49,8 +50,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/boost_typetraits/user_defined.html b/doc/html/boost_typetraits/user_defined.html index eff3602..aaa5add 100644 --- a/doc/html/boost_typetraits/user_defined.html +++ b/doc/html/boost_typetraits/user_defined.html @@ -1,14 +1,13 @@ - User Defined Specializations +User Defined Specializations - + - - + + @@ -25,13 +24,14 @@

    Occationally the end user may need to provide their own specialization for one of the type traits - typically where intrinsic compiler support is required to implement a specific trait fully. These specializations should derive from - boost::true_type - or boost::false_type + boost::true_type + or boost::false_type as appropriate:

    @@ -49,16 +49,16 @@
     namespace boost
     {
        template<>
    -   struct is_pod<my_pod> : public true_type{};
    +   struct is_pod<my_pod> : public true_type{};
           
        template<>
    -   struct is_pod<my_union> : public true_type{};
    +   struct is_pod<my_union> : public true_type{};
        
        template<>
    -   struct is_union<my_union> : public true_type{};
    +   struct is_union<my_union> : public true_type{};
        
        template<>
    -   struct is_class<my_union> : public false_type{};
    +   struct is_class<my_union> : public false_type{};
     }
     
    @@ -69,8 +69,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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


    diff --git a/doc/html/index.html b/doc/html/index.html index 590c333..09c933a 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -3,9 +3,9 @@ Chapter 1. Boost.TypeTraits - + - + @@ -30,10 +30,9 @@ 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 <ulink url="http://www.boost.orgLICENSE_1_0.txt"> - http:/www.boost.org/LICENSE_1_0.txt </ulink>) + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

    @@ -158,7 +157,7 @@
    - +

    Last revised: September 10, 2007 at 19:24:53 +0800

    Last revised: November 07, 2007 at 18:38:23 +0000


    diff --git a/doc/type_traits.qbk b/doc/type_traits.qbk index 8de7a35..e53adaf 100644 --- a/doc/type_traits.qbk +++ b/doc/type_traits.qbk @@ -13,11 +13,9 @@ Robert Ramey and Jeremy Siek] [purpose Meta-programming support library] [license - 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 - ) + 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]) ] [authors [authors, various]] [category template] @@ -246,3 +244,4 @@ See __has_trivial_constructor. + From f25014668821de0c043779116438ab79d6171ac7 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 10 Nov 2007 17:40:19 +0000 Subject: [PATCH 53/56] Fix issue #1424. [SVN r40997] --- test/promote_enum_test.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/promote_enum_test.cpp b/test/promote_enum_test.cpp index 60b087e..58a103c 100755 --- a/test/promote_enum_test.cpp +++ b/test/promote_enum_test.cpp @@ -29,6 +29,7 @@ #include #include "promote_util.hpp" +#include enum IntEnum1 { IntEnum1_min = -5 , IntEnum1_max = 5 }; enum IntEnum2 { IntEnum2_min = SHRT_MIN, IntEnum2_max = SHRT_MAX }; @@ -90,8 +91,8 @@ void test_promote_to_int_or_uint() #endif } -#if (defined(BOOST_MSVC) && BOOST_MSVC <= 1400 ) || \ - (defined(BOOST_INTEL_WIN) && BOOST_INTEL_WIN <= 1000) +#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500) ) || \ + BOOST_WORKAROUND(BOOST_INTEL_WIN, BOOST_TESTED_AT(1000)) // Don't test UIntEnum on VC++ 8.0 and Intel for Windows 9.0, // they are broken. More info is on top of this file. #else From 80e18d29371c71d03529d185fa5b467a77eddca6 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 20 Nov 2007 16:57:32 +0000 Subject: [PATCH 54/56] Added warning suppression for VC-9. [SVN r41259] --- include/boost/type_traits/is_abstract.hpp | 7 +++++++ include/boost/type_traits/is_base_and_derived.hpp | 7 +++++++ include/boost/type_traits/is_convertible.hpp | 2 +- include/boost/type_traits/is_function.hpp | 7 +++++++ include/boost/type_traits/is_member_function_pointer.hpp | 7 +++++++ 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/include/boost/type_traits/is_abstract.hpp b/include/boost/type_traits/is_abstract.hpp index b6d640c..e8e2db4 100755 --- a/include/boost/type_traits/is_abstract.hpp +++ b/include/boost/type_traits/is_abstract.hpp @@ -85,7 +85,14 @@ struct is_abstract_imp2 #ifdef __GNUC__ BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(is_abstract_imp2::template check_sig(0))); #else +#if BOOST_WORKAROUND(BOOST_MSVC, > 1400) +#pragma warning(push) +#pragma warning(disable:6334) +#endif BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(check_sig(0))); +#if BOOST_WORKAROUND(BOOST_MSVC, > 1400) +#pragma warning(pop) +#endif #endif BOOST_STATIC_CONSTANT(bool, value = diff --git a/include/boost/type_traits/is_base_and_derived.hpp b/include/boost/type_traits/is_base_and_derived.hpp index 2cff64e..28f0c80 100644 --- a/include/boost/type_traits/is_base_and_derived.hpp +++ b/include/boost/type_traits/is_base_and_derived.hpp @@ -129,6 +129,10 @@ struct bd_helper template struct is_base_and_derived_impl2 { +#if BOOST_WORKAROUND(BOOST_MSVC, > 1400) +#pragma warning(push) +#pragma warning(disable:6334) +#endif // // May silently do the wrong thing with incomplete types // unless we trap them here: @@ -148,6 +152,9 @@ struct is_base_and_derived_impl2 BOOST_STATIC_CONSTANT(bool, value = sizeof(bd_helper::check_sig(Host(), 0)) == sizeof(type_traits::yes_type)); +#if BOOST_WORKAROUND(BOOST_MSVC, > 1400) +#pragma warning(pop) +#endif }; #else diff --git a/include/boost/type_traits/is_convertible.hpp b/include/boost/type_traits/is_convertible.hpp index 5ad740e..3a14755 100644 --- a/include/boost/type_traits/is_convertible.hpp +++ b/include/boost/type_traits/is_convertible.hpp @@ -249,7 +249,7 @@ struct is_convertible_basic_impl static From _m_from; #ifdef BOOST_MSVC #pragma warning(push) -#pragma warning(disable:4244) +#pragma warning(disable:4244 6334) #endif BOOST_STATIC_CONSTANT(bool, value = sizeof( _m_check(_m_from) ) == sizeof(::boost::type_traits::yes_type) diff --git a/include/boost/type_traits/is_function.hpp b/include/boost/type_traits/is_function.hpp index 8fd2c9e..89323f0 100644 --- a/include/boost/type_traits/is_function.hpp +++ b/include/boost/type_traits/is_function.hpp @@ -62,11 +62,18 @@ struct is_function_impl template struct is_function_impl { +#if BOOST_WORKAROUND(BOOST_MSVC, > 1400) +#pragma warning(push) +#pragma warning(disable:6334) +#endif static T* t; BOOST_STATIC_CONSTANT( bool, value = sizeof(::boost::type_traits::is_function_ptr_tester(t)) == sizeof(::boost::type_traits::yes_type) ); +#if BOOST_WORKAROUND(BOOST_MSVC, > 1400) +#pragma warning(pop) +#endif }; #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) diff --git a/include/boost/type_traits/is_member_function_pointer.hpp b/include/boost/type_traits/is_member_function_pointer.hpp index 5b32385..01d76e5 100644 --- a/include/boost/type_traits/is_member_function_pointer.hpp +++ b/include/boost/type_traits/is_member_function_pointer.hpp @@ -62,6 +62,10 @@ struct is_mem_fun_pointer_select { template struct result_ { +#if BOOST_WORKAROUND(BOOST_MSVC, > 1400) +#pragma warning(push) +#pragma warning(disable:6334) +#endif static T* make_t; typedef result_ self_type; @@ -69,6 +73,9 @@ struct is_mem_fun_pointer_select bool, value = ( 1 == sizeof(::boost::type_traits::is_mem_fun_pointer_tester(self_type::make_t)) )); +#if BOOST_WORKAROUND(BOOST_MSVC, > 1400) +#pragma warning(pop) +#endif }; }; From 8cfb381025088d0e56d3c928d7ebfd2f8834d9c3 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 21 Nov 2007 12:09:28 +0000 Subject: [PATCH 55/56] Change warning suppression, to suppress warnings for VC8 as well. [SVN r41277] --- include/boost/type_traits/is_abstract.hpp | 4 ++-- include/boost/type_traits/is_base_and_derived.hpp | 4 ++-- include/boost/type_traits/is_function.hpp | 4 ++-- include/boost/type_traits/is_member_function_pointer.hpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/boost/type_traits/is_abstract.hpp b/include/boost/type_traits/is_abstract.hpp index e8e2db4..c565f08 100755 --- a/include/boost/type_traits/is_abstract.hpp +++ b/include/boost/type_traits/is_abstract.hpp @@ -85,12 +85,12 @@ struct is_abstract_imp2 #ifdef __GNUC__ BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(is_abstract_imp2::template check_sig(0))); #else -#if BOOST_WORKAROUND(BOOST_MSVC, > 1400) +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) #pragma warning(push) #pragma warning(disable:6334) #endif BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(check_sig(0))); -#if BOOST_WORKAROUND(BOOST_MSVC, > 1400) +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) #pragma warning(pop) #endif #endif diff --git a/include/boost/type_traits/is_base_and_derived.hpp b/include/boost/type_traits/is_base_and_derived.hpp index 28f0c80..6f3add2 100644 --- a/include/boost/type_traits/is_base_and_derived.hpp +++ b/include/boost/type_traits/is_base_and_derived.hpp @@ -129,7 +129,7 @@ struct bd_helper template struct is_base_and_derived_impl2 { -#if BOOST_WORKAROUND(BOOST_MSVC, > 1400) +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) #pragma warning(push) #pragma warning(disable:6334) #endif @@ -152,7 +152,7 @@ struct is_base_and_derived_impl2 BOOST_STATIC_CONSTANT(bool, value = sizeof(bd_helper::check_sig(Host(), 0)) == sizeof(type_traits::yes_type)); -#if BOOST_WORKAROUND(BOOST_MSVC, > 1400) +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) #pragma warning(pop) #endif }; diff --git a/include/boost/type_traits/is_function.hpp b/include/boost/type_traits/is_function.hpp index 89323f0..93e4846 100644 --- a/include/boost/type_traits/is_function.hpp +++ b/include/boost/type_traits/is_function.hpp @@ -62,7 +62,7 @@ struct is_function_impl template struct is_function_impl { -#if BOOST_WORKAROUND(BOOST_MSVC, > 1400) +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) #pragma warning(push) #pragma warning(disable:6334) #endif @@ -71,7 +71,7 @@ struct is_function_impl bool, value = sizeof(::boost::type_traits::is_function_ptr_tester(t)) == sizeof(::boost::type_traits::yes_type) ); -#if BOOST_WORKAROUND(BOOST_MSVC, > 1400) +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) #pragma warning(pop) #endif }; diff --git a/include/boost/type_traits/is_member_function_pointer.hpp b/include/boost/type_traits/is_member_function_pointer.hpp index 01d76e5..deedeea 100644 --- a/include/boost/type_traits/is_member_function_pointer.hpp +++ b/include/boost/type_traits/is_member_function_pointer.hpp @@ -62,7 +62,7 @@ struct is_mem_fun_pointer_select { template struct result_ { -#if BOOST_WORKAROUND(BOOST_MSVC, > 1400) +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) #pragma warning(push) #pragma warning(disable:6334) #endif @@ -73,7 +73,7 @@ struct is_mem_fun_pointer_select bool, value = ( 1 == sizeof(::boost::type_traits::is_mem_fun_pointer_tester(self_type::make_t)) )); -#if BOOST_WORKAROUND(BOOST_MSVC, > 1400) +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) #pragma warning(pop) #endif }; From 5e7f4a9c2bf79be4355b660b8b8a923d1305c2e2 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 21 Nov 2007 14:03:16 +0000 Subject: [PATCH 56/56] Apply warning fix for VC8 and later only: earlier versions warn about the warning suppression :-( [SVN r41278] --- include/boost/type_traits/is_convertible.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/boost/type_traits/is_convertible.hpp b/include/boost/type_traits/is_convertible.hpp index 3a14755..10309ca 100644 --- a/include/boost/type_traits/is_convertible.hpp +++ b/include/boost/type_traits/is_convertible.hpp @@ -249,7 +249,10 @@ struct is_convertible_basic_impl static From _m_from; #ifdef BOOST_MSVC #pragma warning(push) -#pragma warning(disable:4244 6334) +#pragma warning(disable:4244) +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(disable:6334) +#endif #endif BOOST_STATIC_CONSTANT(bool, value = sizeof( _m_check(_m_from) ) == sizeof(::boost::type_traits::yes_type)