diff --git a/changes pending.txt b/changes pending.txt new file mode 100644 index 0000000..0948d09 --- /dev/null +++ b/changes pending.txt @@ -0,0 +1,97 @@ +* = PR requests not yet applied to 'develop' branch + +ANY +~~~ + +Missing mpl/if.hpp https://github.com/boostorg/any/pull/4 DM + +DETAIL +------ + +Remove unnecessary include for deprecated ice_xxx.hpp header: https://github.com/boostorg/detail/pull/6 D +Remove dependency on deprecated type_trait headers: https://github.com/boostorg/detail/pull/8 D + +FOREACH +~~~~~~~ + +Relies on conversion from integral_constant* to mpl::bool_* +https://github.com/boostorg/foreach/pull/3 D + +FUNCTION +-------- + +Removed dependencies on ice_xxx.hpp headers: https://github.com/boostorg/function/pull/5 D +Use ! operator directly rather than boost::mpl::not with Boost supported compilers: +https://github.com/boostorg/function/pull/8 D + +FUSION +------ + +Deprecated header usage: https://github.com/boostorg/fusion/pull/77 D + +FUNCTION_TYPES +-------------- + +Removed dependency on deprecated template_arity_spec.hpp: https://github.com/boostorg/function_types/pull/2 D +Remove use of deprecated header: https://github.com/boostorg/function_types/pull/4 D + +GRAPH +~~~~~ + +* Needs to remove ice_or usage: https://github.com/boostorg/graph/pull/30 + +ITERATOR +~~~~~~~~ + +* is_lvalue_iterator.hpp needs to include mpl/bool.hpp +https://github.com/boostorg/iterator/pull/11 D +* Removed reliance on deprecated type traits headers: https://github.com/boostorg/iterator/pull/14 D + +LAMBDA +~~~~~~ + +Missing includes: +ice.hpp see https://github.com/boostorg/lambda/pull/3 D +Lots of headers: https://github.com/boostorg/lambda/pull/4 D +Changes for type_traits Version2: https://github.com/boostorg/lambda/pull/9 D + +LEXICAL_CAST +~~~~~~~~~~~ +missing is_float.hpp in converter_numeric.hpp https://github.com/boostorg/lexical_cast/pull/8 D +Use mpl instead of ice_ functionality: https://github.com/boostorg/lexical_cast/pull/11 D +Change to use operators rather than mpl equivalents for constant boolean values, in the replacements +eliminating dependency on deprecated type_traits headers: +https://github.com/boostorg/lexical_cast/pull/15 D + + +PYTHON +------ + +deprecated header usage: https://github.com/boostorg/python/pull/23 + +RANDOM +~~~~~~ + +Missing #includes: https://github.com/boostorg/random/pull/13 DM + +RANGE +----- + +Remove dependency on type traits ice_xxx.hpp headers, which are deprecated: +https://github.com/boostorg/range/pull/27 D +Use operator || rather than boost::mpl::or_ for constant boolean expression: +https://github.com/boostorg/range/pull/31 D + +TEST +---- + +Add needed MPL header file: +https://github.com/boostorg/test/pull/58 D + +VARIANT +------- + +Removed reliance on deprecated type_traits header: https://github.com/boostorg/variant/pull/12 D + +Unexplained new failures +~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/include/boost/aligned_storage.hpp b/include/boost/aligned_storage.hpp index b5455f0..f400fa9 100644 --- a/include/boost/aligned_storage.hpp +++ b/include/boost/aligned_storage.hpp @@ -13,131 +13,6 @@ #ifndef BOOST_ALIGNED_STORAGE_HPP #define BOOST_ALIGNED_STORAGE_HPP -#include // for std::size_t - -#include "boost/config.hpp" -#include "boost/detail/workaround.hpp" -#include "boost/type_traits/alignment_of.hpp" -#include "boost/type_traits/type_with_alignment.hpp" -#include "boost/type_traits/is_pod.hpp" - -#include "boost/mpl/eval_if.hpp" -#include "boost/mpl/identity.hpp" - -#include "boost/type_traits/detail/bool_trait_def.hpp" - -namespace boost { - -namespace detail { namespace aligned_storage { - -BOOST_STATIC_CONSTANT( - std::size_t - , alignment_of_max_align = ::boost::alignment_of::value - ); - -// -// To be TR1 conforming this must be a POD type: -// -template < - std::size_t size_ - , std::size_t alignment_ -> -struct aligned_storage_imp -{ - union data_t - { - char buf[size_]; - - typename ::boost::mpl::eval_if_c< - alignment_ == std::size_t(-1) - , ::boost::mpl::identity< ::boost::detail::max_align > - , ::boost::type_with_alignment - >::type align_; - } data_; - void* address() const { return const_cast(this); } -}; - -template< std::size_t alignment_ > -struct aligned_storage_imp<0u,alignment_> -{ - /* intentionally empty */ - void* address() const { return 0; } -}; - -}} // namespace detail::aligned_storage - -template < - std::size_t size_ - , std::size_t alignment_ = std::size_t(-1) -> -class aligned_storage : -#ifndef __BORLANDC__ - private -#else - public -#endif - ::boost::detail::aligned_storage::aligned_storage_imp -{ - -public: // constants - - typedef ::boost::detail::aligned_storage::aligned_storage_imp type; - - BOOST_STATIC_CONSTANT( - std::size_t - , size = size_ - ); - BOOST_STATIC_CONSTANT( - std::size_t - , alignment = ( - alignment_ == std::size_t(-1) - ? ::boost::detail::aligned_storage::alignment_of_max_align - : alignment_ - ) - ); - -private: // noncopyable - - aligned_storage(const aligned_storage&); - aligned_storage& operator=(const aligned_storage&); - -public: // structors - - aligned_storage() - { - } - - ~aligned_storage() - { - } - -public: // accessors - - void* address() - { - return static_cast(this)->address(); - } - - const void* address() const - { - return static_cast(this)->address(); - } -}; - -// -// Make sure that is_pod recognises aligned_storage<>::type -// as a POD (Note that aligned_storage<> itself is not a POD): -// -template -struct is_pod< ::boost::detail::aligned_storage::aligned_storage_imp > - BOOST_TT_AUX_BOOL_C_BASE(true) -{ - BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(true) -}; - - -} // namespace boost - -#include "boost/type_traits/detail/bool_trait_undef.hpp" +#include #endif // BOOST_ALIGNED_STORAGE_HPP diff --git a/include/boost/type_traits.hpp b/include/boost/type_traits.hpp index 398c687..4c9d8eb 100644 --- a/include/boost/type_traits.hpp +++ b/include/boost/type_traits.hpp @@ -97,6 +97,4 @@ #include "boost/type_traits/promote.hpp" #endif -#include "boost/type_traits/ice.hpp" - #endif // BOOST_TYPE_TRAITS_HPP diff --git a/include/boost/type_traits/add_const.hpp b/include/boost/type_traits/add_const.hpp index 0a27f8a..802696c 100644 --- a/include/boost/type_traits/add_const.hpp +++ b/include/boost/type_traits/add_const.hpp @@ -10,13 +10,12 @@ #ifndef BOOST_TT_ADD_CONST_HPP_INCLUDED #define BOOST_TT_ADD_CONST_HPP_INCLUDED -#include - -// should be the last #include -#include +#include namespace boost { +BOOST_TT_INLINE_NS + // * convert a type T to const type - add_const // this is not required since the result is always // the same as "T const", but it does suppress warnings @@ -30,16 +29,21 @@ namespace boost { # pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored #endif -BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_const,T,T const) + template struct add_const + { + typedef T const type; + }; #if defined(BOOST_MSVC) # pragma warning(pop) #endif -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_const,T&,T&) + template struct add_const + { + typedef T& type; + }; +BOOST_TT_INLINE_NS_END } // namespace boost -#include - #endif // BOOST_TT_ADD_CONST_HPP_INCLUDED diff --git a/include/boost/type_traits/add_cv.hpp b/include/boost/type_traits/add_cv.hpp index 66625c6..e62ddee 100644 --- a/include/boost/type_traits/add_cv.hpp +++ b/include/boost/type_traits/add_cv.hpp @@ -13,9 +13,6 @@ #include -// should be the last #include -#include - namespace boost { // * convert a type T to a const volatile type - add_cv @@ -31,16 +28,14 @@ namespace boost { # pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored #endif -BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_cv,T,T const volatile) +template struct add_cv{ typedef T const volatile type; }; #if defined(BOOST_MSVC) # pragma warning(pop) #endif -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_cv,T&,T&) +template struct add_cv{ typedef T& type; }; } // namespace boost -#include - #endif // BOOST_TT_ADD_CV_HPP_INCLUDED diff --git a/include/boost/type_traits/add_lvalue_reference.hpp b/include/boost/type_traits/add_lvalue_reference.hpp index 1d75794..41851a1 100644 --- a/include/boost/type_traits/add_lvalue_reference.hpp +++ b/include/boost/type_traits/add_lvalue_reference.hpp @@ -8,19 +8,20 @@ #include -// should be the last #include -#include - namespace boost{ -BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_lvalue_reference,T,typename boost::add_reference::type) +template struct add_lvalue_reference +{ + typedef typename boost::add_reference::type type; +}; #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_lvalue_reference,T&&,T&) +template struct add_lvalue_reference +{ + typedef T& type; +}; #endif } -#include - #endif // BOOST_TYPE_TRAITS_EXT_ADD_LVALUE_REFERENCE__HPP diff --git a/include/boost/type_traits/add_pointer.hpp b/include/boost/type_traits/add_pointer.hpp index 3e0e481..745f63a 100644 --- a/include/boost/type_traits/add_pointer.hpp +++ b/include/boost/type_traits/add_pointer.hpp @@ -11,13 +11,8 @@ #include -// should be the last #include -#include - namespace boost { -namespace detail { - #if defined(__BORLANDC__) && (__BORLANDC__ < 0x5A0) // // For some reason this implementation stops Borlands compiler @@ -25,27 +20,27 @@ namespace detail { // to arrays for some reason though (shrug...) (JM 20021104) // template -struct add_pointer_impl +struct add_pointer { typedef T* type; }; template -struct add_pointer_impl +struct add_pointer { typedef T* type; }; template -struct add_pointer_impl +struct add_pointer { typedef T* type; }; template -struct add_pointer_impl +struct add_pointer { typedef T* type; }; template -struct add_pointer_impl +struct add_pointer { typedef T* type; }; @@ -53,7 +48,7 @@ struct add_pointer_impl #else template -struct add_pointer_impl +struct add_pointer { typedef typename remove_reference::type no_ref_type; typedef no_ref_type* type; @@ -61,12 +56,6 @@ struct add_pointer_impl #endif -} // namespace detail - -BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_pointer,T,typename boost::detail::add_pointer_impl::type) - } // namespace boost -#include - #endif // BOOST_TT_ADD_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/add_reference.hpp b/include/boost/type_traits/add_reference.hpp index 5e3efca..526f259 100644 --- a/include/boost/type_traits/add_reference.hpp +++ b/include/boost/type_traits/add_reference.hpp @@ -9,13 +9,9 @@ #ifndef BOOST_TT_ADD_REFERENCE_HPP_INCLUDED #define BOOST_TT_ADD_REFERENCE_HPP_INCLUDED -#include #include #include -// should be the last #include -#include - namespace boost { namespace detail { @@ -26,47 +22,38 @@ namespace detail { // template -struct add_reference_rvalue_layer +struct add_reference_impl { typedef T& type; }; #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES template -struct add_reference_rvalue_layer +struct add_reference_impl { typedef T&& type; }; #endif -template -struct add_reference_impl -{ - typedef typename add_reference_rvalue_layer::type type; -}; - -BOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&) - -// these full specialisations are always required: -BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void,void) -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void const,void const) -BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void volatile,void volatile) -BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void const volatile,void const volatile) -#endif - } // namespace detail -BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_reference,T,typename boost::detail::add_reference_impl::type) +template struct add_reference +{ + typedef typename boost::detail::add_reference_impl::type type; +}; +template struct add_reference +{ + typedef T& type; +}; -// agurt, 07/mar/03: workaround Borland's ill-formed sensitivity to an additional -// level of indirection, here -#if BOOST_WORKAROUND(__BORLANDC__, < 0x600) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&) +// these full specialisations are always required: +template <> struct add_reference { typedef void type; }; +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +template <> struct add_reference { typedef void type; }; +template <> struct add_reference { typedef void type; }; +template <> struct add_reference { typedef void type; }; #endif } // namespace boost -#include - #endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED diff --git a/include/boost/type_traits/add_rvalue_reference.hpp b/include/boost/type_traits/add_rvalue_reference.hpp index 242716f..44ead34 100644 --- a/include/boost/type_traits/add_rvalue_reference.hpp +++ b/include/boost/type_traits/add_rvalue_reference.hpp @@ -15,9 +15,6 @@ #include #include -// should be the last #include -#include - //----------------------------------------------------------------------------// // // // C++03 implementation of // @@ -56,11 +53,12 @@ namespace type_traits_detail { } -BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_rvalue_reference,T,typename boost::type_traits_detail::add_rvalue_reference_imp::type) +template struct add_rvalue_reference +{ + typedef typename boost::type_traits_detail::add_rvalue_reference_imp::type type; +}; } // namespace boost -#include - #endif // BOOST_TYPE_TRAITS_EXT_ADD_RVALUE_REFERENCE__HPP diff --git a/include/boost/type_traits/add_volatile.hpp b/include/boost/type_traits/add_volatile.hpp index 86b5297..24f515c 100644 --- a/include/boost/type_traits/add_volatile.hpp +++ b/include/boost/type_traits/add_volatile.hpp @@ -12,9 +12,6 @@ #include -// should be the last #include -#include - namespace boost { // * convert a type T to volatile type - add_volatile @@ -30,16 +27,14 @@ namespace boost { # pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored #endif -BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_volatile,T,T volatile) +template struct add_volatile{ typedef T volatile type; }; #if defined(BOOST_MSVC) # pragma warning(pop) #endif -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_volatile,T&,T&) +template struct add_volatile{ typedef T& type; }; } // namespace boost -#include - #endif // BOOST_TT_ADD_VOLATILE_HPP_INCLUDED diff --git a/include/boost/type_traits/aligned_storage.hpp b/include/boost/type_traits/aligned_storage.hpp old mode 100755 new mode 100644 index 5420f26..09f0c6b --- a/include/boost/type_traits/aligned_storage.hpp +++ b/include/boost/type_traits/aligned_storage.hpp @@ -1,13 +1,138 @@ - -// 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). +//----------------------------------------------------------------------------- +// boost aligned_storage.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- // -// See http://www.boost.org/libs/type_traits for most recent version including documentation. +// Copyright (c) 2002-2003 +// Eric Friedman, Itay Maman +// +// 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 BOOST_TT_ALIGNED_STORAGE_HPP_INCLUDED -# define BOOST_TT_ALIGNED_STORAGE_HPP_INCLUDED -# include -#endif // BOOST_TT_ALIGNED_STORAGE_HPP_INCLUDED +#ifndef BOOST_TT_ALIGNED_STORAGE_HPP +#define BOOST_TT_ALIGNED_STORAGE_HPP +#include // for std::size_t + +#include "boost/config.hpp" +#include "boost/detail/workaround.hpp" +#include "boost/type_traits/alignment_of.hpp" +#include "boost/type_traits/type_with_alignment.hpp" +#include "boost/type_traits/is_pod.hpp" +#include "boost/type_traits/conditional.hpp" + +namespace boost { + +namespace detail { namespace aligned_storage { + +BOOST_STATIC_CONSTANT( + std::size_t + , alignment_of_max_align = ::boost::alignment_of::value + ); + +// +// To be TR1 conforming this must be a POD type: +// +template < + std::size_t size_ + , std::size_t alignment_ +> +struct aligned_storage_imp +{ + union data_t + { + char buf[size_]; + + typename ::boost::type_with_alignment::type align_; + } data_; + void* address() const { return const_cast(this); } +}; +template +struct aligned_storage_imp +{ + union data_t + { + char buf[size]; + ::boost::detail::max_align align_; + } data_; + void* address() const { return const_cast(this); } +}; + +template< std::size_t alignment_ > +struct aligned_storage_imp<0u,alignment_> +{ + /* intentionally empty */ + void* address() const { return 0; } +}; + +}} // namespace detail::aligned_storage + +template < + std::size_t size_ + , std::size_t alignment_ = std::size_t(-1) +> +class aligned_storage : +#ifndef __BORLANDC__ + private +#else + public +#endif + ::boost::detail::aligned_storage::aligned_storage_imp +{ + +public: // constants + + typedef ::boost::detail::aligned_storage::aligned_storage_imp type; + + BOOST_STATIC_CONSTANT( + std::size_t + , size = size_ + ); + BOOST_STATIC_CONSTANT( + std::size_t + , alignment = ( + alignment_ == std::size_t(-1) + ? ::boost::detail::aligned_storage::alignment_of_max_align + : alignment_ + ) + ); + +private: // noncopyable + + aligned_storage(const aligned_storage&); + aligned_storage& operator=(const aligned_storage&); + +public: // structors + + aligned_storage() + { + } + + ~aligned_storage() + { + } + +public: // accessors + + void* address() + { + return static_cast(this)->address(); + } + + const void* address() const + { + return static_cast(this)->address(); + } +}; + +// +// Make sure that is_pod recognises aligned_storage<>::type +// as a POD (Note that aligned_storage<> itself is not a POD): +// +template +struct is_pod< ::boost::detail::aligned_storage::aligned_storage_imp > : public true_type{}; + +} // namespace boost + +#endif // BOOST_ALIGNED_STORAGE_HPP diff --git a/include/boost/type_traits/alignment_of.hpp b/include/boost/type_traits/alignment_of.hpp index 31a5f38..7d960e3 100644 --- a/include/boost/type_traits/alignment_of.hpp +++ b/include/boost/type_traits/alignment_of.hpp @@ -13,8 +13,7 @@ #include #include -// should be the last #include -#include +#include #ifdef BOOST_MSVC # pragma warning(push) @@ -86,29 +85,25 @@ struct alignment_of_impl } // namespace detail -BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(alignment_of,T,::boost::detail::alignment_of_impl::value) +template struct alignment_of : public integral_constant::value>{}; // references have to be treated specially, assume // that a reference is just a special pointer: -template -struct alignment_of - : public alignment_of -{ -}; +template struct alignment_of : public alignment_of{}; + #ifdef __BORLANDC__ // long double gives an incorrect value of 10 (!) // unless we do this... struct long_double_wrapper{ long double ld; }; -template<> struct alignment_of - : public alignment_of{}; +template<> struct alignment_of : public alignment_of{}; #endif // void has to be treated specially: -BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(alignment_of,void,0) +template<> struct alignment_of : integral_constant{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(alignment_of,void const,0) -BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(alignment_of,void volatile,0) -BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(alignment_of,void const volatile,0) +template<> struct alignment_of : integral_constant{}; +template<> struct alignment_of : integral_constant{}; +template<> struct alignment_of : integral_constant{}; #endif } // namespace boost @@ -120,7 +115,5 @@ BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(alignment_of,void const volatile,0) # pragma warning(pop) #endif -#include - #endif // BOOST_TT_ALIGNMENT_OF_HPP_INCLUDED diff --git a/include/boost/type_traits/broken_compiler_spec.hpp b/include/boost/type_traits/broken_compiler_spec.hpp index 3a13273..030840f 100644 --- a/include/boost/type_traits/broken_compiler_spec.hpp +++ b/include/boost/type_traits/broken_compiler_spec.hpp @@ -1,14 +1,21 @@ -// Copyright 2001-2003 Aleksey Gurtovoy. +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. // 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_BROKEN_COMPILER_SPEC_HPP_INCLUDED -#define BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED - -#include +#ifndef BOOST_TT_BROKEN_SPEC_HPP_INCLUDED +#define BOOST_TT_BROKEN_SPEC_HPP_INCLUDED +// +// This header is deprecated and no longer used by type_traits: +// +#if defined(__GNUC__) || defined(_MSC_VER) +# pragma message("NOTE: Use of this header (boost/type_traits/broken_compiler_spec.hpp) is deprecated") #endif + +#endif // BOOST_TT_CONFIG_HPP_INCLUDED + + diff --git a/include/boost/type_traits/common_type.hpp b/include/boost/type_traits/common_type.hpp index b52ff16..194c7c4 100644 --- a/include/boost/type_traits/common_type.hpp +++ b/include/boost/type_traits/common_type.hpp @@ -10,6 +10,7 @@ #define BOOST_TYPE_TRAITS_COMMON_TYPE_HPP #include +#include #if defined(__SUNPRO_CC) && !defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF) # define BOOST_COMMON_TYPE_DONT_USE_TYPEOF @@ -18,40 +19,31 @@ # define BOOST_COMMON_TYPE_DONT_USE_TYPEOF #endif +#ifdef __GNUC__ +// All supported GCC versions (and emulations thereof) support __typeof__ +#define BOOST_COMMON_TYPE_USE_TYPEOF +#endif + //----------------------------------------------------------------------------// #if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_COMMON_TYPE_ARITY) #define BOOST_COMMON_TYPE_ARITY 3 #endif //----------------------------------------------------------------------------// -#if defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF) -#include // boost wonders never cease! -#endif - -//----------------------------------------------------------------------------// -#ifndef BOOST_NO_CXX11_STATIC_ASSERT -#define BOOST_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) static_assert(CND,MSG) -#elif defined(BOOST_COMMON_TYPE_USES_MPL_ASSERT) -#include -#include -#define BOOST_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) \ - BOOST_MPL_ASSERT_MSG(boost::mpl::bool_< (CND) >::type::value, MSG, TYPES) -#else -#include -#define BOOST_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) BOOST_STATIC_ASSERT(CND) -#endif - -#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) || !defined(BOOST_COMMON_TYPE_USES_MPL_ASSERT) -#define BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE "must be complete type" -#endif - -#if defined(BOOST_NO_CXX11_DECLTYPE) && defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF) -#include -#include -#endif -#include +#if !defined(BOOST_NO_CXX11_DECLTYPE) #include +#elif defined(BOOST_COMMON_TYPE_USE_TYPEOF) #include +#elif defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF) +#include +#else +#include // boost wonders never cease! +#include +#include +#endif + +#include +#include //----------------------------------------------------------------------------// // // @@ -64,6 +56,14 @@ namespace boost { + namespace type_traits_detail { + + template + struct std_decay: boost::remove_cv< + typename boost::decay::type> {}; + + } + // prototype #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) template @@ -87,9 +87,9 @@ namespace boost { #endif { - BOOST_COMMON_TYPE_STATIC_ASSERT(sizeof(T) > 0, BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE, (T)); + BOOST_STATIC_ASSERT_MSG(sizeof(T) > 0, "The template arguments to common_type must be complete types"); public: - typedef T type; + typedef typename type_traits_detail::std_decay::type type; }; // 2 args @@ -99,16 +99,18 @@ namespace type_traits_detail { struct common_type_2 { private: - BOOST_COMMON_TYPE_STATIC_ASSERT(sizeof(T) > 0, BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE, (T)); - BOOST_COMMON_TYPE_STATIC_ASSERT(sizeof(U) > 0, BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE, (U)); - static bool declval_bool(); // workaround gcc bug; not required by std - static typename add_rvalue_reference::type declval_T(); // workaround gcc bug; not required by std - static typename add_rvalue_reference::type declval_U(); // workaround gcc bug; not required by std - static typename add_rvalue_reference::type declval_b(); + BOOST_STATIC_ASSERT_MSG(sizeof(T) > 0, "The template arguments to common_type must be complete types"); + BOOST_STATIC_ASSERT_MSG(sizeof(U) > 0, "The template arguments to common_type must be complete types"); #if !defined(BOOST_NO_CXX11_DECLTYPE) public: - typedef decltype(declval() ? declval() : declval()) type; + typedef typename std_decay() ? declval() : declval())>::type type; +#elif defined(BOOST_COMMON_TYPE_USE_TYPEOF) + static typename add_rvalue_reference::type declval_T(); // workaround gcc bug; not required by std + static typename add_rvalue_reference::type declval_U(); // workaround gcc bug; not required by std + static typename add_rvalue_reference::type declval_b(); + public: + typedef typename std_decay<__typeof__(declval_b() ? declval_T() : declval_U())>::type type; #elif defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF) public: typedef typename detail_type_traits_common_type::common_type_impl< @@ -116,8 +118,11 @@ namespace type_traits_detail { typename remove_cv::type >::type type; #else + static typename add_rvalue_reference::type declval_T(); // workaround gcc bug; not required by std + static typename add_rvalue_reference::type declval_U(); // workaround gcc bug; not required by std + static typename add_rvalue_reference::type declval_b(); public: - typedef BOOST_TYPEOF_TPL(declval_b() ? declval_T() : declval_U()) type; + typedef typename std_decay::type type; #endif #if defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ == 3 @@ -129,7 +134,7 @@ namespace type_traits_detail { template struct common_type_2 { - typedef T type; + typedef typename type_traits_detail::std_decay::type type; }; } diff --git a/include/boost/type_traits/conditional.hpp b/include/boost/type_traits/conditional.hpp index 8bbda85..b7e82db 100644 --- a/include/boost/type_traits/conditional.hpp +++ b/include/boost/type_traits/conditional.hpp @@ -1,4 +1,3 @@ - // (C) Copyright John Maddock 2010. // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -10,14 +9,10 @@ #ifndef BOOST_TT_CONDITIONAL_HPP_INCLUDED #define BOOST_TT_CONDITIONAL_HPP_INCLUDED -#include - namespace boost { -template -struct conditional : public mpl::if_c -{ -}; +template struct conditional { typedef T type; }; +template struct conditional { typedef U type; }; } // namespace boost diff --git a/include/boost/type_traits/config.hpp b/include/boost/type_traits/config.hpp index 2e25ad0..47a0648 100644 --- a/include/boost/type_traits/config.hpp +++ b/include/boost/type_traits/config.hpp @@ -6,67 +6,16 @@ // // See http://www.boost.org/libs/type_traits for most recent version including documentation. -#ifndef BOOST_TT_CONFIG_HPP_INCLUDED -#define BOOST_TT_CONFIG_HPP_INCLUDED +#ifndef BOOST_TT_OLD_CONFIG_HPP_INCLUDED +#define BOOST_TT_OLD_CONFIG_HPP_INCLUDED -#ifndef BOOST_CONFIG_HPP -#include +// +// This header is deprecated and no longer used by type_traits: +// +#if defined(__GNUC__) || defined(_MSC_VER) +# pragma message("NOTE: Use of this header (boost/type_traits/config.hpp) is deprecated") #endif -#include - -// -// whenever we have a conversion function with ellipses -// it needs to be declared __cdecl to suppress compiler -// warnings from MS and Borland compilers (this *must* -// appear before we include is_same.hpp below): -#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32)) -# define BOOST_TT_DECL __cdecl -#else -# define BOOST_TT_DECL /**/ -#endif - -# if (BOOST_WORKAROUND(__MWERKS__, < 0x3000) \ - || BOOST_WORKAROUND(__IBMCPP__, < 600 ) \ - || BOOST_WORKAROUND(__BORLANDC__, < 0x5A0) \ - || defined(__ghs) \ - || 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) - -# define BOOST_TT_NO_CONFORMING_IS_CLASS_IMPLEMENTATION 1 - -#endif - -#ifndef BOOST_TT_NO_CONFORMING_IS_CLASS_IMPLEMENTATION -# define BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION 1 -#endif - -// -// define BOOST_TT_TEST_MS_FUNC_SIGS -// when we want to test __stdcall etc function types with is_function etc -// (Note, does not work with Borland, even though it does support __stdcall etc): -// -#if defined(_MSC_EXTENSIONS) && !defined(__BORLANDC__) -# define BOOST_TT_TEST_MS_FUNC_SIGS -#endif - -// -// define BOOST_TT_NO_CV_FUNC_TEST -// if tests for cv-qualified member functions don't -// work in is_member_function_pointer -// -#if BOOST_WORKAROUND(__MWERKS__, < 0x3000) || BOOST_WORKAROUND(__IBMCPP__, <= 600) -# define BOOST_TT_NO_CV_FUNC_TEST -#endif - -// -// Macros that have been deprecated, defined here for backwards compatibility: -// -#define BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(x) -#define BOOST_TT_BROKEN_COMPILER_SPEC(x) - #endif // BOOST_TT_CONFIG_HPP_INCLUDED diff --git a/include/boost/type_traits/decay.hpp b/include/boost/type_traits/decay.hpp old mode 100755 new mode 100644 index c23a9b0..5b57fda --- a/include/boost/type_traits/decay.hpp +++ b/include/boost/type_traits/decay.hpp @@ -9,33 +9,31 @@ #ifndef BOOST_TT_DECAY_HPP_INCLUDED #define BOOST_TT_DECAY_HPP_INCLUDED -#include #include #include #include #include #include -#include -#include namespace boost { + namespace detail + { + + template struct decay_imp { typedef T type; }; + template struct decay_imp { typedef typename remove_bounds::type* type; }; + template struct decay_imp { typedef T* type; }; + + } + template< class T > struct decay { private: - typedef BOOST_DEDUCED_TYPENAME remove_reference::type Ty; + typedef typename remove_reference::type Ty; public: - typedef BOOST_DEDUCED_TYPENAME mpl::eval_if< - is_array, - mpl::identity::type*>, - BOOST_DEDUCED_TYPENAME mpl::eval_if< - is_function, - add_pointer, - mpl::identity - > - >::type type; + typedef typename boost::detail::decay_imp::value, boost::is_function::value>::type type; }; } // namespace boost diff --git a/include/boost/type_traits/detail/bool_trait_def.hpp b/include/boost/type_traits/detail/bool_trait_def.hpp index 69e4f1c..b6b0677 100644 --- a/include/boost/type_traits/detail/bool_trait_def.hpp +++ b/include/boost/type_traits/detail/bool_trait_def.hpp @@ -11,10 +11,15 @@ // $Date$ // $Revision$ +// +// This header is deprecated and no longer used by type_traits: +// +#if defined(__GNUC__) || defined(_MSC_VER) +# pragma message("NOTE: Use of this header (bool_trait_def.hpp) is deprecated") +#endif + #include #include -#include -#include #include // @@ -39,14 +44,6 @@ #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; \ - enum { value = type::value }; \ - /**/ -# define BOOST_TT_AUX_BOOL_C_BASE(C) -#endif - #ifndef BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL # define BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) /**/ #endif @@ -62,7 +59,6 @@ template< typename T > struct trait \ { \ public:\ BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ - BOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(T)) \ }; \ \ BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) \ @@ -75,7 +71,6 @@ template< typename T1, typename T2 > struct trait \ { \ public:\ BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ - BOOST_MPL_AUX_LAMBDA_SUPPORT(2,trait,(T1,T2)) \ }; \ \ BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,trait) \ @@ -87,7 +82,6 @@ template< typename T1, typename T2, typename T3 > struct trait \ { \ public:\ BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ - BOOST_MPL_AUX_LAMBDA_SUPPORT(3,trait,(T1,T2,T3)) \ }; \ \ BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(3,trait) \ @@ -99,7 +93,6 @@ template<> struct trait< sp > \ { \ public:\ BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ - BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,trait,(sp)) \ }; \ /**/ @@ -109,7 +102,6 @@ template<> struct trait< sp1,sp2 > \ { \ public:\ BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ - BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2,trait,(sp1,sp2)) \ }; \ /**/ @@ -153,7 +145,6 @@ template< param > struct trait< sp1,sp2 > \ { \ public:\ BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ - BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2,trait,(sp1,sp2)) \ }; \ /**/ diff --git a/include/boost/type_traits/detail/config.hpp b/include/boost/type_traits/detail/config.hpp new file mode 100644 index 0000000..c1c611f --- /dev/null +++ b/include/boost/type_traits/detail/config.hpp @@ -0,0 +1,84 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// 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_CONFIG_HPP_INCLUDED +#define BOOST_TT_CONFIG_HPP_INCLUDED + +#ifndef BOOST_CONFIG_HPP +#include +#endif +#include +#include + +// +// whenever we have a conversion function with ellipses +// it needs to be declared __cdecl to suppress compiler +// warnings from MS and Borland compilers (this *must* +// appear before we include is_same.hpp below): +#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32)) +# define BOOST_TT_DECL __cdecl +#else +# define BOOST_TT_DECL /**/ +#endif + +# if (BOOST_WORKAROUND(__MWERKS__, < 0x3000) \ + || BOOST_WORKAROUND(__IBMCPP__, < 600 ) \ + || BOOST_WORKAROUND(__BORLANDC__, < 0x5A0) \ + || defined(__ghs) \ + || 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) + +# define BOOST_TT_NO_CONFORMING_IS_CLASS_IMPLEMENTATION 1 + +#endif + +#ifndef BOOST_TT_NO_CONFORMING_IS_CLASS_IMPLEMENTATION +# define BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION 1 +#endif + +// +// define BOOST_TT_TEST_MS_FUNC_SIGS +// when we want to test __stdcall etc function types with is_function etc +// (Note, does not work with Borland, even though it does support __stdcall etc): +// +#if defined(_MSC_EXTENSIONS) && !defined(__BORLANDC__) +# define BOOST_TT_TEST_MS_FUNC_SIGS +#endif + +// +// define BOOST_TT_NO_CV_FUNC_TEST +// if tests for cv-qualified member functions don't +// work in is_member_function_pointer +// +#if BOOST_WORKAROUND(__MWERKS__, < 0x3000) || BOOST_WORKAROUND(__IBMCPP__, <= 600) +# define BOOST_TT_NO_CV_FUNC_TEST +#endif + +// +// Macros that have been deprecated, defined here for backwards compatibility: +// +#define BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(x) +#define BOOST_TT_BROKEN_COMPILER_SPEC(x) + +#ifdef BOOST_NO_CXX11_INLINE_NAMESPACES + +#define BOOST_TT_INLINE_NS +#define BOOST_TT_INLINE_NS_END + +#else + +#define BOOST_TT_INLINE_NS inline namespace BOOST_JOIN(tt, BOOST_VERSION) { +#define BOOST_TT_INLINE_NS_END } + +#endif + +#endif // BOOST_TT_CONFIG_HPP_INCLUDED + + diff --git a/include/boost/type_traits/detail/cv_traits_impl.hpp b/include/boost/type_traits/detail/cv_traits_impl.hpp deleted file mode 100644 index 8e995bb..0000000 --- a/include/boost/type_traits/detail/cv_traits_impl.hpp +++ /dev/null @@ -1,140 +0,0 @@ - -// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard -// Hinnant & John Maddock 2000. -// 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_DETAIL_CV_TRAITS_IMPL_HPP_INCLUDED -#define BOOST_TT_DETAIL_CV_TRAITS_IMPL_HPP_INCLUDED - -#include -#include -#include - - -// implementation helper: - - -namespace boost { -namespace detail { - -#if BOOST_WORKAROUND(BOOST_MSVC, == 1700) -#define BOOST_TT_AUX_CV_TRAITS_IMPL_PARAM(X) X - template - struct cv_traits_imp - { - BOOST_STATIC_CONSTANT(bool, is_const = false); - BOOST_STATIC_CONSTANT(bool, is_volatile = false); - typedef T unqualified_type; - }; - - template - struct cv_traits_imp - { - BOOST_STATIC_CONSTANT(bool, is_const = false); - BOOST_STATIC_CONSTANT(bool, is_volatile = false); - typedef T unqualified_type[]; - }; - - template - struct cv_traits_imp - { - BOOST_STATIC_CONSTANT(bool, is_const = true); - BOOST_STATIC_CONSTANT(bool, is_volatile = false); - typedef T unqualified_type[]; - }; - - template - struct cv_traits_imp - { - BOOST_STATIC_CONSTANT(bool, is_const = false); - BOOST_STATIC_CONSTANT(bool, is_volatile = true); - typedef T unqualified_type[]; - }; - - template - struct cv_traits_imp - { - BOOST_STATIC_CONSTANT(bool, is_const = true); - BOOST_STATIC_CONSTANT(bool, is_volatile = true); - typedef T unqualified_type[]; - }; - - template - struct cv_traits_imp - { - BOOST_STATIC_CONSTANT(bool, is_const = false); - BOOST_STATIC_CONSTANT(bool, is_volatile = false); - typedef T unqualified_type[N]; - }; - - template - struct cv_traits_imp - { - BOOST_STATIC_CONSTANT(bool, is_const = true); - BOOST_STATIC_CONSTANT(bool, is_volatile = false); - typedef T unqualified_type[N]; - }; - - template - struct cv_traits_imp - { - BOOST_STATIC_CONSTANT(bool, is_const = false); - BOOST_STATIC_CONSTANT(bool, is_volatile = true); - typedef T unqualified_type[N]; - }; - - template - struct cv_traits_imp - { - BOOST_STATIC_CONSTANT(bool, is_const = true); - BOOST_STATIC_CONSTANT(bool, is_volatile = true); - typedef T unqualified_type[N]; - }; - -#else -#define BOOST_TT_AUX_CV_TRAITS_IMPL_PARAM(X) X * -template struct cv_traits_imp {}; - -template -struct cv_traits_imp -{ - BOOST_STATIC_CONSTANT(bool, is_const = false); - BOOST_STATIC_CONSTANT(bool, is_volatile = false); - typedef T unqualified_type; -}; -#endif - -template -struct cv_traits_imp -{ - BOOST_STATIC_CONSTANT(bool, is_const = true); - BOOST_STATIC_CONSTANT(bool, is_volatile = false); - typedef T unqualified_type; -}; - -template -struct cv_traits_imp -{ - BOOST_STATIC_CONSTANT(bool, is_const = false); - BOOST_STATIC_CONSTANT(bool, is_volatile = true); - typedef T unqualified_type; -}; - -template -struct cv_traits_imp -{ - BOOST_STATIC_CONSTANT(bool, is_const = true); - BOOST_STATIC_CONSTANT(bool, is_volatile = true); - typedef T unqualified_type; -}; - -} // namespace detail -} // namespace boost - - -#endif // BOOST_TT_DETAIL_CV_TRAITS_IMPL_HPP_INCLUDED diff --git a/include/boost/type_traits/detail/false_result.hpp b/include/boost/type_traits/detail/false_result.hpp deleted file mode 100644 index e65e8bc..0000000 --- a/include/boost/type_traits/detail/false_result.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright David Abrahams 2002. -// 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_DETAIL_FALSE_RESULT_HPP_INCLUDED -#define BOOST_TT_DETAIL_FALSE_RESULT_HPP_INCLUDED - -#include - -namespace boost { -namespace type_traits { - -// Utility class which always "returns" false -struct false_result -{ - template struct result_ - { - BOOST_STATIC_CONSTANT(bool, value = false); - }; -}; - -}} // namespace boost::type_traits - -#endif // BOOST_TT_DETAIL_FALSE_RESULT_HPP_INCLUDED diff --git a/include/boost/type_traits/detail/has_binary_operator.hpp b/include/boost/type_traits/detail/has_binary_operator.hpp index d82a5ce..8d44ddd 100644 --- a/include/boost/type_traits/detail/has_binary_operator.hpp +++ b/include/boost/type_traits/detail/has_binary_operator.hpp @@ -7,7 +7,7 @@ // See http://www.boost.org/libs/type_traits for most recent version including documentation. #include -#include +#include #include #include #include @@ -21,9 +21,6 @@ #include #include -// should be the last #include -#include - // cannot include this header without getting warnings of the kind: // gcc: // warning: value computed is not used @@ -177,13 +174,7 @@ struct trait_impl1 < Lhs, Rhs, Ret, true > { template < typename Lhs, typename Rhs, typename Ret > struct trait_impl1 < Lhs, Rhs, Ret, false > { BOOST_STATIC_CONSTANT(bool, - value = ( - ::boost::type_traits::ice_and< - operator_exists < Lhs, Rhs >::value, - operator_returns_Ret < Lhs, Rhs, Ret, operator_returns_void < Lhs, Rhs >::value >::value - >::value - ) - ); + value = (operator_exists < Lhs, Rhs >::value && operator_returns_Ret < Lhs, Rhs, Ret, operator_returns_void < Lhs, Rhs >::value >::value)); }; // some specializations needs to be declared for the special void case @@ -218,12 +209,11 @@ struct trait_impl { } // namespace detail // this is the accessible definition of the trait to end user -BOOST_TT_AUX_BOOL_TRAIT_DEF3(BOOST_TT_TRAIT_NAME, Lhs, Rhs=Lhs, Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::trait_impl < Lhs, Rhs, Ret >::value)) +template +struct BOOST_TT_TRAIT_NAME : public integral_constant::value)>{}; } // namespace boost #if defined(BOOST_MSVC) # pragma warning ( pop ) #endif - -#include diff --git a/include/boost/type_traits/detail/has_postfix_operator.hpp b/include/boost/type_traits/detail/has_postfix_operator.hpp index e9048e1..a305b3b 100644 --- a/include/boost/type_traits/detail/has_postfix_operator.hpp +++ b/include/boost/type_traits/detail/has_postfix_operator.hpp @@ -7,7 +7,7 @@ // See http://www.boost.org/libs/type_traits for most recent version including documentation. #include -#include +#include #include #include #include @@ -18,9 +18,6 @@ #include #include -// should be the last #include -#include - // avoid warnings #if defined(__GNUC__) # pragma GCC system_header @@ -163,13 +160,7 @@ struct trait_impl1 < Lhs, Ret, true > { template < typename Lhs, typename Ret > struct trait_impl1 < Lhs, Ret, false > { BOOST_STATIC_CONSTANT(bool, - value = ( - ::boost::type_traits::ice_and< - operator_exists < Lhs >::value, - operator_returns_Ret < Lhs, Ret, operator_returns_void < Lhs >::value >::value - >::value - ) - ); + value = (operator_exists < Lhs >::value && operator_returns_Ret < Lhs, Ret, operator_returns_void < Lhs >::value >::value)); }; // specialization needs to be declared for the special void case @@ -191,12 +182,11 @@ struct trait_impl { } // namespace detail // this is the accessible definition of the trait to end user -BOOST_TT_AUX_BOOL_TRAIT_DEF2(BOOST_TT_TRAIT_NAME, Lhs, Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::trait_impl< Lhs, Ret >::value)) +template +struct BOOST_TT_TRAIT_NAME : public integral_constant::value)>{}; } // namespace boost #if defined(BOOST_MSVC) # pragma warning ( pop ) #endif - -#include diff --git a/include/boost/type_traits/detail/has_prefix_operator.hpp b/include/boost/type_traits/detail/has_prefix_operator.hpp index e1cf8d0..bbfc93d 100644 --- a/include/boost/type_traits/detail/has_prefix_operator.hpp +++ b/include/boost/type_traits/detail/has_prefix_operator.hpp @@ -7,7 +7,7 @@ // See http://www.boost.org/libs/type_traits for most recent version including documentation. #include -#include +#include #include #include #include @@ -19,9 +19,6 @@ #include #include -// should be the last #include -#include - // cannot include this header without getting warnings of the kind: // gcc: // warning: value computed is not used @@ -171,13 +168,7 @@ struct trait_impl1 < Rhs, Ret, true > { template < typename Rhs, typename Ret > struct trait_impl1 < Rhs, Ret, false > { BOOST_STATIC_CONSTANT(bool, - value = ( - ::boost::type_traits::ice_and< - operator_exists < Rhs >::value, - operator_returns_Ret < Rhs, Ret, operator_returns_void < Rhs >::value >::value - >::value - ) - ); + value = (operator_exists < Rhs >::value && operator_returns_Ret < Rhs, Ret, operator_returns_void < Rhs >::value >::value)); }; // specialization needs to be declared for the special void case @@ -199,12 +190,11 @@ struct trait_impl { } // namespace detail // this is the accessible definition of the trait to end user -BOOST_TT_AUX_BOOL_TRAIT_DEF2(BOOST_TT_TRAIT_NAME, Rhs, Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::trait_impl < Rhs, Ret >::value)) +template +struct BOOST_TT_TRAIT_NAME : public integral_constant::value)>{}; } // namespace boost #if defined(BOOST_MSVC) # pragma warning ( pop ) #endif - -#include diff --git a/include/boost/type_traits/detail/ice_and.hpp b/include/boost/type_traits/detail/ice_and.hpp index 8b461b9..3ccb03e 100644 --- a/include/boost/type_traits/detail/ice_and.hpp +++ b/include/boost/type_traits/detail/ice_and.hpp @@ -11,6 +11,13 @@ #include +// +// This header is deprecated and no longer used by type_traits: +// +#if defined(__GNUC__) || defined(_MSC_VER) +# pragma message("NOTE: Use of this header (ice_and.hpp) is deprecated") +#endif + namespace boost { namespace type_traits { diff --git a/include/boost/type_traits/detail/ice_eq.hpp b/include/boost/type_traits/detail/ice_eq.hpp index ea42a60..5908f81 100644 --- a/include/boost/type_traits/detail/ice_eq.hpp +++ b/include/boost/type_traits/detail/ice_eq.hpp @@ -10,6 +10,13 @@ #include +// +// This header is deprecated and no longer used by type_traits: +// +#if defined(__GNUC__) || defined(_MSC_VER) +# pragma message("NOTE: Use of this header (ice_eq.hpp) is deprecated") +#endif + namespace boost { namespace type_traits { diff --git a/include/boost/type_traits/detail/ice_not.hpp b/include/boost/type_traits/detail/ice_not.hpp index ee1dca0..e095be9 100644 --- a/include/boost/type_traits/detail/ice_not.hpp +++ b/include/boost/type_traits/detail/ice_not.hpp @@ -10,6 +10,13 @@ #include +// +// This header is deprecated and no longer used by type_traits: +// +#if defined(__GNUC__) || defined(_MSC_VER) +# pragma message("NOTE: Use of this header (ice_not.hpp) is deprecated") +#endif + namespace boost { namespace type_traits { diff --git a/include/boost/type_traits/detail/ice_or.hpp b/include/boost/type_traits/detail/ice_or.hpp index f88d9f6..ea523c8 100644 --- a/include/boost/type_traits/detail/ice_or.hpp +++ b/include/boost/type_traits/detail/ice_or.hpp @@ -10,6 +10,13 @@ #include +// +// This header is deprecated and no longer used by type_traits: +// +#if defined(__GNUC__) || defined(_MSC_VER) +# pragma message("NOTE: Use of this header (ice_or.hpp) is deprecated") +#endif + namespace boost { namespace type_traits { diff --git a/include/boost/type_traits/detail/is_function_ptr_helper.hpp b/include/boost/type_traits/detail/is_function_ptr_helper.hpp index 1c3b17f..3538e40 100644 --- a/include/boost/type_traits/detail/is_function_ptr_helper.hpp +++ b/include/boost/type_traits/detail/is_function_ptr_helper.hpp @@ -15,12 +15,20 @@ #ifndef BOOST_TT_DETAIL_IS_FUNCTION_PTR_HELPER_HPP_INCLUDED #define BOOST_TT_DETAIL_IS_FUNCTION_PTR_HELPER_HPP_INCLUDED -#include - #if defined(BOOST_TT_PREPROCESSING_MODE) -# include -# include -# include +// +// Hide these #include from dependency analysers as +// these are required in maintenance mode only: +// +#define PP1 +#include PP1 +#undef PP1 +#define PP1 +#include PP1 +#undef PP1 +#define PP1 +#include PP1 +#undef PP1 #endif namespace boost { 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 2eb8a6f..4fe88e8 100644 --- a/include/boost/type_traits/detail/is_function_ptr_tester.hpp +++ b/include/boost/type_traits/detail/is_function_ptr_tester.hpp @@ -15,12 +15,21 @@ #define BOOST_TT_DETAIL_IS_FUNCTION_PTR_TESTER_HPP_INCLUDED #include -#include #if defined(BOOST_TT_PREPROCESSING_MODE) -# include -# include -# include +// +// Hide include dependencies from analysers since they're +// only require in maintenance mode: +// +#define PP1 +#define PP2 +#define PP3 +#include PP1 +#include PP2 +#include PP3 +#undef PP1 +#undef PP2 +#undef PP3 #endif namespace boost { diff --git a/include/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp b/include/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp index bd5c591..5698a74 100644 --- a/include/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp +++ b/include/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp @@ -17,9 +17,19 @@ #include #if defined(BOOST_TT_PREPROCESSING_MODE) -# include -# include -# include +// +// Maintenance mode, hide include dependencies +// from trackers: +// +#define PPI +#include PPI +#undef PPI +#define PPI +#include PPI +#undef PPI +#define PPI +#include PPI +#undef PPI #endif namespace boost { 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 334a843..5e31693 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 @@ -15,12 +15,22 @@ #define BOOST_TT_DETAIL_IS_MEM_FUN_POINTER_TESTER_HPP_INCLUDED #include -#include +#include #if defined(BOOST_TT_PREPROCESSING_MODE) -# include -# include -# include +// +// Maintentance mode, hide include dependencies +// from dependency trackers: +// +#define PPI +#include PPI +#undef PPI +#define PPI +#include PPI +#undef PPI +#define +#include PPI +#undef #endif namespace boost { diff --git a/include/boost/type_traits/detail/size_t_trait_def.hpp b/include/boost/type_traits/detail/size_t_trait_def.hpp deleted file mode 100644 index 8cea9b4..0000000 --- a/include/boost/type_traits/detail/size_t_trait_def.hpp +++ /dev/null @@ -1,51 +0,0 @@ - -// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION - -// Copyright Aleksey Gurtovoy 2002-2004 -// -// 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) - -// $Source$ -// $Date$ -// $Revision$ - -#include -#include -#include -#include - -#include - -// Obsolete. Remove. -#define BOOST_TT_AUX_SIZE_T_BASE(C) public ::boost::integral_constant -#define BOOST_TT_AUX_SIZE_T_TRAIT_VALUE_DECL(C) /**/ - - -#define BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(trait,T,C) \ -template< typename T > struct trait \ - : public ::boost::integral_constant \ -{ \ -public:\ - BOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(T)) \ -}; \ -\ -BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) \ -/**/ - -#define BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(trait,spec,C) \ -template<> struct trait \ - : public ::boost::integral_constant \ -{ \ -public:\ - BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,trait,(spec)) \ -}; \ -/**/ - -#define BOOST_TT_AUX_SIZE_T_TRAIT_PARTIAL_SPEC1_1(param,trait,spec,C) \ -template< param > struct trait \ - : public ::boost::integral_constant \ -{ \ -}; \ -/**/ diff --git a/include/boost/type_traits/detail/size_t_trait_undef.hpp b/include/boost/type_traits/detail/size_t_trait_undef.hpp deleted file mode 100644 index 1694fac..0000000 --- a/include/boost/type_traits/detail/size_t_trait_undef.hpp +++ /dev/null @@ -1,16 +0,0 @@ - -// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION - -// Copyright Aleksey Gurtovoy 2002-2004 -// -// 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) - -// $Source$ -// $Date$ -// $Revision$ - -#undef BOOST_TT_AUX_SIZE_T_TRAIT_DEF1 -#undef BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1 -#undef BOOST_TT_AUX_SIZE_T_TRAIT_PARTIAL_SPEC1_1 diff --git a/include/boost/type_traits/detail/template_arity_spec.hpp b/include/boost/type_traits/detail/template_arity_spec.hpp index fe9b422..36ea96d 100644 --- a/include/boost/type_traits/detail/template_arity_spec.hpp +++ b/include/boost/type_traits/detail/template_arity_spec.hpp @@ -1,4 +1,3 @@ - // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION // Copyright Aleksey Gurtovoy 2002-2004 @@ -7,25 +6,11 @@ // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include -#include -#include -#include -#include - -#if defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT) \ - && defined(BOOST_MPL_CFG_BROKEN_OVERLOAD_RESOLUTION) -# define BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(i, name) \ -namespace mpl { namespace aux { \ -template< BOOST_MPL_PP_PARAMS(i, typename T) > \ -struct template_arity< \ - name< BOOST_MPL_PP_PARAMS(i, T) > \ - > \ - : int_ \ -{ \ -}; \ -}} \ -/**/ -#else -# define BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(i, name) /**/ +// +// This header is deprecated and no longer used by type_traits: +// +#if defined(__GNUC__) || defined(_MSC_VER) +# pragma message("NOTE: Use of this header (template_arity_spec.hpp) is deprecated") #endif + +# define BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(i, name) /**/ diff --git a/include/boost/type_traits/detail/type_trait_def.hpp b/include/boost/type_traits/detail/type_trait_def.hpp deleted file mode 100644 index bc54696..0000000 --- a/include/boost/type_traits/detail/type_trait_def.hpp +++ /dev/null @@ -1,67 +0,0 @@ - -// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION - -// Copyright Aleksey Gurtovoy 2002-2004 -// -// 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) - -// $Source$ -// $Date$ -// $Revision$ - -#include -#include - -#define BOOST_TT_AUX_TYPE_TRAIT_DEF1(trait,T,result) \ -template< typename T > struct trait \ -{ \ -public:\ - typedef result type; \ - BOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(T)) \ -}; \ -\ -BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) \ -/**/ - -#define BOOST_TT_AUX_TYPE_TRAIT_SPEC1(trait,spec,result) \ -template<> struct trait \ -{ \ -public:\ - typedef result type; \ - BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,trait,(spec)) \ -}; \ -/**/ - -#define BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(trait,spec,result) \ -template<> struct trait##_impl \ -{ \ -public:\ - typedef result type; \ -}; \ -/**/ - -#define BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(param,trait,spec,result) \ -template< param > struct trait \ -{ \ -public:\ - typedef result type; \ -}; \ -/**/ - -#define BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(param1,param2,trait,spec,result) \ -template< param1, param2 > struct trait \ -{ \ -public:\ - typedef result; \ -}; \ -/**/ - -#define BOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1(param,trait,spec,result) \ -template< param > struct trait##_impl \ -{ \ -public:\ - typedef result type; \ -}; \ -/**/ diff --git a/include/boost/type_traits/detail/type_trait_undef.hpp b/include/boost/type_traits/detail/type_trait_undef.hpp deleted file mode 100644 index d8edf66..0000000 --- a/include/boost/type_traits/detail/type_trait_undef.hpp +++ /dev/null @@ -1,19 +0,0 @@ - -// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION - -// Copyright Aleksey Gurtovoy 2002-2004 -// -// 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) - -// $Source$ -// $Date$ -// $Revision$ - -#undef BOOST_TT_AUX_TYPE_TRAIT_DEF1 -#undef BOOST_TT_AUX_TYPE_TRAIT_SPEC1 -#undef BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1 -#undef BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1 -#undef BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2 -#undef BOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1 diff --git a/include/boost/type_traits/detail/wrap.hpp b/include/boost/type_traits/detail/wrap.hpp deleted file mode 100644 index d0a75d0..0000000 --- a/include/boost/type_traits/detail/wrap.hpp +++ /dev/null @@ -1,18 +0,0 @@ -// (C) Copyright David Abrahams 2002. -// 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_DETAIL_WRAP_HPP_INCLUDED -#define BOOST_TT_DETAIL_WRAP_HPP_INCLUDED - -namespace boost { -namespace type_traits { - -template struct wrap {}; - -}} // namespace boost::type_traits - -#endif // BOOST_TT_DETAIL_WRAP_HPP_INCLUDED diff --git a/include/boost/type_traits/extent.hpp b/include/boost/type_traits/extent.hpp index c41f7f2..dfb3c54 100644 --- a/include/boost/type_traits/extent.hpp +++ b/include/boost/type_traits/extent.hpp @@ -10,8 +10,8 @@ #ifndef BOOST_TT_EXTENT_HPP_INCLUDED #define BOOST_TT_EXTENT_HPP_INCLUDED -// should be the last #include -#include +#include +#include namespace boost { @@ -131,11 +131,8 @@ template struct extent : public ::boost::integral_constant::value> { - BOOST_MPL_AUX_LAMBDA_SUPPORT(1,extent,(T)) }; } // namespace boost -#include - #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/floating_point_promotion.hpp b/include/boost/type_traits/floating_point_promotion.hpp index 8b6ae3a..993e14e 100644 --- a/include/boost/type_traits/floating_point_promotion.hpp +++ b/include/boost/type_traits/floating_point_promotion.hpp @@ -6,86 +6,15 @@ #ifndef FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED #define FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED -#include - -#ifdef BOOST_NO_CV_SPECIALIZATIONS -#include -#include -#include -#include -#include -#include -#endif - -// 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; }; -#ifndef BOOST_NO_CV_SPECIALIZATIONS - -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; -}; - -#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( - 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/has_bit_and.hpp b/include/boost/type_traits/has_bit_and.hpp index ee3307f..a16c71a 100644 --- a/include/boost/type_traits/has_bit_and.hpp +++ b/include/boost/type_traits/has_bit_and.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_bit_and #define BOOST_TT_TRAIT_OP & #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + ( \ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_bit_and_assign.hpp b/include/boost/type_traits/has_bit_and_assign.hpp index 5b3112a..01e25e3 100644 --- a/include/boost/type_traits/has_bit_and_assign.hpp +++ b/include/boost/type_traits/has_bit_and_assign.hpp @@ -12,38 +12,38 @@ #define BOOST_TT_TRAIT_NAME has_bit_and_assign #define BOOST_TT_TRAIT_OP &= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + (\ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_const< Lhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_bit_or.hpp b/include/boost/type_traits/has_bit_or.hpp index 922b4ce..6e76929 100644 --- a/include/boost/type_traits/has_bit_or.hpp +++ b/include/boost/type_traits/has_bit_or.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_bit_or #define BOOST_TT_TRAIT_OP | #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + ( \ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_bit_or_assign.hpp b/include/boost/type_traits/has_bit_or_assign.hpp index 5481b92..891c39c 100644 --- a/include/boost/type_traits/has_bit_or_assign.hpp +++ b/include/boost/type_traits/has_bit_or_assign.hpp @@ -12,38 +12,38 @@ #define BOOST_TT_TRAIT_NAME has_bit_or_assign #define BOOST_TT_TRAIT_OP |= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + ( \ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_const< Lhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_bit_xor.hpp b/include/boost/type_traits/has_bit_xor.hpp index 883dcf6..05173ac 100644 --- a/include/boost/type_traits/has_bit_xor.hpp +++ b/include/boost/type_traits/has_bit_xor.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_bit_xor #define BOOST_TT_TRAIT_OP ^ #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + ( \ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_bit_xor_assign.hpp b/include/boost/type_traits/has_bit_xor_assign.hpp index e2767cc..3866b7a 100644 --- a/include/boost/type_traits/has_bit_xor_assign.hpp +++ b/include/boost/type_traits/has_bit_xor_assign.hpp @@ -12,38 +12,38 @@ #define BOOST_TT_TRAIT_NAME has_bit_xor_assign #define BOOST_TT_TRAIT_OP ^= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + ( \ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_const< Lhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_complement.hpp b/include/boost/type_traits/has_complement.hpp index dafd9f5..d323e12 100644 --- a/include/boost/type_traits/has_complement.hpp +++ b/include/boost/type_traits/has_complement.hpp @@ -12,15 +12,15 @@ #define BOOST_TT_TRAIT_NAME has_complement #define BOOST_TT_TRAIT_OP ~ #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* pointer */\ - ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value || \ /* fundamental non integral */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_noref >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value + (\ + ::boost::is_fundamental< Rhs_noref >::value && \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_dereference.hpp b/include/boost/type_traits/has_dereference.hpp index fe48e11..1e514cd 100644 --- a/include/boost/type_traits/has_dereference.hpp +++ b/include/boost/type_traits/has_dereference.hpp @@ -13,13 +13,13 @@ #define BOOST_TT_TRAIT_OP * #define BOOST_TT_FORBIDDEN_IF\ /* void* or fundamental */\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ + (\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ ::boost::is_void< Rhs_noptr >::value\ - >::value,\ + ) || \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value + ) #include diff --git a/include/boost/type_traits/has_divides.hpp b/include/boost/type_traits/has_divides.hpp index 277c2da..869e907 100644 --- a/include/boost/type_traits/has_divides.hpp +++ b/include/boost/type_traits/has_divides.hpp @@ -13,22 +13,22 @@ #define BOOST_TT_TRAIT_OP / #define BOOST_TT_FORBIDDEN_IF\ /* pointer with pointer or fundamental */\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ( \ + ::boost::is_fundamental< Rhs_nocv >::value || \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value,\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + )\ + )||\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + ( \ + ::boost::is_fundamental< Lhs_nocv >::value || \ ::boost::is_pointer< Lhs_noref >::value\ - >::value\ - >::value\ - >::value + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_divides_assign.hpp b/include/boost/type_traits/has_divides_assign.hpp index b21a05a..1a8e3c1 100644 --- a/include/boost/type_traits/has_divides_assign.hpp +++ b/include/boost/type_traits/has_divides_assign.hpp @@ -12,30 +12,30 @@ #define BOOST_TT_TRAIT_NAME has_divides_assign #define BOOST_TT_TRAIT_OP /= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Lhs==const and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_const< Lhs_noref >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_const< Lhs_noref >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs==pointer and (Rhs==fundamental or Rhs==pointer) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ( \ + ::boost::is_fundamental< Rhs_nocv >::value || \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value,\ + )\ + )||\ /* Rhs==pointer and (Lhs==fundamental or Lhs==pointer) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + ( \ + ::boost::is_fundamental< Lhs_nocv >::value || \ ::boost::is_pointer< Lhs_noref >::value\ - >::value\ - >::value\ - >::value + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_equal_to.hpp b/include/boost/type_traits/has_equal_to.hpp index c2245c2..d80a55d 100644 --- a/include/boost/type_traits/has_equal_to.hpp +++ b/include/boost/type_traits/has_equal_to.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_equal_to #define BOOST_TT_TRAIT_OP == #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==pointer and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Rhs==pointer and Lhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ ::boost::is_fundamental< Lhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_not<\ - ::boost::type_traits::ice_or<\ - ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value,\ - ::boost::is_same< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_void< Lhs_noptr >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_pointer< Rhs_noref >::value && \ + (! \ + (\ + ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \ + ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_void< Lhs_noptr >::value || \ ::boost::is_void< Rhs_noptr >::value\ - >::value\ - >::value\ - >::value\ - >::value + )\ + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_greater.hpp b/include/boost/type_traits/has_greater.hpp index ce32658..32e0a12 100644 --- a/include/boost/type_traits/has_greater.hpp +++ b/include/boost/type_traits/has_greater.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_greater #define BOOST_TT_TRAIT_OP > #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==pointer and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Rhs==pointer and Lhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ ::boost::is_fundamental< Lhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_not<\ - ::boost::type_traits::ice_or<\ - ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value,\ - ::boost::is_same< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_void< Lhs_noptr >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_pointer< Rhs_noref >::value && \ + (! \ + ( \ + ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \ + ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_void< Lhs_noptr >::value || \ ::boost::is_void< Rhs_noptr >::value\ - >::value\ - >::value\ - >::value\ - >::value + )\ + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_greater_equal.hpp b/include/boost/type_traits/has_greater_equal.hpp index 681685a..a933a6b 100644 --- a/include/boost/type_traits/has_greater_equal.hpp +++ b/include/boost/type_traits/has_greater_equal.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_greater_equal #define BOOST_TT_TRAIT_OP >= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==pointer and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Rhs==pointer and Lhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ ::boost::is_fundamental< Lhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_not<\ - ::boost::type_traits::ice_or<\ - ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value,\ - ::boost::is_same< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_void< Lhs_noptr >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_pointer< Rhs_noref >::value && \ + (! \ + ( \ + ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \ + ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_void< Lhs_noptr >::value || \ ::boost::is_void< Rhs_noptr >::value\ - >::value\ - >::value\ - >::value\ - >::value + )\ + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_left_shift.hpp b/include/boost/type_traits/has_left_shift.hpp index 88205d9..e95c12a 100644 --- a/include/boost/type_traits/has_left_shift.hpp +++ b/include/boost/type_traits/has_left_shift.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_left_shift #define BOOST_TT_TRAIT_OP << #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + ( \ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_left_shift_assign.hpp b/include/boost/type_traits/has_left_shift_assign.hpp index 0b3b9b1..74e0df9 100644 --- a/include/boost/type_traits/has_left_shift_assign.hpp +++ b/include/boost/type_traits/has_left_shift_assign.hpp @@ -12,38 +12,38 @@ #define BOOST_TT_TRAIT_NAME has_left_shift_assign #define BOOST_TT_TRAIT_OP <<= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + ( \ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_const< Lhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_less.hpp b/include/boost/type_traits/has_less.hpp index e1a045e..0eefcd2 100644 --- a/include/boost/type_traits/has_less.hpp +++ b/include/boost/type_traits/has_less.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_less #define BOOST_TT_TRAIT_OP < #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==pointer and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Rhs==pointer and Lhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ ::boost::is_fundamental< Lhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_not<\ - ::boost::type_traits::ice_or<\ - ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value,\ - ::boost::is_same< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_void< Lhs_noptr >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_pointer< Rhs_noref >::value && \ + (! \ + ( \ + ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \ + ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_void< Lhs_noptr >::value || \ ::boost::is_void< Rhs_noptr >::value\ - >::value\ - >::value\ - >::value\ - >::value + )\ + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_less_equal.hpp b/include/boost/type_traits/has_less_equal.hpp index c633b8b..4725bbd 100644 --- a/include/boost/type_traits/has_less_equal.hpp +++ b/include/boost/type_traits/has_less_equal.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_less_equal #define BOOST_TT_TRAIT_OP <= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==pointer and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Rhs==pointer and Lhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ ::boost::is_fundamental< Lhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_not<\ - ::boost::type_traits::ice_or<\ - ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value,\ - ::boost::is_same< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_void< Lhs_noptr >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_pointer< Rhs_noref >::value && \ + (! \ + ( \ + ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \ + ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_void< Lhs_noptr >::value || \ ::boost::is_void< Rhs_noptr >::value\ - >::value\ - >::value\ - >::value\ - >::value + )\ + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_logical_and.hpp b/include/boost/type_traits/has_logical_and.hpp index 5bfa1c3..3bb1733 100644 --- a/include/boost/type_traits/has_logical_and.hpp +++ b/include/boost/type_traits/has_logical_and.hpp @@ -13,22 +13,22 @@ #define BOOST_TT_TRAIT_OP && #define BOOST_TT_FORBIDDEN_IF\ /* pointer with fundamental non convertible to bool */\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_not< ::boost::is_convertible< Rhs_nocv, bool >::value >::value\ - >::value\ - >::value,\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::type_traits::ice_not< ::boost::is_convertible< Lhs_nocv, bool >::value >::value\ - >::value\ - >::value\ - >::value + (\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ( \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + (! ::boost::is_convertible< Rhs_nocv, bool >::value )\ + )\ + )||\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + ( \ + ::boost::is_fundamental< Lhs_nocv >::value && \ + (! ::boost::is_convertible< Lhs_nocv, bool >::value )\ + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_logical_or.hpp b/include/boost/type_traits/has_logical_or.hpp index a4ae6c5..a188726 100644 --- a/include/boost/type_traits/has_logical_or.hpp +++ b/include/boost/type_traits/has_logical_or.hpp @@ -13,22 +13,22 @@ #define BOOST_TT_TRAIT_OP || #define BOOST_TT_FORBIDDEN_IF\ /* pointer with fundamental non convertible to bool */\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_not< ::boost::is_convertible< Rhs_nocv, bool >::value >::value\ - >::value\ - >::value,\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::type_traits::ice_not< ::boost::is_convertible< Lhs_nocv, bool >::value >::value\ - >::value\ - >::value\ - >::value + (\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ + (! ::boost::is_convertible< Rhs_nocv, bool >::value )\ + )\ + )||\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + (! ::boost::is_convertible< Lhs_nocv, bool >::value )\ + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_minus.hpp b/include/boost/type_traits/has_minus.hpp index cc1d06b..5e13c16 100644 --- a/include/boost/type_traits/has_minus.hpp +++ b/include/boost/type_traits/has_minus.hpp @@ -12,43 +12,43 @@ #define BOOST_TT_TRAIT_NAME has_minus #define BOOST_TT_TRAIT_OP - #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==pointer and Rhs==fundamental and Rhs!=integral */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + (! ::boost::is_integral< Rhs_noref >::value )\ + ) || \ /* Lhs==void* and (Rhs==fundamental or Rhs==pointer) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_void< Lhs_noptr >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_void< Lhs_noptr >::value && \ + ( \ + ::boost::is_fundamental< Rhs_nocv >::value || \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value,\ + )\ + ) || \ /* Rhs==void* and (Lhs==fundamental or Lhs==pointer) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::is_void< Rhs_noptr >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + ::boost::is_void< Rhs_noptr >::value && \ + (\ + ::boost::is_fundamental< Lhs_nocv >::value || \ ::boost::is_pointer< Lhs_noref >::value\ - >::value\ - >::value,\ + )\ + ) ||\ /* Lhs=fundamental and Rhs=pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + ) ||\ /* two different pointers */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_not< ::boost::is_same< Lhs_nocv, Rhs_nocv >::value >::value\ - >::value\ - >::value + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_pointer< Rhs_noref >::value && \ + (! ::boost::is_same< Lhs_nocv, Rhs_nocv >::value )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_minus_assign.hpp b/include/boost/type_traits/has_minus_assign.hpp index 84ba359..b53474e 100644 --- a/include/boost/type_traits/has_minus_assign.hpp +++ b/include/boost/type_traits/has_minus_assign.hpp @@ -12,48 +12,48 @@ #define BOOST_TT_TRAIT_NAME has_minus_assign #define BOOST_TT_TRAIT_OP -= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==pointer and Rhs==fundamental and Rhs!=integral */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + (! ::boost::is_integral< Rhs_noref >::value )\ + ) || \ /* Lhs==void* and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_void< Lhs_noptr >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_void< Lhs_noptr >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Rhs==void* and Lhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::is_void< Rhs_noptr >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + ::boost::is_void< Rhs_noptr >::value && \ ::boost::is_fundamental< Lhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs=fundamental and Rhs=pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + ) || \ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + ) || \ /* (Lhs==fundamental or Lhs==pointer) and (Rhs==fundamental or Rhs==pointer) and (Lhs==const) */\ - ::boost::type_traits::ice_and<\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value || \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + ) && \ + (\ + ::boost::is_fundamental< Rhs_nocv >::value || \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + ) && \ ::boost::is_const< Lhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_modulus.hpp b/include/boost/type_traits/has_modulus.hpp index 6948728..24a815f 100644 --- a/include/boost/type_traits/has_modulus.hpp +++ b/include/boost/type_traits/has_modulus.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_modulus #define BOOST_TT_TRAIT_OP % #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + (\ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_modulus_assign.hpp b/include/boost/type_traits/has_modulus_assign.hpp index f0531f0..5e3e83f 100644 --- a/include/boost/type_traits/has_modulus_assign.hpp +++ b/include/boost/type_traits/has_modulus_assign.hpp @@ -12,38 +12,38 @@ #define BOOST_TT_TRAIT_NAME has_modulus_assign #define BOOST_TT_TRAIT_OP %= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + ( \ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_const< Lhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_multiplies.hpp b/include/boost/type_traits/has_multiplies.hpp index 4b578c5..591a0ce 100644 --- a/include/boost/type_traits/has_multiplies.hpp +++ b/include/boost/type_traits/has_multiplies.hpp @@ -13,22 +13,22 @@ #define BOOST_TT_TRAIT_OP * #define BOOST_TT_FORBIDDEN_IF\ /* pointer with pointer or fundamental */\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + (\ + ::boost::is_fundamental< Rhs_nocv >::value || \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value,\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + )\ + )||\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + (\ + ::boost::is_fundamental< Lhs_nocv >::value || \ ::boost::is_pointer< Lhs_noref >::value\ - >::value\ - >::value\ - >::value + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_multiplies_assign.hpp b/include/boost/type_traits/has_multiplies_assign.hpp index 1678b7b..b24f879 100644 --- a/include/boost/type_traits/has_multiplies_assign.hpp +++ b/include/boost/type_traits/has_multiplies_assign.hpp @@ -12,30 +12,30 @@ #define BOOST_TT_TRAIT_NAME has_multiplies_assign #define BOOST_TT_TRAIT_OP *= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Lhs==const and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_const< Lhs_noref >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_const< Lhs_noref >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs==pointer and (Rhs==fundamental or Rhs==pointer) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ( \ + ::boost::is_fundamental< Rhs_nocv >::value || \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value,\ + )\ + )||\ /* Rhs==pointer and (Lhs==fundamental or Lhs==pointer) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + ( \ + ::boost::is_fundamental< Lhs_nocv >::value || \ ::boost::is_pointer< Lhs_noref >::value\ - >::value\ - >::value\ - >::value + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_new_operator.hpp b/include/boost/type_traits/has_new_operator.hpp index c615127..4def872 100644 --- a/include/boost/type_traits/has_new_operator.hpp +++ b/include/boost/type_traits/has_new_operator.hpp @@ -11,12 +11,9 @@ #include // std::nothrow_t #include // std::size_t -#include +#include #include -#include - -// should be the last #include -#include +#include #if defined(new) # if BOOST_WORKAROUND(BOOST_MSVC, >= 1310) @@ -129,19 +126,17 @@ namespace detail { #endif #endif BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - (s1 == sizeof(type_traits::yes_type)), - (s2 == sizeof(type_traits::yes_type)), - (s3 == sizeof(type_traits::yes_type)), - (s4 == sizeof(type_traits::yes_type)), - (s5 == sizeof(type_traits::yes_type)), + (s1 == sizeof(type_traits::yes_type)) || + (s2 == sizeof(type_traits::yes_type)) || + (s3 == sizeof(type_traits::yes_type)) || + (s4 == sizeof(type_traits::yes_type)) || + (s5 == sizeof(type_traits::yes_type)) || (s6 == sizeof(type_traits::yes_type)) - >::value) ); }; } // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_new_operator,T,::boost::detail::has_new_operator_impl::value) +template struct has_new_operator : public integral_constant::value>{}; } // namespace boost @@ -149,6 +144,4 @@ BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_new_operator,T,::boost::detail::has_new_operato # pragma pop_macro("new") #endif -#include - #endif // BOOST_TT_HAS_NEW_OPERATOR_HPP_INCLUDED diff --git a/include/boost/type_traits/has_not_equal_to.hpp b/include/boost/type_traits/has_not_equal_to.hpp index e7e3700..c2b6705 100644 --- a/include/boost/type_traits/has_not_equal_to.hpp +++ b/include/boost/type_traits/has_not_equal_to.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_not_equal_to #define BOOST_TT_TRAIT_OP != #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==pointer and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Rhs==pointer and Lhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ ::boost::is_fundamental< Lhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_not<\ - ::boost::type_traits::ice_or<\ - ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value,\ - ::boost::is_same< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_void< Lhs_noptr >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_pointer< Rhs_noref >::value && \ + (! \ + (\ + ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \ + ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_void< Lhs_noptr >::value || \ ::boost::is_void< Rhs_noptr >::value\ - >::value\ - >::value\ - >::value\ - >::value + )\ + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_nothrow_assign.hpp b/include/boost/type_traits/has_nothrow_assign.hpp index 83e5968..eb542f9 100644 --- a/include/boost/type_traits/has_nothrow_assign.hpp +++ b/include/boost/type_traits/has_nothrow_assign.hpp @@ -9,36 +9,38 @@ #ifndef BOOST_TT_HAS_NOTHROW_ASSIGN_HPP_INCLUDED #define BOOST_TT_HAS_NOTHROW_ASSIGN_HPP_INCLUDED -#include +#include +#include -// should be the last #include -#include +#if !defined(BOOST_HAS_NOTHROW_ASSIGN) || defined(BOOST_MSVC) || defined(BOOST_INTEL) +#include +#endif +#if defined(__GNUC__) +#include +#include +#ifdef BOOST_INTEL +#include +#endif +#endif namespace boost { -namespace detail{ - template -struct has_nothrow_assign_imp{ +struct has_nothrow_assign : public integral_constant::value); + ::boost::has_trivial_assign::value #else - BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_NOTHROW_ASSIGN(T)); + BOOST_HAS_NOTHROW_ASSIGN(T) #endif -}; +>{}; -} - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_assign,T,::boost::detail::has_nothrow_assign_imp::value) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void,false) +template <> struct has_nothrow_assign : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void volatile,false) +template <> struct has_nothrow_assign : public false_type{}; +template <> struct has_nothrow_assign : public false_type{}; +template <> struct has_nothrow_assign : public false_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_HAS_NOTHROW_ASSIGN_HPP_INCLUDED diff --git a/include/boost/type_traits/has_nothrow_constructor.hpp b/include/boost/type_traits/has_nothrow_constructor.hpp index 3bc4f80..f176c0f 100644 --- a/include/boost/type_traits/has_nothrow_constructor.hpp +++ b/include/boost/type_traits/has_nothrow_constructor.hpp @@ -9,45 +9,38 @@ #ifndef BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED #define BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED -#include +#include +#include -// should be the last #include -#include +#ifdef BOOST_HAS_NOTHROW_CONSTRUCTOR + +#if defined(BOOST_MSVC) || defined(BOOST_INTEL) +#include +#endif namespace boost { -namespace detail{ +template struct has_nothrow_constructor : public integral_constant{}; -template -struct has_nothrow_constructor_imp{ -#ifdef BOOST_HAS_NOTHROW_CONSTRUCTOR - BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_NOTHROW_CONSTRUCTOR(T)); #else - BOOST_STATIC_CONSTANT(bool, value = ::boost::has_trivial_constructor::value); + +#include + +namespace boost { + +template struct has_nothrow_constructor : public ::boost::has_trivial_constructor {}; + #endif -}; -} - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_constructor,T,::boost::detail::has_nothrow_constructor_imp::value) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_default_constructor,T,::boost::detail::has_nothrow_constructor_imp::value) - -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void,false) +template<> struct has_nothrow_constructor : public false_type {}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void volatile,false) +template<> struct has_nothrow_constructor : public false_type{}; +template<> struct has_nothrow_constructor : public false_type{}; +template<> struct has_nothrow_constructor : public false_type{}; #endif -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void,false) -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void volatile,false) -#endif +template struct has_nothrow_default_constructor : public has_nothrow_constructor{}; } // namespace boost -#include - #endif // BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED diff --git a/include/boost/type_traits/has_nothrow_copy.hpp b/include/boost/type_traits/has_nothrow_copy.hpp index 9c3c903..bbfcb1d 100644 --- a/include/boost/type_traits/has_nothrow_copy.hpp +++ b/include/boost/type_traits/has_nothrow_copy.hpp @@ -9,45 +9,44 @@ #ifndef BOOST_TT_HAS_NOTHROW_COPY_HPP_INCLUDED #define BOOST_TT_HAS_NOTHROW_COPY_HPP_INCLUDED -#include +#include +#include -// should be the last #include -#include +#ifdef BOOST_HAS_NOTHROW_COPY + +#if defined(BOOST_CLANG) || defined(__GNUC__) || defined(__ghs__) || defined(__CODEGEARC__) +#include +#include +#ifdef BOOST_INTEL +#include +#endif +#elif defined(BOOST_MSVC) || defined(BOOST_INTEL) +#include +#endif namespace boost { -namespace detail{ +template struct has_nothrow_copy_constructor : public integral_constant{}; -template -struct has_nothrow_copy_imp{ -#ifdef BOOST_HAS_NOTHROW_COPY - BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_NOTHROW_COPY(T)); #else - BOOST_STATIC_CONSTANT(bool, value = ::boost::has_trivial_copy::value); + +#include + +namespace boost{ + +template struct has_nothrow_copy_constructor : public integral_constant::value>{}; + #endif -}; -} - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_copy,T,::boost::detail::has_nothrow_copy_imp::value) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_copy_constructor,T,::boost::detail::has_nothrow_copy_imp::value) - -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void,false) +template <> struct has_nothrow_copy_constructor : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void volatile,false) +template <> struct has_nothrow_copy_constructor : public false_type{}; +template <> struct has_nothrow_copy_constructor : public false_type{}; +template <> struct has_nothrow_copy_constructor : public false_type{}; #endif -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void,false) -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void volatile,false) -#endif +template struct has_nothrow_copy : public has_nothrow_copy_constructor{}; } // namespace boost -#include - #endif // BOOST_TT_HAS_NOTHROW_COPY_HPP_INCLUDED diff --git a/include/boost/type_traits/has_nothrow_destructor.hpp b/include/boost/type_traits/has_nothrow_destructor.hpp index 4f5882a..e510ece 100644 --- a/include/boost/type_traits/has_nothrow_destructor.hpp +++ b/include/boost/type_traits/has_nothrow_destructor.hpp @@ -11,15 +11,10 @@ #include -// should be the last #include -#include - namespace boost { -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_destructor,T,::boost::has_trivial_destructor::value) +template struct has_nothrow_destructor : public ::boost::has_trivial_destructor {}; } // namespace boost -#include - #endif // BOOST_TT_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED diff --git a/include/boost/type_traits/has_plus.hpp b/include/boost/type_traits/has_plus.hpp index 70c1200..2d79328 100644 --- a/include/boost/type_traits/has_plus.hpp +++ b/include/boost/type_traits/has_plus.hpp @@ -12,37 +12,37 @@ #define BOOST_TT_TRAIT_NAME has_plus #define BOOST_TT_TRAIT_OP + #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + ) || \ /* Lhs==void* and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_void< Lhs_noptr >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_void< Lhs_noptr >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Rhs==void* and Lhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::is_void< Rhs_noptr >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + ::boost::is_void< Rhs_noptr >::value && \ ::boost::is_fundamental< Lhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs==pointer and Rhs==fundamental and Rhs!=integral */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + (! ::boost::is_integral< Rhs_noref >::value )\ + ) || \ /* Rhs==pointer and Lhs==fundamental and Lhs!=integral */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value\ - >::value\ - >::value + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + ::boost::is_fundamental< Lhs_nocv >::value && \ + (! ::boost::is_integral< Lhs_noref >::value )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_plus_assign.hpp b/include/boost/type_traits/has_plus_assign.hpp index 6d65204..5ef6f23 100644 --- a/include/boost/type_traits/has_plus_assign.hpp +++ b/include/boost/type_traits/has_plus_assign.hpp @@ -12,49 +12,49 @@ #define BOOST_TT_TRAIT_NAME has_plus_assign #define BOOST_TT_TRAIT_OP += #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + ) || \ /* Lhs==void* and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_void< Lhs_noptr >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_void< Lhs_noptr >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Rhs==void* and Lhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::is_void< Rhs_noptr >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + ::boost::is_void< Rhs_noptr >::value && \ ::boost::is_fundamental< Lhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs==pointer and Rhs==fundamental and Rhs!=integral */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + (! ::boost::is_integral< Rhs_noref >::value )\ + ) || \ /* Rhs==pointer and Lhs==fundamental and Lhs!=bool */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::type_traits::ice_not< ::boost::is_same< Lhs_nocv, bool >::value >::value\ - >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + ::boost::is_fundamental< Lhs_nocv >::value && \ + (! ::boost::is_same< Lhs_nocv, bool >::value )\ + ) || \ /* (Lhs==fundamental or Lhs==pointer) and (Rhs==fundamental or Rhs==pointer) and (Lhs==const) */\ - ::boost::type_traits::ice_and<\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value || \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + ) && \ + ( \ + ::boost::is_fundamental< Rhs_nocv >::value || \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + ) && \ ::boost::is_const< Lhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_post_decrement.hpp b/include/boost/type_traits/has_post_decrement.hpp index 024acb0..e3f98ff 100644 --- a/include/boost/type_traits/has_post_decrement.hpp +++ b/include/boost/type_traits/has_post_decrement.hpp @@ -14,25 +14,25 @@ #define BOOST_TT_TRAIT_NAME has_post_decrement #define BOOST_TT_TRAIT_OP -- #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* bool */\ - ::boost::is_same< bool, Lhs_nocv >::value,\ + ::boost::is_same< bool, Lhs_nocv >::value || \ /* void* */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_void< Lhs_noptr >::value\ - >::value,\ + ) || \ /* (fundamental or pointer) and const */\ - ::boost::type_traits::ice_and<\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ( \ + ::boost::is_fundamental< Lhs_nocv >::value || \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + ) && \ ::boost::is_const< Lhs_noref >::value\ - >::value,\ + )||\ /* Arrays */ \ ::boost::is_array::value\ - >::value + ) #include diff --git a/include/boost/type_traits/has_post_increment.hpp b/include/boost/type_traits/has_post_increment.hpp index b055607..3861a2b 100644 --- a/include/boost/type_traits/has_post_increment.hpp +++ b/include/boost/type_traits/has_post_increment.hpp @@ -14,25 +14,25 @@ #define BOOST_TT_TRAIT_NAME has_post_increment #define BOOST_TT_TRAIT_OP ++ #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* bool */\ - ::boost::is_same< bool, Lhs_nocv >::value,\ + ::boost::is_same< bool, Lhs_nocv >::value || \ /* void* */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_void< Lhs_noptr >::value\ - >::value,\ + ) || \ /* (fundamental or pointer) and const */\ - ::boost::type_traits::ice_and<\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ( \ + ::boost::is_fundamental< Lhs_nocv >::value || \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + ) && \ ::boost::is_const< Lhs_noref >::value\ - >::value,\ + )||\ /* Arrays */ \ ::boost::is_array::value\ - >::value + ) #include diff --git a/include/boost/type_traits/has_pre_decrement.hpp b/include/boost/type_traits/has_pre_decrement.hpp index feb3d9d..7ef0783 100644 --- a/include/boost/type_traits/has_pre_decrement.hpp +++ b/include/boost/type_traits/has_pre_decrement.hpp @@ -14,25 +14,25 @@ #define BOOST_TT_TRAIT_NAME has_pre_decrement #define BOOST_TT_TRAIT_OP -- #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* bool */\ - ::boost::is_same< bool, Rhs_nocv >::value,\ + ::boost::is_same< bool, Rhs_nocv >::value || \ /* void* */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ ::boost::is_void< Rhs_noptr >::value\ - >::value,\ + ) || \ /* (fundamental or pointer) and const */\ - ::boost::type_traits::ice_and<\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ( \ + ::boost::is_fundamental< Rhs_nocv >::value || \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + ) && \ ::boost::is_const< Rhs_noref >::value\ - >::value,\ + )||\ /* Arrays */ \ ::boost::is_array::value\ - >::value + ) #include diff --git a/include/boost/type_traits/has_pre_increment.hpp b/include/boost/type_traits/has_pre_increment.hpp index 6a2411d..c4c9734 100644 --- a/include/boost/type_traits/has_pre_increment.hpp +++ b/include/boost/type_traits/has_pre_increment.hpp @@ -14,25 +14,25 @@ #define BOOST_TT_TRAIT_NAME has_pre_increment #define BOOST_TT_TRAIT_OP ++ #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* bool */\ - ::boost::is_same< bool, Rhs_nocv >::value,\ + ::boost::is_same< bool, Rhs_nocv >::value || \ /* void* */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ ::boost::is_void< Rhs_noptr >::value\ - >::value,\ + ) || \ /* (fundamental or pointer) and const */\ - ::boost::type_traits::ice_and<\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ( \ + ::boost::is_fundamental< Rhs_nocv >::value || \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + ) && \ ::boost::is_const< Rhs_noref >::value\ - >::value,\ + )||\ /* Arrays */ \ ::boost::is_array::value\ - >::value + ) #include diff --git a/include/boost/type_traits/has_right_shift.hpp b/include/boost/type_traits/has_right_shift.hpp index 5735870..5562911 100644 --- a/include/boost/type_traits/has_right_shift.hpp +++ b/include/boost/type_traits/has_right_shift.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_right_shift #define BOOST_TT_TRAIT_OP >> #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + ( \ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_right_shift_assign.hpp b/include/boost/type_traits/has_right_shift_assign.hpp index 0536e71..0e2c263 100644 --- a/include/boost/type_traits/has_right_shift_assign.hpp +++ b/include/boost/type_traits/has_right_shift_assign.hpp @@ -12,38 +12,38 @@ #define BOOST_TT_TRAIT_NAME has_right_shift_assign #define BOOST_TT_TRAIT_OP >>= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + ( \ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_const< Lhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_trivial_assign.hpp b/include/boost/type_traits/has_trivial_assign.hpp index 404b62c..ea9ccf7 100644 --- a/include/boost/type_traits/has_trivial_assign.hpp +++ b/include/boost/type_traits/has_trivial_assign.hpp @@ -9,49 +9,34 @@ #ifndef BOOST_TT_HAS_TRIVIAL_ASSIGN_HPP_INCLUDED #define BOOST_TT_HAS_TRIVIAL_ASSIGN_HPP_INCLUDED -#include +#include #include +#include + +#if !defined(BOOST_HAS_TRIVIAL_ASSIGN) || defined(BOOST_MSVC) || defined(__GNUC__) || defined(BOOST_INTEL) #include #include #include -#include -#include -#include - -// should be the last #include -#include +#endif namespace boost { -namespace detail { - template -struct has_trivial_assign_impl -{ +struct has_trivial_assign : public integral_constant::value, - ::boost::type_traits::ice_not< ::boost::is_const::value >::value, - ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value - >::value)); + ::boost::is_pod::value && !::boost::is_const::value && !::boost::is_volatile::value #endif -}; + > {}; -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_assign,T,::boost::detail::has_trivial_assign_impl::value) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void,false) +template<> struct has_trivial_assign : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void volatile,false) +template<> struct has_trivial_assign : public false_type{}; +template<> struct has_trivial_assign : public false_type{}; +template<> struct has_trivial_assign : public false_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_HAS_TRIVIAL_ASSIGN_HPP_INCLUDED diff --git a/include/boost/type_traits/has_trivial_constructor.hpp b/include/boost/type_traits/has_trivial_constructor.hpp index 30dbdd8..24e581d 100644 --- a/include/boost/type_traits/has_trivial_constructor.hpp +++ b/include/boost/type_traits/has_trivial_constructor.hpp @@ -9,43 +9,31 @@ #ifndef BOOST_TT_HAS_TRIVIAL_CONSTRUCTOR_HPP_INCLUDED #define BOOST_TT_HAS_TRIVIAL_CONSTRUCTOR_HPP_INCLUDED -#include #include #include -#include -// should be the last #include -#include +#ifdef BOOST_HAS_TRIVIAL_CONSTRUCTOR +#ifdef BOOST_HAS_SGI_TYPE_TRAITS +#include +#elif defined(__GNUC__) +#include +#ifdef BOOST_INTEL +#include +#endif +#endif +#endif namespace boost { -namespace detail { - -template -struct has_trivial_ctor_impl -{ +template struct has_trivial_constructor #ifdef BOOST_HAS_TRIVIAL_CONSTRUCTOR - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::is_pod::value, - BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) - >::value)); + : public integral_constant ::value || BOOST_HAS_TRIVIAL_CONSTRUCTOR(T))>{}; #else - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::is_pod::value, - false - >::value)); + : public integral_constant ::value>{}; #endif -}; -} // 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) +template struct has_trivial_default_constructor : public has_trivial_constructor {}; } // namespace boost -#include - #endif // BOOST_TT_HAS_TRIVIAL_CONSTRUCTOR_HPP_INCLUDED diff --git a/include/boost/type_traits/has_trivial_copy.hpp b/include/boost/type_traits/has_trivial_copy.hpp index 1c567cf..95bf159 100644 --- a/include/boost/type_traits/has_trivial_copy.hpp +++ b/include/boost/type_traits/has_trivial_copy.hpp @@ -9,74 +9,46 @@ #ifndef BOOST_TT_HAS_TRIVIAL_COPY_HPP_INCLUDED #define BOOST_TT_HAS_TRIVIAL_COPY_HPP_INCLUDED -#include #include #include #include -#include -#include -#include +#include #ifdef __clang__ #include #endif -// should be the last #include -#include - namespace boost { -namespace detail { - -template -struct has_trivial_copy_impl -{ +template struct has_trivial_copy +: public integral_constant::value); + BOOST_HAS_TRIVIAL_COPY(T) && boost::is_copy_constructible::value # else - BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_TRIVIAL_COPY(T)); + BOOST_HAS_TRIVIAL_COPY(T) # endif #else - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - ::boost::is_pod::value, - ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value - >::value)); + ::boost::is_pod::value && ! ::boost::is_volatile::value #endif -}; +>{}; #ifdef __clang__ template -struct has_trivial_copy_impl -{ - static const bool value = has_trivial_copy_impl::value; -}; +struct has_trivial_copy : public has_trivial_copy{}; #endif -} // 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) - -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void,false) +template <> struct has_trivial_copy : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void volatile,false) +template <> struct has_trivial_copy : public false_type{}; +template <> struct has_trivial_copy : public false_type{}; +template <> struct has_trivial_copy : public false_type{}; #endif -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void,false) -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void volatile,false) -#endif +template struct has_trivial_copy_constructor : public has_trivial_copy{}; } // namespace boost -#include - #endif // BOOST_TT_HAS_TRIVIAL_COPY_HPP_INCLUDED diff --git a/include/boost/type_traits/has_trivial_destructor.hpp b/include/boost/type_traits/has_trivial_destructor.hpp index 79d7522..dc1b24c 100644 --- a/include/boost/type_traits/has_trivial_destructor.hpp +++ b/include/boost/type_traits/has_trivial_destructor.hpp @@ -9,41 +9,36 @@ #ifndef BOOST_TT_HAS_TRIVIAL_DESTRUCTOR_HPP_INCLUDED #define BOOST_TT_HAS_TRIVIAL_DESTRUCTOR_HPP_INCLUDED -#include #include -#include -#include +#include -// should be the last #include -#include +#ifdef BOOST_HAS_TRIVIAL_DESTRUCTOR + +#if defined(BOOST_INTEL) || defined(BOOST_MSVC) +#include +#endif +#ifdef BOOST_HAS_SGI_TYPE_TRAITS +#include +#endif namespace boost { -namespace detail { - -template -struct has_trivial_dtor_impl -{ -#ifdef BOOST_HAS_TRIVIAL_DESTRUCTOR - BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_TRIVIAL_DESTRUCTOR(T)); +template struct has_trivial_destructor : public integral_constant{}; #else - BOOST_STATIC_CONSTANT(bool, value = ::boost::is_pod::value); +#include + +namespace boost{ + +template struct has_trivial_destructor : public integral_constant::value>{}; #endif -}; -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_destructor,T,::boost::detail::has_trivial_dtor_impl::value) - -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void,false) +template <> struct has_trivial_destructor : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void volatile,false) +template <> struct has_trivial_destructor : public false_type{}; +template <> struct has_trivial_destructor : public false_type{}; +template <> struct has_trivial_destructor : public false_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_HAS_TRIVIAL_DESTRUCTOR_HPP_INCLUDED diff --git a/include/boost/type_traits/has_trivial_move_assign.hpp b/include/boost/type_traits/has_trivial_move_assign.hpp index db337f7..f291f6f 100644 --- a/include/boost/type_traits/has_trivial_move_assign.hpp +++ b/include/boost/type_traits/has_trivial_move_assign.hpp @@ -11,47 +11,36 @@ #ifndef BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED #define BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED -#include +#include +#include + +#if !defined(BOOST_HAS_TRIVIAL_MOVE_ASSIGN) || defined(BOOST_MSVC) || defined(BOOST_INTEL) #include #include #include -#include -#include - -// should be the last #include -#include +#ifdef BOOST_MSVC +#include +#endif +#endif namespace boost { -namespace detail { - template -struct has_trivial_move_assign_impl -{ +struct has_trivial_move_assign : public integral_constant::value, - ::boost::type_traits::ice_not< ::boost::is_const::value >::value, - ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value - >::value)); + ::boost::is_pod::value && !::boost::is_const::value && !::boost::is_volatile::value #endif -}; + > {}; -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_move_assign,T,::boost::detail::has_trivial_move_assign_impl::value) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void,false) +template <> struct has_trivial_move_assign : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void volatile,false) +template <> struct has_trivial_move_assign : public false_type{}; +template <> struct has_trivial_move_assign : public false_type{}; +template <> struct has_trivial_move_assign : public false_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED diff --git a/include/boost/type_traits/has_trivial_move_constructor.hpp b/include/boost/type_traits/has_trivial_move_constructor.hpp index a341834..2195be8 100644 --- a/include/boost/type_traits/has_trivial_move_constructor.hpp +++ b/include/boost/type_traits/has_trivial_move_constructor.hpp @@ -11,47 +11,38 @@ #ifndef BOOST_TT_HAS_TRIVIAL_MOVE_CONSTRUCTOR_HPP_INCLUDED #define BOOST_TT_HAS_TRIVIAL_MOVE_CONSTRUCTOR_HPP_INCLUDED -#include #include +#include + +#ifdef BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR + +#if defined(BOOST_MSVC) || defined(BOOST_INTEL) #include #include -#include -#include - -// should be the last #include -#include +#endif namespace boost { -namespace detail { +template struct has_trivial_move_constructor : public integral_constant{}; -template -struct has_trivial_move_ctor_impl -{ -#ifdef BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR - BOOST_STATIC_CONSTANT(bool, value = (BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T))); #else - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - ::boost::is_pod::value, - ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value - >::value)); + +#include +#include + +namespace boost { + +template struct has_trivial_move_constructor + : public integral_constant::value && !::boost::is_volatile::value>{}; #endif -}; -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_move_constructor,T,::boost::detail::has_trivial_move_ctor_impl::value) - -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_constructor,void,false) +template <> struct has_trivial_move_constructor : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_constructor,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_constructor,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_constructor,void volatile,false) +template <> struct has_trivial_move_constructor : public false_type{}; +template <> struct has_trivial_move_constructor : public false_type{}; +template <> struct has_trivial_move_constructor : public false_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_HAS_TRIVIAL_MOVE_CONSTRUCTOR_HPP_INCLUDED diff --git a/include/boost/type_traits/has_virtual_destructor.hpp b/include/boost/type_traits/has_virtual_destructor.hpp index b741197..4b0f383 100644 --- a/include/boost/type_traits/has_virtual_destructor.hpp +++ b/include/boost/type_traits/has_virtual_destructor.hpp @@ -11,19 +11,16 @@ #define BOOST_TT_HAS_VIRTUAL_DESTRUCTOR_HPP_INCLUDED #include -// should be the last #include -#include +#include namespace boost { #ifdef BOOST_HAS_VIRTUAL_DESTRUCTOR -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_virtual_destructor,T,BOOST_HAS_VIRTUAL_DESTRUCTOR(T)) + template struct has_virtual_destructor : public integral_constant{}; #else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_virtual_destructor,T,false) + template struct has_virtual_destructor : public integral_constant{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/integral_constant.hpp b/include/boost/type_traits/integral_constant.hpp index c684771..dac784f 100644 --- a/include/boost/type_traits/integral_constant.hpp +++ b/include/boost/type_traits/integral_constant.hpp @@ -1,4 +1,4 @@ -// (C) Copyright John Maddock 2005. +// (C) Copyright John Maddock 2015. // 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) @@ -7,32 +7,98 @@ #define BOOST_TYPE_TRAITS_INTEGRAL_CONSTANT_HPP #include -#include -#include +#include + +#if (BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \ + || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \ + || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) \ + || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202)) \ + || BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, BOOST_TESTED_AT(810)) ) + + +namespace boost{ + namespace mpl + { + template struct bool_; + template struct integral_c; + struct integral_c_tag; + } +} + +#else + +namespace mpl_{ + + template struct bool_; + template struct integral_c; + struct integral_c_tag; +} + +namespace boost +{ + namespace mpl + { + using ::mpl_::bool_; + using ::mpl_::integral_c; + using ::mpl_::integral_c_tag; + } +} + +#endif namespace boost{ -#if defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS) || defined(__BORLANDC__) -template -#else -template -#endif -struct integral_constant : public mpl::integral_c -{ - typedef integral_constant type; -}; + template + struct integral_constant + { + typedef mpl::integral_c_tag tag; + typedef T value_type; + typedef integral_constant type; + static const T value = val; + // + // This helper function is just to disable type-punning + // warnings from GCC: + // + template + static U& dereference(U* p) { return *p; } -template<> struct integral_constant : public mpl::true_ -{ - typedef integral_constant type; -}; -template<> struct integral_constant : public mpl::false_ -{ - typedef integral_constant type; -}; + operator const mpl::integral_c& ()const + { + static const char data[sizeof(long)] = { 0 }; + return dereference(reinterpret_cast*>(&data)); + } + BOOST_CONSTEXPR operator T()const { return val; } + }; -typedef integral_constant true_type; -typedef integral_constant false_type; + template + T const integral_constant::value; + + template + struct integral_constant + { + typedef mpl::integral_c_tag tag; + typedef integral_constant type; + static const bool value = val; + // + // This helper function is just to disable type-punning + // warnings from GCC: + // + template + static T& dereference(T* p) { return *p; } + + operator const mpl::bool_& ()const + { + static const char data = 0; + return dereference(reinterpret_cast*>(&data)); + } + BOOST_CONSTEXPR operator bool()const { return val; } + }; + + template + bool const integral_constant::value; + + typedef integral_constant true_type; + typedef integral_constant false_type; } diff --git a/include/boost/type_traits/integral_promotion.hpp b/include/boost/type_traits/integral_promotion.hpp index 9c5514b..0478f56 100644 --- a/include/boost/type_traits/integral_promotion.hpp +++ b/include/boost/type_traits/integral_promotion.hpp @@ -7,18 +7,12 @@ #define FILE_boost_type_traits_integral_promotion_hpp_INCLUDED #include - -#include -#include #include #include #include #include #include -// Should be the last #include -#include - namespace boost { namespace type_traits { namespace detail { @@ -168,27 +162,20 @@ struct integral_promotion_impl >::type type; }; -template -struct integral_promotion - : public boost::mpl::eval_if< - need_promotion::type> - , integral_promotion_impl - , boost::mpl::identity - > -{ -}; +template struct integral_promotion { typedef T type; }; +template struct integral_promotion : public integral_promotion_impl{}; } } -BOOST_TT_AUX_TYPE_TRAIT_DEF1( - integral_promotion - , T - , BOOST_DEDUCED_TYPENAME - boost::type_traits::detail::integral_promotion::type - ) -} +template struct integral_promotion +{ +private: + typedef boost::type_traits::detail::need_promotion::type> tag_type; +public: + typedef typename boost::type_traits::detail::integral_promotion::type type; +}; -#include +} #endif // #ifndef FILE_boost_type_traits_integral_promotion_hpp_INCLUDED diff --git a/include/boost/type_traits/intrinsics.hpp b/include/boost/type_traits/intrinsics.hpp index e8a87b0..4533114 100644 --- a/include/boost/type_traits/intrinsics.hpp +++ b/include/boost/type_traits/intrinsics.hpp @@ -8,8 +8,10 @@ #ifndef BOOST_TT_INTRINSICS_HPP_INCLUDED #define BOOST_TT_INTRINSICS_HPP_INCLUDED +#ifndef BOOST_TT_DISABLE_INTRINSICS + #ifndef BOOST_TT_CONFIG_HPP_INCLUDED -#include +#include #endif // @@ -44,6 +46,9 @@ // BOOST_IS_ENUM(T) true is T is an enum // BOOST_IS_POLYMORPHIC(T) true if T is a polymorphic type // BOOST_ALIGNMENT_OF(T) should evaluate to the alignment requirements of type T. +// +// define BOOST_TT_DISABLE_INTRINSICS to prevent any intrinsics being used (mostly used when testing) +// #ifdef BOOST_HAS_SGI_TYPE_TRAITS // Hook into SGI's __type_traits class, this will pick up user supplied @@ -85,9 +90,11 @@ #if (defined(BOOST_MSVC) && defined(BOOST_MSVC_FULL_VER) && (BOOST_MSVC_FULL_VER >=140050215))\ || (defined(BOOST_INTEL) && defined(_MSC_VER) && (_MSC_VER >= 1500)) -# include -# include - +// +// Note that even though these intrinsics rely on other type traits classes +// we do not #include those here as it produces cyclic dependencies and +// can cause the intrinsics to not even be used at all! +// # define BOOST_IS_UNION(T) __is_union(T) # define BOOST_IS_POD(T) (__is_pod(T) && __has_trivial_constructor(T)) # define BOOST_IS_EMPTY(T) __is_empty(T) @@ -111,8 +118,8 @@ // # define BOOST_ALIGNMENT_OF(T) __alignof(T) # if defined(_MSC_VER) && (_MSC_VER >= 1700) -# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) ((__has_trivial_move_constructor(T) || __is_pod(T)) && !::boost::is_volatile::value && !::boost::is_reference::value) -# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) ((__has_trivial_move_assign(T) || __is_pod(T)) && ! ::boost::is_const::value && !::boost::is_volatile::value && !::boost::is_reference::value) +# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) ((__has_trivial_move_constructor(T) || boost::is_pod::value) && ! ::boost::is_volatile::value && ! ::boost::is_reference::value) +# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) ((__has_trivial_move_assign(T) || boost::is_pod::value) && ! ::boost::is_const::value && !::boost::is_volatile::value && ! ::boost::is_reference::value) # endif #if _MSC_FULL_VER >= 180020827 # define BOOST_IS_NOTHROW_MOVE_ASSIGN(T) (__is_nothrow_assignable(T&, T&&)) @@ -144,10 +151,12 @@ // This is a rubbish fix as it basically stops type traits from working correctly, // but maybe the best we can do for now. See https://svn.boost.org/trac/boost/ticket/10694 // +// +// Note that even though these intrinsics rely on other type traits classes +// we do not #include those here as it produces cyclic dependencies and +// can cause the intrinsics to not even be used at all! +// # include -# include -# include -# include # if __has_feature(is_union) # define BOOST_IS_UNION(T) __is_union(T) @@ -215,9 +224,11 @@ #endif #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) && !defined(__GCCXML__))) && !defined(BOOST_CLANG) -# include -# include -# include +// +// Note that even though these intrinsics rely on other type traits classes +// we do not #include those here as it produces cyclic dependencies and +// can cause the intrinsics to not even be used at all! +// #ifdef BOOST_INTEL # define BOOST_INTEL_TT_OPTS || is_pod::value @@ -338,11 +349,7 @@ # define BOOST_HAS_TYPE_TRAITS_INTRINSICS #endif +#endif // BOOST_TT_DISABLE_INTRINSICS + #endif // BOOST_TT_INTRINSICS_HPP_INCLUDED - - - - - - diff --git a/include/boost/type_traits/is_abstract.hpp b/include/boost/type_traits/is_abstract.hpp index f1cd92c..7715c5c 100644 --- a/include/boost/type_traits/is_abstract.hpp +++ b/include/boost/type_traits/is_abstract.hpp @@ -49,20 +49,18 @@ // #include +#include #ifndef BOOST_IS_ABSTRACT #include #include #include -#include #ifdef BOOST_NO_IS_ABSTRACT #include #endif #endif -// should be the last #include -#include - namespace boost { + namespace detail{ #ifdef BOOST_IS_ABSTRACT @@ -141,13 +139,11 @@ struct is_abstract_imp } #ifndef BOOST_NO_IS_ABSTRACT -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_abstract,T,::boost::detail::is_abstract_imp::value) +template struct is_abstract : public integral_constant::value> {}; #else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_abstract,T,::boost::detail::is_polymorphic_imp::value) +template struct is_abstract : public integral_constant::value> {}; #endif } // namespace boost -#include - #endif //BOOST_TT_IS_ABSTRACT_CLASS_HPP diff --git a/include/boost/type_traits/is_arithmetic.hpp b/include/boost/type_traits/is_arithmetic.hpp index a1d8c46..c23811e 100644 --- a/include/boost/type_traits/is_arithmetic.hpp +++ b/include/boost/type_traits/is_arithmetic.hpp @@ -9,43 +9,14 @@ #ifndef BOOST_TT_IS_ARITHMETIC_HPP_INCLUDED #define BOOST_TT_IS_ARITHMETIC_HPP_INCLUDED -#if !defined( __CODEGEARC__ ) #include -#include -#include -#include -#endif - -// should be the last #include -#include +#include namespace boost { -#if !defined(__CODEGEARC__) -namespace detail { - -template< typename T > -struct is_arithmetic_impl -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::is_integral::value, - ::boost::is_float::value - >::value)); -}; - -} // namespace detail -#endif - -//* is a type T an arithmetic type described in the standard (3.9.1p8) -#if defined(__CODEGEARC__) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_arithmetic,T,__is_arithmetic(T)) -#else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_arithmetic,T,::boost::detail::is_arithmetic_impl::value) -#endif +template +struct is_arithmetic : public integral_constant::value || is_floating_point::value> {}; } // namespace boost -#include - #endif // BOOST_TT_IS_ARITHMETIC_HPP_INCLUDED diff --git a/include/boost/type_traits/is_array.hpp b/include/boost/type_traits/is_array.hpp index c381ca4..497dc49 100644 --- a/include/boost/type_traits/is_array.hpp +++ b/include/boost/type_traits/is_array.hpp @@ -14,30 +14,25 @@ #ifndef BOOST_TT_IS_ARRAY_HPP_INCLUDED #define BOOST_TT_IS_ARRAY_HPP_INCLUDED -#include - - +#include #include -// should be the last #include -#include - namespace boost { #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_array,T,__is_array(T)) + template struct is_array : public integral_constant {}; #else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_array,T,false) + template struct is_array : public false_type {}; #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T[N],true) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T const[N],true) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T volatile[N],true) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T const volatile[N],true) + template struct is_array : public true_type {}; + template struct is_array : public true_type{}; + template struct is_array : public true_type{}; + template struct is_array : public true_type{}; #if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T[],true) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T const[],true) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T volatile[],true) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T const volatile[],true) + template struct is_array : public true_type{}; + template struct is_array : public true_type{}; + template struct is_array : public true_type{}; + template struct is_array : public true_type{}; #endif #endif @@ -45,6 +40,4 @@ BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T const volatile[],t } // namespace boost -#include - #endif // BOOST_TT_IS_ARRAY_HPP_INCLUDED diff --git a/include/boost/type_traits/is_base_and_derived.hpp b/include/boost/type_traits/is_base_and_derived.hpp index 632b699..ee3dce5 100644 --- a/include/boost/type_traits/is_base_and_derived.hpp +++ b/include/boost/type_traits/is_base_and_derived.hpp @@ -10,18 +10,16 @@ #define BOOST_TT_IS_BASE_AND_DERIVED_HPP_INCLUDED #include +#include #ifndef BOOST_IS_BASE_OF #include #include #include -#include #include #include #endif #include - -// should be the last #include -#include +#include namespace boost { @@ -230,23 +228,17 @@ struct is_base_and_derived_impl #endif } // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF2( - is_base_and_derived - , Base - , Derived - , (::boost::detail::is_base_and_derived_impl::value) - ) +template struct is_base_and_derived + : public integral_constant::value)> {}; -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_and_derived,Base&,Derived,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_and_derived,Base,Derived&,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_and_derived,Base&,Derived&,false) +template struct is_base_and_derived : public false_type{}; +template struct is_base_and_derived : public false_type{}; +template struct is_base_and_derived : public false_type{}; #if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610)) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename Base,is_base_and_derived,Base,Base,false) +template struct is_base_and_derived : public true_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_BASE_AND_DERIVED_HPP_INCLUDED diff --git a/include/boost/type_traits/is_base_of.hpp b/include/boost/type_traits/is_base_of.hpp index 3655b0b..89f2f67 100644 --- a/include/boost/type_traits/is_base_of.hpp +++ b/include/boost/type_traits/is_base_of.hpp @@ -12,11 +12,6 @@ #include #include #include -#include -#include - -// should be the last #include -#include namespace boost { @@ -26,24 +21,19 @@ namespace boost { { typedef typename remove_cv::type ncvB; typedef typename remove_cv::type ncvD; - BOOST_STATIC_CONSTANT(bool, value = (::boost::type_traits::ice_or< - (::boost::detail::is_base_and_derived_impl::value), - (::boost::type_traits::ice_and< ::boost::is_same::value, ::boost::is_class::value>::value)>::value)); + BOOST_STATIC_CONSTANT(bool, value = ( + (::boost::detail::is_base_and_derived_impl::value) || + (::boost::is_same::value && ::boost::is_class::value))); }; } -BOOST_TT_AUX_BOOL_TRAIT_DEF2( - is_base_of - , Base - , Derived - , (::boost::detail::is_base_of_imp::value)) + template struct is_base_of + : public integral_constant::value)> {}; -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_of,Base&,Derived,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_of,Base,Derived&,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_of,Base&,Derived&,false) + template struct is_base_of : false_type{}; + template struct is_base_of : false_type{}; + template struct is_base_of : false_type{}; } // namespace boost -#include - #endif // BOOST_TT_IS_BASE_AND_DERIVED_HPP_INCLUDED diff --git a/include/boost/type_traits/is_base_of_tr1.hpp b/include/boost/type_traits/is_base_of_tr1.hpp index 7264f15..210bf54 100644 --- a/include/boost/type_traits/is_base_of_tr1.hpp +++ b/include/boost/type_traits/is_base_of_tr1.hpp @@ -12,10 +12,6 @@ #include #include #include -#include - -// should be the last #include -#include namespace boost { namespace tr1{ @@ -25,24 +21,17 @@ namespace boost { namespace tr1{ { typedef typename remove_cv::type ncvB; typedef typename remove_cv::type ncvD; - BOOST_STATIC_CONSTANT(bool, value = (::boost::type_traits::ice_or< - (::boost::detail::is_base_and_derived_impl::value), - (::boost::is_same::value)>::value)); + BOOST_STATIC_CONSTANT(bool, value = ((::boost::detail::is_base_and_derived_impl::value) || (::boost::is_same::value))); }; } -BOOST_TT_AUX_BOOL_TRAIT_DEF2( - is_base_of - , Base - , Derived - , (::boost::tr1::detail::is_base_of_imp::value)) + template struct is_base_of + : public integral_constant::value)>{}; -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_of,Base&,Derived,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_of,Base,Derived&,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_of,Base&,Derived&,false) + template struct is_base_of : public false_type{}; + template struct is_base_of : public false_type{}; + template struct is_base_of : public false_type{}; } } // namespace boost -#include - #endif // BOOST_TT_IS_BASE_OF_TR1_HPP_INCLUDED diff --git a/include/boost/type_traits/is_class.hpp b/include/boost/type_traits/is_class.hpp index 0675b57..e3a22d2 100644 --- a/include/boost/type_traits/is_class.hpp +++ b/include/boost/type_traits/is_class.hpp @@ -10,12 +10,11 @@ #ifndef BOOST_TT_IS_CLASS_HPP_INCLUDED #define BOOST_TT_IS_CLASS_HPP_INCLUDED -#include +#include #include +#include #ifndef BOOST_IS_CLASS # include -# include -# include #ifdef BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION # include @@ -29,13 +28,6 @@ #endif // BOOST_IS_CLASS -#ifdef __EDG_VERSION__ -# include -#endif - -// should be the last #include -#include - namespace boost { namespace detail { @@ -63,10 +55,8 @@ struct is_class_impl { BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - sizeof(is_class_tester(0)) == sizeof(::boost::type_traits::yes_type), - ::boost::type_traits::ice_not< ::boost::is_union::value >::value - >::value) + sizeof(is_class_tester(0)) == sizeof(::boost::type_traits::yes_type) + && ! ::boost::is_union::value ); }; @@ -79,10 +69,8 @@ struct is_class_impl template static ::boost::type_traits::no_type is_class_tester(...); BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - sizeof(is_class_tester(0)) == sizeof(::boost::type_traits::yes_type), - ::boost::type_traits::ice_not< ::boost::is_union::value >::value - >::value) + sizeof(is_class_tester(0)) == sizeof(::boost::type_traits::yes_type) + && ! ::boost::is_union::value ); }; @@ -94,14 +82,13 @@ template struct is_class_impl { BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - ::boost::type_traits::ice_not< ::boost::is_union::value >::value, - ::boost::type_traits::ice_not< ::boost::is_scalar::value >::value, - ::boost::type_traits::ice_not< ::boost::is_array::value >::value, - ::boost::type_traits::ice_not< ::boost::is_reference::value>::value, - ::boost::type_traits::ice_not< ::boost::is_void::value >::value, - ::boost::type_traits::ice_not< ::boost::is_function::value >::value - >::value)); + ! ::boost::is_union::value >::value + && ! ::boost::is_scalar::value + && ! ::boost::is_array::value + && ! ::boost::is_reference::value + && ! ::boost::is_void::value + && ! ::boost::is_function::value + ); }; # endif // BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION @@ -115,15 +102,13 @@ struct is_class_impl } // namespace detail +template struct is_class : public integral_constant::value> {}; # ifdef __EDG_VERSION__ -BOOST_TT_AUX_BOOL_TRAIT_DEF1( - 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) +template struct is_class : public is_class{}; +template struct is_class : public is_class{}; +template struct is_class : public is_class{}; # endif } // namespace boost -#include - #endif // BOOST_TT_IS_CLASS_HPP_INCLUDED diff --git a/include/boost/type_traits/is_complex.hpp b/include/boost/type_traits/is_complex.hpp index 0813dac..08210eb 100644 --- a/include/boost/type_traits/is_complex.hpp +++ b/include/boost/type_traits/is_complex.hpp @@ -8,27 +8,14 @@ #ifndef BOOST_TT_IS_COMPLEX_HPP #define BOOST_TT_IS_COMPLEX_HPP -#include #include -// should be the last #include -#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)) + template struct is_complex : public false_type {}; + template struct is_complex > : public true_type{}; } // namespace boost -#include - #endif //BOOST_TT_IS_COMPLEX_HPP diff --git a/include/boost/type_traits/is_compound.hpp b/include/boost/type_traits/is_compound.hpp index bbaaa42..7995eb8 100644 --- a/include/boost/type_traits/is_compound.hpp +++ b/include/boost/type_traits/is_compound.hpp @@ -9,38 +9,16 @@ #ifndef BOOST_TT_IS_COMPOUND_HPP_INCLUDED #define BOOST_TT_IS_COMPOUND_HPP_INCLUDED -#include #include -#include - -// should be the last #include -#include namespace boost { -#if !defined( __CODEGEARC__ ) -namespace detail { - -template -struct is_compound_impl -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_not< - ::boost::is_fundamental::value - >::value)); -}; - -} // namespace detail -#endif // !defined( __CODEGEARC__ ) - #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_compound,T,__is_compound(T)) + template struct is_compound : public integral_constant {}; #else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_compound,T,::boost::detail::is_compound_impl::value) + template struct is_compound : public integral_constant::value> {}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_COMPOUND_HPP_INCLUDED diff --git a/include/boost/type_traits/is_const.hpp b/include/boost/type_traits/is_const.hpp index e3e62b6..d9dd2aa 100644 --- a/include/boost/type_traits/is_const.hpp +++ b/include/boost/type_traits/is_const.hpp @@ -21,70 +21,26 @@ #ifndef BOOST_TT_IS_CONST_HPP_INCLUDED #define BOOST_TT_IS_CONST_HPP_INCLUDED -#include -#include - -# include -# ifdef __GNUC__ -# include -# endif -# if BOOST_WORKAROUND(BOOST_MSVC, < 1400) -# include -# endif - -// should be the last #include -#include +#include namespace boost { #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_const,T,__is_const(T)) + template + struct is_const : public integral_constant {}; #else -namespace detail{ -// -// We can't filter out rvalue_references at the same level as -// references or we get ambiguities from msvc: -// -template -struct is_const_rvalue_filter -{ -#if BOOST_WORKAROUND(BOOST_MSVC, < 1400) - BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp::type*>::is_const); -#else - BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp::is_const); -#endif -}; -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -template -struct is_const_rvalue_filter -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -#endif -} - -//* is a type T declared const - is_const -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_const,T,::boost::detail::is_const_rvalue_filter::value) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T&,false) - -#if defined(BOOST_ILLEGAL_CV_REFERENCES) -// these are illegal specialisations; cv-qualifies applied to -// references have no effect according to [8.3.2p1], -// C++ Builder requires them though as it treats cv-qualified -// references as distinct types... -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T& const,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T& volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T& const volatile,false) -#endif + template + struct is_const : public false_type {}; + template struct is_const : public true_type{}; + template struct is_const : public true_type{}; + template struct is_const : public true_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_CONST_HPP_INCLUDED diff --git a/include/boost/type_traits/is_convertible.hpp b/include/boost/type_traits/is_convertible.hpp index a844cec..6b4aa8d 100644 --- a/include/boost/type_traits/is_convertible.hpp +++ b/include/boost/type_traits/is_convertible.hpp @@ -13,14 +13,14 @@ #define BOOST_TT_IS_CONVERTIBLE_HPP_INCLUDED #include +#include #ifndef BOOST_IS_CONVERTIBLE #include -#include +#include #include -#include #include #include -#ifndef BOOST_NO_IS_ABSTRACT +#if !defined(BOOST_NO_IS_ABSTRACT) #include #endif #include @@ -33,11 +33,11 @@ #if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) # include #endif +#elif defined(BOOST_MSVC) || defined(BOOST_INTEL) +#include +#include #endif // BOOST_IS_CONVERTIBLE -// should be always the last #include directive -#include - namespace boost { #ifndef BOOST_IS_CONVERTIBLE @@ -336,38 +336,15 @@ struct is_convertible_basic_impl template struct is_convertible_impl { - enum { value = - (::boost::type_traits::ice_and< - ::boost::type_traits::ice_or< - ::boost::detail::is_convertible_basic_impl::value, - ::boost::is_void::value - >::value, - ::boost::type_traits::ice_not< - ::boost::is_array::value - >::value, - ::boost::type_traits::ice_not< - ::boost::is_function::value - >::value - >::value) }; + enum { + value = ( ::boost::detail::is_convertible_basic_impl::value && ! ::boost::is_array::value && ! ::boost::is_function::value) + }; }; #elif !defined(__BORLANDC__) || __BORLANDC__ > 0x551 template struct is_convertible_impl { - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - ::boost::type_traits::ice_or< - ::boost::detail::is_convertible_basic_impl::value, - ::boost::is_void::value - >::value, - ::boost::type_traits::ice_not< - ::boost::is_array::value - >::value, - ::boost::type_traits::ice_not< - ::boost::is_function::value - >::value - >::value) - ); + BOOST_STATIC_CONSTANT(bool, value = ( ::boost::detail::is_convertible_basic_impl::value && !::boost::is_array::value && !::boost::is_function::value)); }; #endif @@ -443,52 +420,55 @@ struct is_convertible_impl_dispatch // implementation above: // #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -# define TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1(trait,spec1,spec2,value) \ - BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2(trait,spec1,spec2,value) \ - BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2(trait,spec1,spec2 const,value) \ - BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2(trait,spec1,spec2 volatile,value) \ - BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2(trait,spec1,spec2 const volatile,value) \ - /**/ -# define TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2(trait,spec1,spec2,value) \ - TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1(trait,spec1,spec2,value) \ - TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1(trait,spec1 const,spec2,value) \ - TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1(trait,spec1 volatile,spec2,value) \ - TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1(trait,spec1 const volatile,spec2,value) \ - /**/ +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; - TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2(is_convertible,void,void,true) +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; -# undef TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2 -# undef TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1 +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; + +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; #else - BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2(is_convertible,void,void,true) +template <> struct is_convertible_impl_dispatch : public true_type{}; #endif // BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename To,is_convertible,void,To,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename From,is_convertible,From,void,false) +template struct is_convertible_impl_dispatch : public false_type{}; +template struct is_convertible_impl_dispatch : public false_type{}; + #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename To,is_convertible,void const,To,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename To,is_convertible,void volatile,To,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename To,is_convertible,void const volatile,To,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename From,is_convertible,From,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename From,is_convertible,From,void volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename From,is_convertible,From,void const volatile,false) +template struct is_convertible_impl_dispatch : public false_type{}; +template struct is_convertible_impl_dispatch : public false_type{}; +template struct is_convertible_impl_dispatch : public false_type{}; +template struct is_convertible_impl_dispatch : public false_type{}; +template struct is_convertible_impl_dispatch : public false_type{}; +template struct is_convertible_impl_dispatch : public false_type{}; #endif } // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF2(is_convertible,From,To,(::boost::detail::is_convertible_impl_dispatch::value)) +template +struct is_convertible : public integral_constant::value> {}; #else -BOOST_TT_AUX_BOOL_TRAIT_DEF2(is_convertible,From,To,BOOST_IS_CONVERTIBLE(From,To)) +template +struct is_convertible : public integral_constant {}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_CONVERTIBLE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_copy_assignable.hpp b/include/boost/type_traits/is_copy_assignable.hpp index 48af818..a6d19aa 100644 --- a/include/boost/type_traits/is_copy_assignable.hpp +++ b/include/boost/type_traits/is_copy_assignable.hpp @@ -27,10 +27,6 @@ #include #endif - -// should be the last #include -#include - namespace boost { namespace detail{ @@ -132,16 +128,14 @@ struct is_copy_assignable_impl { } // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_copy_assignable,T,::boost::detail::is_copy_assignable_impl::value) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_assignable,void,false) +template struct is_copy_assignable : public integral_constant::value>{}; +template <> struct is_copy_assignable : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_assignable,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_assignable,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_assignable,void volatile,false) +template <> struct is_copy_assignable : public false_type{}; +template <> struct is_copy_assignable : public false_type{}; +template <> struct is_copy_assignable : public false_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_COPY_ASSIGNABLE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_copy_constructible.hpp b/include/boost/type_traits/is_copy_constructible.hpp index 24f5eeb..b26543f 100644 --- a/include/boost/type_traits/is_copy_constructible.hpp +++ b/include/boost/type_traits/is_copy_constructible.hpp @@ -9,7 +9,6 @@ #ifndef BOOST_TT_IS_COPY_CONSTRUCTIBLE_HPP_INCLUDED #define BOOST_TT_IS_COPY_CONSTRUCTIBLE_HPP_INCLUDED -#include #include #include #include @@ -17,9 +16,6 @@ #include #include -// should be the last #include -#include - namespace boost { namespace detail{ @@ -110,16 +106,14 @@ struct is_copy_constructible_impl { } // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_copy_constructible,T,::boost::detail::is_copy_constructible_impl::value) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_constructible,void,false) +template struct is_copy_constructible : public integral_constant::value>{}; +template <> struct is_copy_constructible : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_constructible,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_constructible,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_constructible,void volatile,false) +template <> struct is_copy_constructible : public false_type{}; +template <> struct is_copy_constructible : public false_type{}; +template <> struct is_copy_constructible : public false_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_COPY_CONSTRUCTIBLE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_empty.hpp b/include/boost/type_traits/is_empty.hpp index adb239e..ef288c5 100644 --- a/include/boost/type_traits/is_empty.hpp +++ b/include/boost/type_traits/is_empty.hpp @@ -10,16 +10,12 @@ #define BOOST_TT_IS_EMPTY_HPP_INCLUDED #include -#include -#include +#include #include -# include -# include -# include - -// should be always the last #include directive -#include +#include +#include +#include #ifndef BOOST_INTERNAL_IS_EMPTY #define BOOST_INTERNAL_IS_EMPTY(T) false @@ -75,12 +71,8 @@ struct is_empty_impl { typedef typename remove_cv::type cvt; BOOST_STATIC_CONSTANT( - bool, value = ( - ::boost::type_traits::ice_or< - ::boost::detail::empty_helper::value>::value - , BOOST_INTERNAL_IS_EMPTY(cvt) - >::value - )); + bool, + value = ( ::boost::detail::empty_helper::value>::value || BOOST_INTERNAL_IS_EMPTY(cvt))); }; #else // __BORLANDC__ @@ -107,35 +99,21 @@ struct is_empty_impl BOOST_STATIC_CONSTANT( bool, value = ( - ::boost::type_traits::ice_or< ::boost::detail::empty_helper< cvt , ::boost::is_class::value , ::boost::is_convertible< r_type,int>::value - >::value - , BOOST_INTERNAL_IS_EMPTY(cvt) - >::value)); + >::value || BOOST_INTERNAL_IS_EMPTY(cvt)); }; #endif // __BORLANDC__ - -// these help when the compiler has no partial specialization support: -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_empty,void,false) -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_empty,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_empty,void volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_empty,void const volatile,false) -#endif - } // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_empty,T,::boost::detail::is_empty_impl::value) +template struct is_empty : integral_constant::value> {}; } // namespace boost -#include - #undef BOOST_INTERNAL_IS_EMPTY #endif // BOOST_TT_IS_EMPTY_HPP_INCLUDED diff --git a/include/boost/type_traits/is_enum.hpp b/include/boost/type_traits/is_enum.hpp index 7929c96..eada480 100644 --- a/include/boost/type_traits/is_enum.hpp +++ b/include/boost/type_traits/is_enum.hpp @@ -12,6 +12,7 @@ #define BOOST_TT_IS_ENUM_HPP_INCLUDED #include +#include #ifndef BOOST_IS_ENUM #include #include @@ -21,16 +22,13 @@ #ifdef __GNUC__ #include #endif -#include +#include #if defined(BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION) # include # include #endif #endif -// should be the last #include -#include - namespace boost { #ifndef BOOST_IS_ENUM @@ -43,11 +41,7 @@ namespace detail { template struct is_class_or_union { - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::is_class::value - , ::boost::is_union::value - >::value)); + BOOST_STATIC_CONSTANT(bool, value = ::boost::is_class::value || ::boost::is_union::value); }; #else @@ -94,8 +88,8 @@ template <> struct is_enum_helper { template struct type - : public ::boost::is_convertible::type,::boost::detail::int_convertible> { + static const bool value = ::boost::is_convertible::type, ::boost::detail::int_convertible>::value; }; }; @@ -112,34 +106,28 @@ template struct is_enum_impl // order to correctly deduce that noncopyable types are not enums // (dwa 2002/04/15)... BOOST_STATIC_CONSTANT(bool, selector = - (::boost::type_traits::ice_or< ::boost::is_arithmetic::value - , ::boost::is_reference::value - , ::boost::is_function::value - , is_class_or_union::value - , is_array::value - >::value)); + || ::boost::is_reference::value + || ::boost::is_function::value + || is_class_or_union::value + || is_array::value); #else // ...however, not checking is_class_or_union on non-conforming // compilers prevents a dependency recursion. BOOST_STATIC_CONSTANT(bool, selector = - (::boost::type_traits::ice_or< ::boost::is_arithmetic::value - , ::boost::is_reference::value - , ::boost::is_function::value - , is_array::value - >::value)); + || ::boost::is_reference::value + || ::boost::is_function::value + || is_array::value); #endif // BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION #else // !defined(__GNUC__): BOOST_STATIC_CONSTANT(bool, selector = - (::boost::type_traits::ice_or< ::boost::is_arithmetic::value - , ::boost::is_reference::value - , is_class_or_union::value - , is_array::value - >::value)); + || ::boost::is_reference::value + || is_class_or_union::value + || is_array::value); #endif @@ -155,34 +143,24 @@ template struct is_enum_impl BOOST_STATIC_CONSTANT(bool, value = helper::value); }; -// these help on compilers with no partial specialization support: -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_enum,void,false) -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_enum,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_enum,void volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_enum,void const volatile,false) -#endif - } // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_enum,T,::boost::detail::is_enum_impl::value) +template struct is_enum : public integral_constant::value> {}; #else // __BORLANDC__ // // buggy is_convertible prevents working // implementation of is_enum: -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_enum,T,false) +template struct is_enum : public integral_constant {}; #endif #else // BOOST_IS_ENUM -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_enum,T,BOOST_IS_ENUM(T)) +template struct is_enum : public integral_constant {}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_ENUM_HPP_INCLUDED diff --git a/include/boost/type_traits/is_final.hpp b/include/boost/type_traits/is_final.hpp index 36bd62e..410d186 100644 --- a/include/boost/type_traits/is_final.hpp +++ b/include/boost/type_traits/is_final.hpp @@ -11,31 +11,20 @@ #ifndef BOOST_TT_IS_FINAL_HPP_INCLUDED #define BOOST_TT_IS_FINAL_HPP_INCLUDED -#include -#include #include - -// should be the last #include -#include +#include +#ifdef BOOST_IS_FINAL +#include +#endif namespace boost { -namespace detail { -template struct is_final_impl -{ #ifdef BOOST_IS_FINAL - typedef typename remove_cv::type cvt; - BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_FINAL(cvt)); +template struct is_final : public integral_constant::type)> {}; #else - BOOST_STATIC_CONSTANT(bool, value = false); +template struct is_final : public integral_constant {}; #endif -}; -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_final,T,::boost::detail::is_final_impl::value) } // namespace boost -#include - #endif // BOOST_TT_IS_FINAL_HPP_INCLUDED diff --git a/include/boost/type_traits/is_float.hpp b/include/boost/type_traits/is_float.hpp index 25d16f1..7bf7d1f 100644 --- a/include/boost/type_traits/is_float.hpp +++ b/include/boost/type_traits/is_float.hpp @@ -1,4 +1,3 @@ - // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -10,18 +9,12 @@ #define BOOST_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED // should be the last #include -#include +#include namespace boost { //* is a type T a floating-point type described in the standard (3.9.1p8) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_float,T,false) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_float,float,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_float,double,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_float,long double,true) - + template struct is_float : public is_floating_point {}; } // namespace boost -#include - #endif // BOOST_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED diff --git a/include/boost/type_traits/is_floating_point.hpp b/include/boost/type_traits/is_floating_point.hpp index 2224453..5d48d74 100755 --- a/include/boost/type_traits/is_floating_point.hpp +++ b/include/boost/type_traits/is_floating_point.hpp @@ -1,4 +1,3 @@ - // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000-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 @@ -9,19 +8,19 @@ #ifndef BOOST_TYPE_TRAITS_IS_FLOATING_HPP_INCLUDED #define BOOST_TYPE_TRAITS_IS_FLOATING_HPP_INCLUDED -// should be the last #include -#include +#include namespace boost { //* is a type T a floating-point type described in the standard (3.9.1p8) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_floating_point,T,false) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_floating_point,float,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_floating_point,double,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_floating_point,long double,true) + template struct is_floating_point : public false_type{}; + template struct is_floating_point : public is_floating_point{}; + template struct is_floating_point : public is_floating_point{}; + template struct is_floating_point : public is_floating_point{}; + template<> struct is_floating_point : public true_type{}; + template<> struct is_floating_point : public true_type{}; + template<> struct is_floating_point : public true_type{}; } // namespace boost -#include - #endif // BOOST_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED diff --git a/include/boost/type_traits/is_function.hpp b/include/boost/type_traits/is_function.hpp index eeb4382..f77c1f0 100644 --- a/include/boost/type_traits/is_function.hpp +++ b/include/boost/type_traits/is_function.hpp @@ -12,8 +12,7 @@ #define BOOST_TT_IS_FUNCTION_HPP_INCLUDED #include -#include -#include +#include #if !defined(BOOST_TT_TEST_MS_FUNC_SIGS) # include @@ -22,9 +21,6 @@ # include #endif -// should be the last #include -#include - // is a type a function? // Please note that this implementation is unnecessarily complex: // we could just use !is_convertible::value, @@ -40,17 +36,16 @@ namespace detail { #if !defined(BOOST_TT_TEST_MS_FUNC_SIGS) template struct is_function_chooser - : public ::boost::type_traits::false_result { + template< typename T > struct result_ + : public false_type {}; }; template <> struct is_function_chooser { template< typename T > struct result_ - : public ::boost::type_traits::is_function_ptr_helper - { - }; + : public ::boost::type_traits::is_function_ptr_helper {}; }; template @@ -95,15 +90,13 @@ struct is_function_impl : public false_type #endif // !defined( __CODEGEARC__ ) #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_function,T,__is_function(T)) +template struct is_function : integral_constant {}; #else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_function,T,::boost::detail::is_function_impl::value) +template struct is_function : integral_constant::value> {}; #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_function,T&&,false) +template struct is_function : public false_type {}; #endif #endif } // namespace boost -#include - #endif // BOOST_TT_IS_FUNCTION_HPP_INCLUDED diff --git a/include/boost/type_traits/is_fundamental.hpp b/include/boost/type_traits/is_fundamental.hpp index 138e296..f58767a 100644 --- a/include/boost/type_traits/is_fundamental.hpp +++ b/include/boost/type_traits/is_fundamental.hpp @@ -11,35 +11,16 @@ #include #include -#include - -// should be the last #include -#include namespace boost { -namespace detail { - -template -struct is_fundamental_impl - : public ::boost::type_traits::ice_or< - ::boost::is_arithmetic::value - , ::boost::is_void::value - > -{ -}; - -} // namespace detail - //* is a type T a fundamental type described in the standard (3.9.1) #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_fundamental,T,__is_fundamental(T)) +template struct is_fundamental : public integral_constant {}; #else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_fundamental,T,::boost::detail::is_fundamental_impl::value) +template struct is_fundamental : public integral_constant::value || ::boost::is_void::value> {}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_FUNDAMENTAL_HPP_INCLUDED diff --git a/include/boost/type_traits/is_integral.hpp b/include/boost/type_traits/is_integral.hpp index 6bfad49..7a7e54b 100644 --- a/include/boost/type_traits/is_integral.hpp +++ b/include/boost/type_traits/is_integral.hpp @@ -10,79 +10,80 @@ #define BOOST_TT_IS_INTEGRAL_HPP_INCLUDED #include - -// should be the last #include -#include +#include namespace boost { +#if defined( __CODEGEARC__ ) + template + struct is_integral : public integral_constant {}; +#else + +template struct is_integral : public false_type {}; +template struct is_integral : public is_integral {}; +template struct is_integral : public is_integral{}; +template struct is_integral : public is_integral{}; + //* is a type T an [cv-qualified-] integral type described in the standard (3.9.1p3) // as an extension we include long long, as this is likely to be added to the // standard at a later date -#if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_integral,T,__is_integral(T)) -#else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_integral,T,false) +template<> struct is_integral : public true_type {}; +template<> struct is_integral : public true_type{}; +template<> struct is_integral : public true_type{}; +template<> struct is_integral : public true_type{}; -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned char,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned short,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned int,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned long,true) +template<> struct is_integral : public true_type{}; +template<> struct is_integral : public true_type{}; +template<> struct is_integral : public true_type{}; +template<> struct is_integral : public true_type{}; -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed char,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed short,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed int,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed long,true) - -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,bool,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char,true) +template<> struct is_integral : public true_type{}; +template<> struct is_integral : public true_type{}; #ifndef BOOST_NO_INTRINSIC_WCHAR_T // If the following line fails to compile and you're using the Intel // compiler, see http://lists.boost.org/MailArchives/boost-users/msg06567.php, // and define BOOST_NO_INTRINSIC_WCHAR_T on the command line. -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true) +template<> struct is_integral : public true_type{}; #endif // Same set of integral types as in boost/type_traits/integral_promotion.hpp. // Please, keep in sync. -- Alexander Nasonov #if (defined(BOOST_INTEL_CXX_VERSION) && defined(_MSC_VER) && (BOOST_INTEL_CXX_VERSION <= 600)) \ || (defined(__BORLANDC__) && (__BORLANDC__ == 0x600) && (_MSC_VER < 1300)) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int8,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int8,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int16,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int16,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int32,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int32,true) +template<> struct is_integral : public true_type{}; +template<> struct is_integral : public true_type{}; +template<> struct is_integral : public true_type{}; +template<> struct is_integral<__int8> : public true_type{}; +template<> struct is_integral<__int16> : public true_type{}; +template<> struct is_integral<__int32> : public true_type{}; #ifdef __BORLANDC__ -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int64,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true) +template<> struct is_integral : public true_type{}; +template<> struct is_integral<__int64> : public true_type{}; #endif #endif # if defined(BOOST_HAS_LONG_LONG) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral, ::boost::ulong_long_type,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral, ::boost::long_long_type,true) +template<> struct is_integral< ::boost::ulong_long_type> : public true_type{}; +template<> struct is_integral< ::boost::long_long_type> : public true_type{}; #elif defined(BOOST_HAS_MS_INT64) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int64,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true) +template<> struct is_integral : public true_type{}; +template<> struct is_integral<__int64> : public true_type{}; #endif #ifdef BOOST_HAS_INT128 -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,boost::int128_type,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,boost::uint128_type,true) +template<> struct is_integral : public true_type{}; +template<> struct is_integral : public true_type{}; #endif #ifndef BOOST_NO_CXX11_CHAR16_T -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char16_t,true) +template<> struct is_integral : public true_type{}; #endif #ifndef BOOST_NO_CXX11_CHAR32_T -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char32_t,true) +template<> struct is_integral : public true_type{}; #endif #endif // non-CodeGear implementation } // namespace boost -#include - #endif // BOOST_TT_IS_INTEGRAL_HPP_INCLUDED diff --git a/include/boost/type_traits/is_lvalue_reference.hpp b/include/boost/type_traits/is_lvalue_reference.hpp index 0b0130a..e94d787 100644 --- a/include/boost/type_traits/is_lvalue_reference.hpp +++ b/include/boost/type_traits/is_lvalue_reference.hpp @@ -21,36 +21,30 @@ #ifndef BOOST_TT_IS_LVALUE_REFERENCE_HPP_INCLUDED #define BOOST_TT_IS_LVALUE_REFERENCE_HPP_INCLUDED -#include - - -// should be the last #include -#include +#include namespace boost { #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_lvalue_reference,T,__is_reference(T)) + template struct is_lvalue_reference : public integral_constant{}; #else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_lvalue_reference,T,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T&,true) + template struct is_lvalue_reference : public false_type{}; + template struct is_lvalue_reference : public true_type{}; #if defined(BOOST_ILLEGAL_CV_REFERENCES) // these are illegal specialisations; cv-qualifies applied to // references have no effect according to [8.3.2p1], // C++ Builder requires them though as it treats cv-qualified // references as distinct types... -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T& const,true) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T& volatile,true) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T& const volatile,true) + template struct is_lvalue_reference : public true_type{}; + template struct is_lvalue_reference : public true_type{}; + template struct is_lvalue_reference : public true_type{}; #endif #endif } // namespace boost -#include - #endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_member_function_pointer.hpp b/include/boost/type_traits/is_member_function_pointer.hpp index d1c3690..223197f 100644 --- a/include/boost/type_traits/is_member_function_pointer.hpp +++ b/include/boost/type_traits/is_member_function_pointer.hpp @@ -11,7 +11,7 @@ #ifndef BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED #define BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED -#include +#include #include #if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS) @@ -22,29 +22,22 @@ // # include # include +# include #else # include # include # include -# include -# include # include #endif -// should be the last #include -#include - namespace boost { #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_function_pointer,T,__is_member_function_pointer( T )) +template struct is_member_function_pointer : public integral_constant {}; #elif !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS) -BOOST_TT_AUX_BOOL_TRAIT_DEF1( - is_member_function_pointer - , T - , ::boost::type_traits::is_mem_fun_pointer_impl::type>::value - ) +template struct is_member_function_pointer + : public ::boost::integral_constant::type>::value>{}; #else @@ -54,8 +47,8 @@ namespace detail { template struct is_mem_fun_pointer_select - : public ::boost::type_traits::false_result { + template struct result_ : public false_type{}; }; template <> @@ -82,14 +75,8 @@ struct is_mem_fun_pointer_select template struct is_member_function_pointer_impl - : public is_mem_fun_pointer_select< - ::boost::type_traits::ice_or< - ::boost::is_reference::value - , ::boost::is_array::value - >::value - >::template result_ -{ -}; + : public is_mem_fun_pointer_select< + ::boost::is_reference::value || ::boost::is_array::value>::template result_{}; template struct is_member_function_pointer_impl : public false_type{}; @@ -113,21 +100,21 @@ struct is_member_function_pointer_impl #endif -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void,false) +template<> struct is_member_function_pointer_impl : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void const volatile,false) +template<> struct is_member_function_pointer_impl : public false_type{}; +template<> struct is_member_function_pointer_impl : public false_type{}; +template<> struct is_member_function_pointer_impl : public false_type{}; #endif } // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_function_pointer,T,::boost::detail::is_member_function_pointer_impl::value) +template +struct is_member_function_pointer + : public integral_constant::value>{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/is_member_object_pointer.hpp b/include/boost/type_traits/is_member_object_pointer.hpp index 66b76c9..cb7cf14 100755 --- a/include/boost/type_traits/is_member_object_pointer.hpp +++ b/include/boost/type_traits/is_member_object_pointer.hpp @@ -10,37 +10,15 @@ #ifndef BOOST_TT_IS_MEMBER_OBJECT_POINTER_HPP_INCLUDED #define BOOST_TT_IS_MEMBER_OBJECT_POINTER_HPP_INCLUDED -#include #include #include -#include -#include - -// should be the last #include -#include namespace boost { -namespace detail{ - -template -struct is_member_object_pointer_impl -{ - BOOST_STATIC_CONSTANT( - bool, value = (::boost::type_traits::ice_and< - ::boost::is_member_pointer::value, - ::boost::type_traits::ice_not< - ::boost::is_member_function_pointer::value - >::value - >::value )); -}; - -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_object_pointer,T,::boost::detail::is_member_object_pointer_impl::value) +template struct is_member_object_pointer + : public integral_constant::value && !::boost::is_member_function_pointer::value>{}; } // namespace boost -#include - #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/is_member_pointer.hpp b/include/boost/type_traits/is_member_pointer.hpp index cba31af..9757afc 100644 --- a/include/boost/type_traits/is_member_pointer.hpp +++ b/include/boost/type_traits/is_member_pointer.hpp @@ -21,45 +21,25 @@ #ifndef BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED #define BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED -#include #include - -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) -# include -#else -# include -# include -# include -# include -# include -# include -#endif - -// should be the last #include -#include +#include namespace boost { #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,__is_member_pointer(T)) -#elif BOOST_WORKAROUND(__BORLANDC__, < 0x600) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*,true) - +template struct is_member_pointer : public integral_constant{}; #else -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) +template struct is_member_pointer : public integral_constant::value>{}; +template struct is_member_pointer : public true_type{}; #if !BOOST_WORKAROUND(__MWERKS__,<=0x3003) && !BOOST_WORKAROUND(__IBMCPP__, <=600) -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) +template struct is_member_pointer : public true_type{}; +template struct is_member_pointer : public true_type{}; +template struct is_member_pointer : public true_type{}; #endif #endif } // namespace boost -#include - #endif // BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/is_nothrow_move_assignable.hpp b/include/boost/type_traits/is_nothrow_move_assignable.hpp index 3268307..c0edf37 100644 --- a/include/boost/type_traits/is_nothrow_move_assignable.hpp +++ b/include/boost/type_traits/is_nothrow_move_assignable.hpp @@ -16,37 +16,25 @@ #include #include #include -#include -#include -#include #include #include -// should be the last #include -#include - namespace boost { -namespace detail{ - #ifdef BOOST_IS_NOTHROW_MOVE_ASSIGN template -struct is_nothrow_move_assignable_imp{ BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_NOTHROW_MOVE_ASSIGN(T)); }; -template -struct is_nothrow_move_assignable_imp{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template -struct is_nothrow_move_assignable_imp{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template -struct is_nothrow_move_assignable_imp{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template -struct is_nothrow_move_assignable_imp{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template -struct is_nothrow_move_assignable_imp{ BOOST_STATIC_CONSTANT(bool, value = false); }; - +struct is_nothrow_move_assignable : public integral_constant{}; +template struct is_nothrow_move_assignable : public false_type{}; +template struct is_nothrow_move_assignable : public false_type{}; +template struct is_nothrow_move_assignable : public false_type{}; +template struct is_nothrow_move_assignable : public false_type{}; +template struct is_nothrow_move_assignable : public false_type{}; #elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) +namespace detail{ + template struct false_or_cpp11_noexcept_move_assignable: public ::boost::false_type {}; @@ -57,52 +45,35 @@ struct false_or_cpp11_noexcept_move_assignable < > : public ::boost::integral_constant() = ::boost::declval())> {}; -template -struct is_nothrow_move_assignable_imp{ - BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::false_or_cpp11_noexcept_move_assignable::value); -}; +} template -struct is_nothrow_move_assignable_imp : public ::boost::false_type {}; -template -struct is_nothrow_move_assignable_imp : public ::boost::false_type{}; -template -struct is_nothrow_move_assignable_imp : public ::boost::false_type{}; -template -struct is_nothrow_move_assignable_imp : public ::boost::false_type{}; +struct is_nothrow_move_assignable : public integral_constant::value>{}; + +template struct is_nothrow_move_assignable : public ::boost::false_type {}; +template struct is_nothrow_move_assignable : public ::boost::false_type{}; +template struct is_nothrow_move_assignable : public ::boost::false_type{}; +template struct is_nothrow_move_assignable : public ::boost::false_type{}; #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -template -struct is_nothrow_move_assignable_imp : public ::boost::false_type{}; +template struct is_nothrow_move_assignable : public ::boost::false_type{}; #endif #else template -struct is_nothrow_move_assignable_imp{ - BOOST_STATIC_CONSTANT(bool, value = ( - ::boost::type_traits::ice_and< - ::boost::type_traits::ice_or< - ::boost::has_trivial_move_assign::value, - ::boost::has_nothrow_assign::value - >::value, - ::boost::type_traits::ice_not< ::boost::is_array::value >::value - >::value)); -}; +struct is_nothrow_move_assignable : public integral_constant::value || ::boost::has_nothrow_assign::value) && ! ::boost::is_array::value>{}; #endif -} -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_nothrow_move_assignable,T,::boost::detail::is_nothrow_move_assignable_imp::value) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_assignable,void,false) +template <> struct is_nothrow_move_assignable : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_assignable,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_assignable,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_assignable,void volatile,false) +template <> struct is_nothrow_move_assignable : public false_type{}; +template <> struct is_nothrow_move_assignable : public false_type{}; +template <> struct is_nothrow_move_assignable : public false_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_NOTHROW_MOVE_ASSIGNABLE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_nothrow_move_constructible.hpp b/include/boost/type_traits/is_nothrow_move_constructible.hpp index c09d5d1..09c0d88 100644 --- a/include/boost/type_traits/is_nothrow_move_constructible.hpp +++ b/include/boost/type_traits/is_nothrow_move_constructible.hpp @@ -13,42 +13,29 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include - -// should be the last #include -#include - -namespace boost { - -namespace detail{ +#include #ifdef BOOST_IS_NOTHROW_MOVE_CONSTRUCT -template -struct is_nothrow_move_constructible_imp{ - BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_NOTHROW_MOVE_CONSTRUCT(T)); -}; +namespace boost { template -struct is_nothrow_move_constructible_imp : public ::boost::false_type {}; -template -struct is_nothrow_move_constructible_imp : public ::boost::false_type{}; -template -struct is_nothrow_move_constructible_imp : public ::boost::false_type{}; +struct is_nothrow_move_constructible : public integral_constant{}; + +template struct is_nothrow_move_constructible : public ::boost::false_type {}; +template struct is_nothrow_move_constructible : public ::boost::false_type{}; +template struct is_nothrow_move_constructible : public ::boost::false_type{}; #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -template -struct is_nothrow_move_constructible_imp : public ::boost::false_type{}; +template struct is_nothrow_move_constructible : public ::boost::false_type{}; #endif #elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) +#include +#include + +namespace boost{ namespace detail{ + template struct false_or_cpp11_noexcept_move_constructible: public ::boost::false_type {}; @@ -59,51 +46,41 @@ struct false_or_cpp11_noexcept_move_constructible < > : public ::boost::integral_constant()))> {}; -template -struct is_nothrow_move_constructible_imp{ - BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::false_or_cpp11_noexcept_move_constructible::value); -}; +} -template -struct is_nothrow_move_constructible_imp : public ::boost::false_type {}; -template -struct is_nothrow_move_constructible_imp : public ::boost::false_type{}; -template -struct is_nothrow_move_constructible_imp : public ::boost::false_type{}; +template struct is_nothrow_move_constructible + : public integral_constant::value>{}; + +template struct is_nothrow_move_constructible : public ::boost::false_type {}; +template struct is_nothrow_move_constructible : public ::boost::false_type{}; +template struct is_nothrow_move_constructible : public ::boost::false_type{}; #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -template -struct is_nothrow_move_constructible_imp : public ::boost::false_type{}; +template struct is_nothrow_move_constructible : public ::boost::false_type{}; #endif #else +#include +#include +#include + +namespace boost{ + template -struct is_nothrow_move_constructible_imp{ - BOOST_STATIC_CONSTANT(bool, value =( - ::boost::type_traits::ice_and< - ::boost::type_traits::ice_or< - ::boost::has_trivial_move_constructor::value, - ::boost::has_nothrow_copy::value - >::value, - ::boost::type_traits::ice_not< ::boost::is_array::value >::value - >::value)); -}; +struct is_nothrow_move_constructible + : public integral_constant::value || ::boost::has_nothrow_copy::value) && !::boost::is_array::value> +{}; #endif -} - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_nothrow_move_constructible,T,::boost::detail::is_nothrow_move_constructible_imp::value) - -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_constructible,void,false) +template <> struct is_nothrow_move_constructible : false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_constructible,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_constructible,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_constructible,void volatile,false) +template <> struct is_nothrow_move_constructible : false_type{}; +template <> struct is_nothrow_move_constructible : false_type{}; +template <> struct is_nothrow_move_constructible : false_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_NOTHROW_MOVE_CONSTRUCTIBLE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_object.hpp b/include/boost/type_traits/is_object.hpp index 1d1ae4f..fc9d2f2 100644 --- a/include/boost/type_traits/is_object.hpp +++ b/include/boost/type_traits/is_object.hpp @@ -9,37 +9,20 @@ #ifndef BOOST_TT_IS_OBJECT_HPP_INCLUDED #define BOOST_TT_IS_OBJECT_HPP_INCLUDED +#include #include #include #include -#include -#include -#include - -// should be the last #include -#include namespace boost { -namespace detail { - -template -struct is_object_impl -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - ::boost::type_traits::ice_not< ::boost::is_reference::value>::value, - ::boost::type_traits::ice_not< ::boost::is_void::value>::value, - ::boost::type_traits::ice_not< ::boost::is_function::value>::value - >::value)); -}; - -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_object,T,::boost::detail::is_object_impl::value) +template struct is_object + : public + integral_constant< + bool, + ! ::boost::is_reference::value && ! ::boost::is_void::value && ! ::boost::is_function::value > +{}; } // namespace boost -#include - #endif // BOOST_TT_IS_OBJECT_HPP_INCLUDED diff --git a/include/boost/type_traits/is_pod.hpp b/include/boost/type_traits/is_pod.hpp index 820a3ce..9764a2c 100644 --- a/include/boost/type_traits/is_pod.hpp +++ b/include/boost/type_traits/is_pod.hpp @@ -9,17 +9,13 @@ #ifndef BOOST_TT_IS_POD_HPP_INCLUDED #define BOOST_TT_IS_POD_HPP_INCLUDED -#include +#include #include #include -#include #include #include -// should be the last #include -#include - #ifndef BOOST_IS_POD #define BOOST_INTERNAL_IS_POD(T) false #else @@ -31,49 +27,28 @@ namespace boost { // forward declaration, needed by 'is_pod_array_helper' template below template< typename T > struct is_POD; -namespace detail { - - -template struct is_pod_impl -{ - BOOST_STATIC_CONSTANT( - bool, value = - (::boost::type_traits::ice_or< - ::boost::is_scalar::value, - ::boost::is_void::value, - BOOST_INTERNAL_IS_POD(T) - >::value)); -}; +template struct is_pod +: public integral_constant::value || ::boost::is_void::value || BOOST_INTERNAL_IS_POD(T)> +{}; #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) -template -struct is_pod_impl - : public is_pod_impl -{ -}; +template struct is_pod : public is_pod{}; #endif // the following help compilers without partial specialization support: -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,void,true) +template<> struct is_pod : public true_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,void const,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,void volatile,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,void const volatile,true) +template<> struct is_pod : public true_type{}; +template<> struct is_pod : public true_type{}; +template<> struct is_pod : public true_type{}; #endif -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pod,T,::boost::detail::is_pod_impl::value) -// is_POD is the old depricated name for this trait, do not use this as it may -// be removed in future without warning!! -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_POD,T,::boost::is_pod::value) +template struct is_POD : public is_pod{}; } // namespace boost -#include - #undef BOOST_INTERNAL_IS_POD #endif // BOOST_TT_IS_POD_HPP_INCLUDED diff --git a/include/boost/type_traits/is_pointer.hpp b/include/boost/type_traits/is_pointer.hpp index aad30f2..44b06c2 100644 --- a/include/boost/type_traits/is_pointer.hpp +++ b/include/boost/type_traits/is_pointer.hpp @@ -21,68 +21,27 @@ #ifndef BOOST_TT_IS_POINTER_HPP_INCLUDED #define BOOST_TT_IS_POINTER_HPP_INCLUDED -#include -#include -#include -#include -#include - - -// should be the last #include -#include +#include namespace boost { #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pointer,T,__is_pointer(T)) +template struct is_pointer : public integral_constant{}; #else +template struct is_pointer : public false_type{}; +template struct is_pointer : public true_type{}; +template struct is_pointer : public true_type{}; +template struct is_pointer : public true_type{}; +template struct is_pointer : public true_type{}; -namespace detail { - -template< typename T > struct is_pointer_helper -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; - -# define TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(helper,sp,result) \ -template< typename T > struct helper \ -{ \ - BOOST_STATIC_CONSTANT(bool, value = result); \ -}; \ -/**/ - -TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T*,true) - -# undef TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC - -template< typename T > -struct is_pointer_impl -{ - 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) - ); -}; - -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pointer,T,::boost::detail::is_pointer_impl::value) - -#if defined(__BORLANDC__) && !defined(__COMO__) && (__BORLANDC__ < 0x600) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T&,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T& const,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T& volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T& const volatile,false) +#ifdef BOOST_MSVC +template struct is_pointer : public is_pointer{}; +template struct is_pointer : public is_pointer{}; +template struct is_pointer : public is_pointer{}; #endif #endif } // namespace boost -#include - #endif // BOOST_TT_IS_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/is_polymorphic.hpp b/include/boost/type_traits/is_polymorphic.hpp index aac9851..722d8b4 100644 --- a/include/boost/type_traits/is_polymorphic.hpp +++ b/include/boost/type_traits/is_polymorphic.hpp @@ -9,12 +9,10 @@ #define BOOST_TT_IS_POLYMORPHIC_HPP #include +#include #ifndef BOOST_IS_POLYMORPHIC #include -#include #endif -// should be the last #include -#include #include #if defined(BOOST_MSVC) && (BOOST_MSVC >= 1700) @@ -34,8 +32,7 @@ struct is_polymorphic_imp1 # if BOOST_WORKAROUND(__MWERKS__, <= 0x2407) // CWPro7 should return false always. typedef char d1, (&d2)[2]; # else - typedef typename remove_cv::type ncvT; - struct d1 : public ncvT + struct d1 : public T { d1(); # if !defined(__GNUC__) // this raises warnings with some classes, and buys nothing with GCC @@ -47,7 +44,7 @@ struct is_polymorphic_imp1 d1(const d1&); d1& operator=(const d1&); }; - struct d2 : public ncvT + struct d2 : public T { d2(); virtual ~d2()throw(); @@ -67,6 +64,10 @@ struct is_polymorphic_imp1 BOOST_STATIC_CONSTANT(bool, value = (sizeof(d2) == sizeof(d1))); }; +template struct is_polymorphic_imp1 : public is_polymorphic_imp1{}; +template struct is_polymorphic_imp1 : public is_polymorphic_imp1{}; +template struct is_polymorphic_imp1 : public is_polymorphic_imp1{}; + template struct is_polymorphic_imp2 { @@ -104,18 +105,16 @@ struct is_polymorphic_imp } // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_polymorphic,T,::boost::detail::is_polymorphic_imp::value) +template struct is_polymorphic : public integral_constant::value> {}; #else // BOOST_IS_POLYMORPHIC -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_polymorphic,T,BOOST_IS_POLYMORPHIC(T)) +template struct is_polymorphic : public integral_constant {}; #endif } // namespace boost -#include - #if defined(BOOST_MSVC) && (BOOST_MSVC >= 1700) #pragma warning(pop) #endif diff --git a/include/boost/type_traits/is_reference.hpp b/include/boost/type_traits/is_reference.hpp index 49b5f9f..85f0a63 100644 --- a/include/boost/type_traits/is_reference.hpp +++ b/include/boost/type_traits/is_reference.hpp @@ -12,34 +12,19 @@ #ifndef BOOST_TT_IS_REFERENCE_HPP_INCLUDED #define BOOST_TT_IS_REFERENCE_HPP_INCLUDED -#include #include #include -#include - -// should be the last #include -#include namespace boost { -namespace detail { - -template -struct is_reference_impl -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::is_lvalue_reference::value, ::boost::is_rvalue_reference::value - >::value)); -}; - -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_reference,T,::boost::detail::is_reference_impl::value) +template struct is_reference + : public + integral_constant< + bool, + ::boost::is_lvalue_reference::value || ::boost::is_rvalue_reference::value> +{}; } // namespace boost -#include - #endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_rvalue_reference.hpp b/include/boost/type_traits/is_rvalue_reference.hpp index 93cd0bf..50e88ed 100644 --- a/include/boost/type_traits/is_rvalue_reference.hpp +++ b/include/boost/type_traits/is_rvalue_reference.hpp @@ -9,21 +9,17 @@ #ifndef BOOST_TT_IS_RVALUE_REFERENCE_HPP_INCLUDED #define BOOST_TT_IS_RVALUE_REFERENCE_HPP_INCLUDED -#include - -// should be the last #include -#include +#include +#include namespace boost { -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_rvalue_reference,T,false) +template struct is_rvalue_reference : public false_type {}; #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_rvalue_reference,T&&,true) +template struct is_rvalue_reference : public true_type {}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_same.hpp b/include/boost/type_traits/is_same.hpp index c8987b0..d16f4b2 100644 --- a/include/boost/type_traits/is_same.hpp +++ b/include/boost/type_traits/is_same.hpp @@ -21,25 +21,21 @@ #ifndef BOOST_TT_IS_SAME_HPP_INCLUDED #define BOOST_TT_IS_SAME_HPP_INCLUDED -#include -// should be the last #include -#include +#include namespace boost { -BOOST_TT_AUX_BOOL_TRAIT_DEF2(is_same,T,U,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename T,is_same,T,T,true) + template struct is_same : public false_type {}; + template struct is_same : public true_type {}; #if BOOST_WORKAROUND(__BORLANDC__, < 0x600) // without this, Borland's compiler gives the wrong answer for // references to arrays: -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename T,is_same,T&,T&,true) + template struct is_same : public true_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_SAME_HPP_INCLUDED diff --git a/include/boost/type_traits/is_scalar.hpp b/include/boost/type_traits/is_scalar.hpp index 4af3def..3031440 100644 --- a/include/boost/type_traits/is_scalar.hpp +++ b/include/boost/type_traits/is_scalar.hpp @@ -13,43 +13,15 @@ #include #include #include -#include #include -// should be the last #include -#include - namespace boost { -namespace detail { - template -struct is_scalar_impl -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::is_arithmetic::value, - ::boost::is_enum::value, - ::boost::is_pointer::value, - ::boost::is_member_pointer::value - >::value)); -}; - -// these specializations are only really needed for compilers -// without partial specialization support: -template <> struct is_scalar_impl{ BOOST_STATIC_CONSTANT(bool, value = false ); }; -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -template <> struct is_scalar_impl{ BOOST_STATIC_CONSTANT(bool, value = false ); }; -template <> struct is_scalar_impl{ BOOST_STATIC_CONSTANT(bool, value = false ); }; -template <> struct is_scalar_impl{ BOOST_STATIC_CONSTANT(bool, value = false ); }; -#endif - -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_scalar,T,::boost::detail::is_scalar_impl::value) +struct is_scalar + : public integral_constant::value || ::boost::is_enum::value || ::boost::is_pointer::value || ::boost::is_member_pointer::value> +{}; } // namespace boost -#include - #endif // BOOST_TT_IS_SCALAR_HPP_INCLUDED diff --git a/include/boost/type_traits/is_signed.hpp b/include/boost/type_traits/is_signed.hpp index 5673284..48facd3 100644 --- a/include/boost/type_traits/is_signed.hpp +++ b/include/boost/type_traits/is_signed.hpp @@ -13,19 +13,16 @@ #include #include #include -#include - -// should be the last #include -#include +#include namespace boost { #if !defined( __CODEGEARC__ ) -namespace detail{ - #if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) && !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION) +namespace detail{ + template struct is_signed_values { @@ -67,70 +64,98 @@ struct is_signed_select_helper }; template -struct is_signed_imp +struct is_signed_impl { - typedef is_signed_select_helper< - ::boost::type_traits::ice_or< - ::boost::is_integral::value, - ::boost::is_enum::value>::value - > selector; + typedef ::boost::detail::is_signed_select_helper< ::boost::is_integral::value || ::boost::is_enum::value> selector; typedef typename selector::template rebind binder; typedef typename binder::type type; BOOST_STATIC_CONSTANT(bool, value = type::value); }; -#else - -template struct is_signed_imp : public false_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -#ifdef BOOST_HAS_LONG_LONG -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -#endif -#if defined(CHAR_MIN) && (CHAR_MIN != 0) -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -#endif -#if defined(WCHAR_MIN) && (WCHAR_MIN != 0) -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -#endif - -#endif - } -#endif // !defined( __CODEGEARC__ ) +template struct is_signed : public integral_constant::value> {}; -#if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_signed,T,__is_signed(T)) #else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_signed,T,::boost::detail::is_signed_imp::value) + +template struct is_signed : public false_type{}; + #endif +#else //defined( __CODEGEARC__ ) + template struct is_signed : public integral_constant{}; +#endif + +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; + +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +#ifdef BOOST_HAS_LONG_LONG +template <> struct is_signed< ::boost::long_long_type> : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; + +template <> struct is_signed< ::boost::ulong_long_type> : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +#endif +#if defined(CHAR_MIN) +#if CHAR_MIN != 0 +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +#else +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +#endif +#endif +#if defined(WCHAR_MIN) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) +#if WCHAR_MIN != 0 +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +#else +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +#endif +#endif } // namespace boost -#include - #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/is_stateless.hpp b/include/boost/type_traits/is_stateless.hpp index d8d4063..f9266da 100644 --- a/include/boost/type_traits/is_stateless.hpp +++ b/include/boost/type_traits/is_stateless.hpp @@ -14,35 +14,20 @@ #include #include #include -#include #include -// should be the last #include -#include - namespace boost { -namespace detail { - template -struct is_stateless_impl -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - ::boost::has_trivial_constructor::value, - ::boost::has_trivial_copy::value, - ::boost::has_trivial_destructor::value, - ::boost::is_class::value, - ::boost::is_empty::value - >::value)); -}; - -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_stateless,T,::boost::detail::is_stateless_impl::value) +struct is_stateless + : public integral_constant::value + && ::boost::has_trivial_copy::value + && ::boost::has_trivial_destructor::value + && ::boost::is_class::value + && ::boost::is_empty::value)> +{}; } // namespace boost -#include - #endif // BOOST_TT_IS_STATELESS_HPP_INCLUDED diff --git a/include/boost/type_traits/is_union.hpp b/include/boost/type_traits/is_union.hpp index 610f162..c5e1a96 100644 --- a/include/boost/type_traits/is_union.hpp +++ b/include/boost/type_traits/is_union.hpp @@ -11,47 +11,21 @@ #ifndef BOOST_TT_IS_UNION_HPP_INCLUDED #define BOOST_TT_IS_UNION_HPP_INCLUDED -#include -#include #include - -// should be the last #include -#include +#include namespace boost { -namespace detail { -#ifndef __GNUC__ -template struct is_union_impl -{ - typedef typename remove_cv::type cvt; #ifdef BOOST_IS_UNION - BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(cvt)); +template struct is_union : public integral_constant {}; #else - BOOST_STATIC_CONSTANT(bool, value = false); +template struct is_union : public integral_constant {}; #endif -}; -#else -// -// using remove_cv here generates a whole load of needless -// warnings with gcc, since it doesn't do any good with gcc -// in any case (at least at present), just remove it: -// -template struct is_union_impl -{ -#ifdef BOOST_IS_UNION - BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(T)); -#else - BOOST_STATIC_CONSTANT(bool, value = false); -#endif -}; -#endif -} // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_union,T,::boost::detail::is_union_impl::value) +template struct is_union : public is_union{}; +template struct is_union : public is_union{}; +template struct is_union : public is_union{}; } // namespace boost -#include - #endif // BOOST_TT_IS_UNION_HPP_INCLUDED diff --git a/include/boost/type_traits/is_unsigned.hpp b/include/boost/type_traits/is_unsigned.hpp index 0602838..309f3ed 100644 --- a/include/boost/type_traits/is_unsigned.hpp +++ b/include/boost/type_traits/is_unsigned.hpp @@ -13,19 +13,17 @@ #include #include #include -#include -// should be the last #include -#include +#include namespace boost { #if !defined( __CODEGEARC__ ) -namespace detail{ - #if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) && !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION) +namespace detail{ + template struct is_unsigned_values { @@ -46,7 +44,7 @@ struct is_ununsigned_helper }; template -struct is_ununsigned_select_helper +struct is_unsigned_select_helper { template struct rebind @@ -56,7 +54,7 @@ struct is_ununsigned_select_helper }; template <> -struct is_ununsigned_select_helper +struct is_unsigned_select_helper { template struct rebind @@ -66,70 +64,98 @@ struct is_ununsigned_select_helper }; template -struct is_unsigned_imp +struct is_unsigned { - typedef is_ununsigned_select_helper< - ::boost::type_traits::ice_or< - ::boost::is_integral::value, - ::boost::is_enum::value>::value - > selector; + typedef ::boost::detail::is_unsigned_select_helper< ::boost::is_integral::value || ::boost::is_enum::value > selector; typedef typename selector::template rebind binder; typedef typename binder::type type; BOOST_STATIC_CONSTANT(bool, value = type::value); }; +} // namespace detail + +template struct is_unsigned : public integral_constant::value> {}; + #else -template struct is_unsigned_imp : public false_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; +template struct is_unsigned : public false_type{}; + +#endif + +#else // defined( __CODEGEARC__ ) +template struct is_unsigned : public integral_constant {}; +#endif + +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; + +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned< short> : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned< int> : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned< long> : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; #ifdef BOOST_HAS_LONG_LONG -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -#endif -#if defined(CHAR_MIN) && (CHAR_MIN == 0) -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -#endif -#if defined(WCHAR_MIN) && (WCHAR_MIN == 0) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -#endif +template <> struct is_unsigned< ::boost::ulong_long_type> : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned< ::boost::long_long_type> : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; #endif - -} - -#endif // !defined( __CODEGEARC__ ) - -#if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_unsigned,T,__is_unsigned(T)) +#if defined(CHAR_MIN) +#if CHAR_MIN == 0 +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; #else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_unsigned,T,::boost::detail::is_unsigned_imp::value) +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +#endif +#endif +#if !defined(BOOST_NO_INTRINSIC_WCHAR_T) && defined(WCHAR_MIN) +#if WCHAR_MIN == 0 +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +#else +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +#endif #endif - } // namespace boost -#include - #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/is_virtual_base_of.hpp b/include/boost/type_traits/is_virtual_base_of.hpp index 3daad1b..f005256 100644 --- a/include/boost/type_traits/is_virtual_base_of.hpp +++ b/include/boost/type_traits/is_virtual_base_of.hpp @@ -10,11 +10,6 @@ #include #include -#include -#include - -// should be the last #include -#include namespace boost { namespace detail { @@ -34,7 +29,7 @@ struct is_virtual_base_of_impl }; template -struct is_virtual_base_of_impl +struct is_virtual_base_of_impl { union max_align { @@ -88,7 +83,7 @@ struct is_virtual_base_of_impl template struct is_virtual_base_of_impl2 { - typedef typename mpl::and_, mpl::not_ > >::type tag_type; + typedef boost::integral_constant::value && ! boost::is_same::value)> tag_type; typedef is_virtual_base_of_impl imp; BOOST_STATIC_CONSTANT(bool, value = imp::value); }; @@ -99,19 +94,12 @@ struct is_virtual_base_of_impl2 } // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF2( - is_virtual_base_of - , Base - , Derived - , (::boost::detail::is_virtual_base_of_impl2::value) -) +template struct is_virtual_base_of : public integral_constant::value)>{}; -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_virtual_base_of,Base&,Derived,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_virtual_base_of,Base,Derived&,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_virtual_base_of,Base&,Derived&,false) +template struct is_virtual_base_of : public false_type{}; +template struct is_virtual_base_of : public false_type{}; +template struct is_virtual_base_of : public false_type{}; } // namespace boost -#include - #endif diff --git a/include/boost/type_traits/is_void.hpp b/include/boost/type_traits/is_void.hpp index 6f6fbff..183f8ab 100644 --- a/include/boost/type_traits/is_void.hpp +++ b/include/boost/type_traits/is_void.hpp @@ -9,30 +9,18 @@ #ifndef BOOST_TT_IS_VOID_HPP_INCLUDED #define BOOST_TT_IS_VOID_HPP_INCLUDED -#include - -// should be the last #include -#include +#include namespace boost { -//* is a type T void - is_void -#if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_void,T,__is_void(T)) -#else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_void,T,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void,true) +template +struct is_void : public false_type {}; -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void const,true) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void volatile,true) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void const volatile,true) -#endif - -#endif // non-CodeGear implementation +template<> struct is_void : public true_type {}; +template<> struct is_void : public true_type{}; +template<> struct is_void : public true_type{}; +template<> struct is_void : public true_type{}; } // namespace boost -#include - #endif // BOOST_TT_IS_VOID_HPP_INCLUDED diff --git a/include/boost/type_traits/is_volatile.hpp b/include/boost/type_traits/is_volatile.hpp index d9839da..cefe987 100644 --- a/include/boost/type_traits/is_volatile.hpp +++ b/include/boost/type_traits/is_volatile.hpp @@ -21,64 +21,25 @@ #ifndef BOOST_TT_IS_VOLATILE_HPP_INCLUDED #define BOOST_TT_IS_VOLATILE_HPP_INCLUDED -#include -#include - -# include -# if BOOST_WORKAROUND(BOOST_MSVC, < 1400) -# include -# endif - -// should be the last #include -#include +#include namespace boost { -namespace detail{ -template -struct is_volatile_rval_filter -{ -#if BOOST_WORKAROUND(BOOST_MSVC, < 1400) - BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp::type*>::is_volatile); -#else - BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp::is_volatile); -#endif -}; -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -// -// We can't filter out rvalue_references at the same level as -// references or we get ambiguities from msvc: -// -template -struct is_volatile_rval_filter -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -#endif -} - #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,__is_volatile(T)) + + template + struct is_volatile : public integral_constant {}; + #else -//* is a type T declared volatile - is_volatile -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,::boost::detail::is_volatile_rval_filter::value) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T&,false) - -#if defined(BOOST_ILLEGAL_CV_REFERENCES) -// these are illegal specialisations; cv-qualifies applied to -// references have no effect according to [8.3.2p1], -// C++ Builder requires them though as it treats cv-qualified -// references as distinct types... -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T& const,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T& volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T& const volatile,false) -#endif + template + struct is_volatile : public false_type {}; + template struct is_volatile : public true_type{}; + template struct is_volatile : public true_type{}; + template struct is_volatile : public true_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_VOLATILE_HPP_INCLUDED diff --git a/include/boost/type_traits/make_signed.hpp b/include/boost/type_traits/make_signed.hpp index 51cdbb0..0d2d5df 100644 --- a/include/boost/type_traits/make_signed.hpp +++ b/include/boost/type_traits/make_signed.hpp @@ -9,7 +9,7 @@ #ifndef BOOST_TT_MAKE_SIGNED_HPP_INCLUDED #define BOOST_TT_MAKE_SIGNED_HPP_INCLUDED -#include +#include #include #include #include @@ -20,58 +20,45 @@ #include #include #include -#include -#include -#include #include -// should be the last #include -#include - namespace boost { -namespace detail { - template -struct make_signed_imp +struct make_signed { - BOOST_STATIC_ASSERT( - (::boost::type_traits::ice_or< ::boost::is_integral::value, ::boost::is_enum::value>::value)); - BOOST_STATIC_ASSERT( - (::boost::type_traits::ice_not< ::boost::is_same< - typename remove_cv::type, bool>::value>::value)); +private: + BOOST_STATIC_ASSERT_MSG(( ::boost::is_integral::value || ::boost::is_enum::value), "The template argument to make_signed must be an integer or enum type."); + BOOST_STATIC_ASSERT_MSG(!(::boost::is_same::type, bool>::value), "The template argument to make_signed must not be the type bool."); 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), + typedef typename conditional< + (::boost::is_signed::value + && ::boost::is_integral::value + && ! ::boost::is_same::value + && ! ::boost::is_same::value + && ! ::boost::is_same::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, + typename conditional< + (::boost::is_integral::value + && ! ::boost::is_same::value + && ! ::boost::is_same::value + && ! ::boost::is_same::value), + typename conditional< + is_same::value, signed char, - typename mpl::if_< - is_same, + typename conditional< + is_same::value, signed short, - typename mpl::if_< - is_same, + typename conditional< + is_same::value, int, - typename mpl::if_< - is_same, + typename conditional< + is_same::value, long, #if defined(BOOST_HAS_LONG_LONG) #ifdef BOOST_HAS_INT128 - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(boost::long_long_type), boost::long_long_type, boost::int128_type @@ -89,21 +76,21 @@ struct make_signed_imp >::type >::type, // Not a regular integer type: - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(unsigned char), signed char, - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(unsigned short), signed short, - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(unsigned int), int, - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(unsigned long), long, #if defined(BOOST_HAS_LONG_LONG) #ifdef BOOST_HAS_INT128 - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(boost::long_long_type), boost::long_long_type, boost::int128_type @@ -124,28 +111,21 @@ struct make_signed_imp >::type base_integer_type; // Add back any const qualifier: - typedef typename mpl::if_< - is_const, + typedef typename conditional< + is_const::value, typename add_const::type, base_integer_type >::type const_base_integer_type; - +public: // Add back any volatile qualifier: - typedef typename mpl::if_< - is_volatile, + typedef typename conditional< + is_volatile::value, 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 index 239153a..4b21eba 100644 --- a/include/boost/type_traits/make_unsigned.hpp +++ b/include/boost/type_traits/make_unsigned.hpp @@ -9,7 +9,7 @@ #ifndef BOOST_TT_MAKE_UNSIGNED_HPP_INCLUDED #define BOOST_TT_MAKE_UNSIGNED_HPP_INCLUDED -#include +#include #include #include #include @@ -20,58 +20,44 @@ #include #include #include -#include -#include -#include #include -// should be the last #include -#include - namespace boost { -namespace detail { - template -struct make_unsigned_imp +struct make_unsigned { - BOOST_STATIC_ASSERT( - (::boost::type_traits::ice_or< ::boost::is_integral::value, ::boost::is_enum::value>::value)); - BOOST_STATIC_ASSERT( - (::boost::type_traits::ice_not< ::boost::is_same< - typename remove_cv::type, bool>::value>::value)); +private: + BOOST_STATIC_ASSERT_MSG((::boost::is_integral::value || ::boost::is_enum::value), "The template argument to make_unsigned must be an integer or enum type."); + BOOST_STATIC_ASSERT_MSG((! ::boost::is_same::type, bool>::value), "The template argument to make_unsigned must not be the type bool"); 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), + typedef typename conditional< + (::boost::is_unsigned::value && ::boost::is_integral::value + && ! ::boost::is_same::value + && ! ::boost::is_same::value + && ! ::boost::is_same::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, + typename conditional< + (::boost::is_integral::value + && ! ::boost::is_same::value + && ! ::boost::is_same::value + && ! ::boost::is_same::value), + typename conditional< + is_same::value, unsigned char, - typename mpl::if_< - is_same, + typename conditional< + is_same::value, unsigned short, - typename mpl::if_< - is_same, + typename conditional< + is_same::value, unsigned int, - typename mpl::if_< - is_same, + typename conditional< + is_same::value, unsigned long, #if defined(BOOST_HAS_LONG_LONG) #ifdef BOOST_HAS_INT128 - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(boost::ulong_long_type), boost::ulong_long_type, boost::uint128_type @@ -89,21 +75,21 @@ struct make_unsigned_imp >::type >::type, // Not a regular integer type: - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(unsigned char), unsigned char, - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(unsigned short), unsigned short, - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(unsigned int), unsigned int, - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(unsigned long), unsigned long, #if defined(BOOST_HAS_LONG_LONG) #ifdef BOOST_HAS_INT128 - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(boost::ulong_long_type), boost::ulong_long_type, boost::uint128_type @@ -124,28 +110,21 @@ struct make_unsigned_imp >::type base_integer_type; // Add back any const qualifier: - typedef typename mpl::if_< - is_const, + typedef typename conditional< + is_const::value, typename add_const::type, base_integer_type >::type const_base_integer_type; - +public: // Add back any volatile qualifier: - typedef typename mpl::if_< - is_volatile, + typedef typename conditional< + is_volatile::value, 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/include/boost/type_traits/promote.hpp b/include/boost/type_traits/promote.hpp index 60f6278..587617a 100644 --- a/include/boost/type_traits/promote.hpp +++ b/include/boost/type_traits/promote.hpp @@ -10,31 +10,11 @@ #include #include -// Should be the last #include -#include - namespace boost { -namespace detail { - -template -struct promote_impl - : public integral_promotion< - BOOST_DEDUCED_TYPENAME floating_point_promotion::type - > -{ -}; +template struct promote : public integral_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/include/boost/type_traits/rank.hpp b/include/boost/type_traits/rank.hpp index 33f46c8..3dfc693 100644 --- a/include/boost/type_traits/rank.hpp +++ b/include/boost/type_traits/rank.hpp @@ -10,8 +10,7 @@ #ifndef BOOST_TT_RANK_HPP_INCLUDED #define BOOST_TT_RANK_HPP_INCLUDED -// should be the last #include -#include +#include namespace boost { @@ -77,13 +76,11 @@ struct rank_imp #endif // !defined( __CODEGEARC__ ) #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(rank,T,__array_rank(T)) +template struct rank : public integral_constant{}; #else -BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(rank,T,(::boost::detail::rank_imp::value)) +template struct rank : public integral_constant::value)>{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_all_extents.hpp b/include/boost/type_traits/remove_all_extents.hpp index 1409da1..3ccdc98 100644 --- a/include/boost/type_traits/remove_all_extents.hpp +++ b/include/boost/type_traits/remove_all_extents.hpp @@ -13,28 +13,23 @@ #include #include -// should be the last #include -#include - namespace boost { -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_all_extents,T,T) +template struct remove_all_extents{ typedef T type; }; #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_all_extents,T[N],typename boost::remove_all_extents::type type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_all_extents,T const[N],typename boost::remove_all_extents::type type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_all_extents,T volatile[N],typename boost::remove_all_extents::type type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_all_extents,T const volatile[N],typename boost::remove_all_extents::type type) +template struct remove_all_extents : public remove_all_extents{}; +template struct remove_all_extents : public remove_all_extents{}; +template struct remove_all_extents : public remove_all_extents{}; +template struct remove_all_extents : public remove_all_extents{}; #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_all_extents,T[],typename boost::remove_all_extents::type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_all_extents,T const[],typename boost::remove_all_extents::type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_all_extents,T volatile[],typename boost::remove_all_extents::type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_all_extents,T const volatile[],typename boost::remove_all_extents::type) +template struct remove_all_extents : public remove_all_extents{}; +template struct remove_all_extents : public remove_all_extents{}; +template struct remove_all_extents : public remove_all_extents{}; +template struct remove_all_extents : public remove_all_extents{}; #endif #endif } // namespace boost -#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 2d26348..56988d2 100644 --- a/include/boost/type_traits/remove_bounds.hpp +++ b/include/boost/type_traits/remove_bounds.hpp @@ -9,32 +9,13 @@ #ifndef BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED #define BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED -#include -#include -#include +#include -// should be the last #include -#include +namespace boost +{ -namespace boost { - -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_bounds,T,T) - -#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_bounds,T[N],T type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_bounds,T const[N],T const type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_bounds,T volatile[N],T volatile type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_bounds,T const volatile[N],T const volatile type) -#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_bounds,T[],T) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_bounds,T const[],T const) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_bounds,T volatile[],T volatile) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_bounds,T const volatile[],T const volatile) -#endif -#endif +template struct remove_bounds : public remove_extent {}; } // namespace boost -#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 1020781..b47f851 100644 --- a/include/boost/type_traits/remove_const.hpp +++ b/include/boost/type_traits/remove_const.hpp @@ -11,69 +11,23 @@ #ifndef BOOST_TT_REMOVE_CONST_HPP_INCLUDED #define BOOST_TT_REMOVE_CONST_HPP_INCLUDED -#include -#include #include -#include - #include - -// should be the last #include -#include +#include namespace boost { + // convert a type T to a non-cv-qualified type - remove_const + template struct remove_const{ typedef T type; }; + template struct remove_const{ typedef T type; }; -namespace detail { - -template -struct remove_const_helper -{ - typedef T type; -}; - -template -struct remove_const_helper -{ - typedef T volatile type; -}; - - -template -struct remove_const_impl -{ - typedef typename remove_const_helper< - typename cv_traits_imp::unqualified_type - , ::boost::is_volatile::value - >::type type; -}; - -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -// -// We can't filter out rvalue_references at the same level as -// references or we get ambiguities from msvc: -// -template -struct remove_const_impl -{ - typedef T&& type; -}; -#endif - -} // namespace detail - -// * convert a type T to non-const type - remove_const - -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]) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_const,T const volatile[N],T volatile type[N]) + template struct remove_const{ typedef T type[N]; }; +#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) + template struct remove_const{ typedef T type[]; }; +#endif #endif - } // namespace boost -#include - #endif // BOOST_TT_REMOVE_CONST_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_cv.hpp b/include/boost/type_traits/remove_cv.hpp index 9ba34a1..b50607f 100644 --- a/include/boost/type_traits/remove_cv.hpp +++ b/include/boost/type_traits/remove_cv.hpp @@ -11,53 +11,30 @@ #ifndef BOOST_TT_REMOVE_CV_HPP_INCLUDED #define BOOST_TT_REMOVE_CV_HPP_INCLUDED -#include #include #include - #include -// should be the last #include -#include - namespace boost { + // convert a type T to a non-cv-qualified type - remove_cv +template struct remove_cv{ typedef T type; }; +template struct remove_cv{ typedef T type; }; +template struct remove_cv{ typedef T type; }; +template struct remove_cv{ typedef T type; }; -namespace detail{ - -template -struct rvalue_ref_filter_rem_cv -{ - typedef typename boost::detail::cv_traits_imp::unqualified_type type; -}; - -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -// -// We can't filter out rvalue_references at the same level as -// references or we get ambiguities from msvc: -// -template -struct rvalue_ref_filter_rem_cv -{ - typedef T&& type; -}; -#endif - -} - - -// convert a type T to a non-cv-qualified type - remove_cv -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_cv,T,typename boost::detail::rvalue_ref_filter_rem_cv::type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_cv,T&,T&) #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_cv,T const[N],T type[N]) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_cv,T volatile[N],T type[N]) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_cv,T const volatile[N],T type[N]) +template struct remove_cv{ typedef T type[N]; }; +template struct remove_cv{ typedef T type[N]; }; +template struct remove_cv{ typedef T type[N]; }; +#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) +template struct remove_cv{ typedef T type[]; }; +template struct remove_cv{ typedef T type[]; }; +template struct remove_cv{ typedef T type[]; }; +#endif #endif } // namespace boost -#include - #endif // BOOST_TT_REMOVE_CV_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_extent.hpp b/include/boost/type_traits/remove_extent.hpp index 9c4cdff..0b50a07 100644 --- a/include/boost/type_traits/remove_extent.hpp +++ b/include/boost/type_traits/remove_extent.hpp @@ -13,28 +13,23 @@ #include #include -// should be the last #include -#include - namespace boost { -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_extent,T,T) +template struct remove_extent{ typedef T type; }; #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_extent,T[N],T type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_extent,T const[N],T const type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_extent,T volatile[N],T volatile type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_extent,T const volatile[N],T const volatile type) +template struct remove_extent { typedef T type; }; +template struct remove_extent { typedef T const type; }; +template struct remove_extent { typedef T volatile type; }; +template struct remove_extent { typedef T const volatile type; }; #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_extent,T[],T) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_extent,T const[],T const) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_extent,T volatile[],T volatile) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_extent,T const volatile[],T const volatile) +template struct remove_extent { typedef T type; }; +template struct remove_extent { typedef T const type; }; +template struct remove_extent { typedef T volatile type; }; +template struct remove_extent { typedef T const volatile type; }; #endif #endif } // namespace boost -#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 fef7068..fb79e59 100644 --- a/include/boost/type_traits/remove_pointer.hpp +++ b/include/boost/type_traits/remove_pointer.hpp @@ -10,16 +10,12 @@ #define BOOST_TT_REMOVE_POINTER_HPP_INCLUDED #include -#include #if defined(BOOST_MSVC) #include #include #endif -// should be the last #include -#include - namespace boost { #ifdef BOOST_MSVC @@ -64,20 +60,18 @@ namespace detail{ }; } -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_pointer,T,typename boost::detail::remove_pointer_imp2::type) +template struct remove_pointer{ typedef typename boost::detail::remove_pointer_imp2::type type; }; #else -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_pointer,T,T) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_pointer,T*,T) -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) +template struct remove_pointer{ typedef T type; }; +template struct remove_pointer{ typedef T type; }; +template struct remove_pointer{ typedef T type; }; +template struct remove_pointer{ typedef T type; }; +template struct remove_pointer{ typedef T type; }; #endif } // namespace boost -#include - #endif // BOOST_TT_REMOVE_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_reference.hpp b/include/boost/type_traits/remove_reference.hpp index c59e7e3..f75e677 100644 --- a/include/boost/type_traits/remove_reference.hpp +++ b/include/boost/type_traits/remove_reference.hpp @@ -12,9 +12,6 @@ #include #include -// should be the last #include -#include - namespace boost { @@ -38,22 +35,20 @@ struct remove_rvalue_ref } // namespace detail -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_reference,T,typename boost::detail::remove_rvalue_ref::type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T&,T) +template struct remove_reference{ typedef typename boost::detail::remove_rvalue_ref::type type; }; +template struct remove_reference{ typedef T type; }; #if defined(BOOST_ILLEGAL_CV_REFERENCES) // these are illegal specialisations; cv-qualifies applied to // references have no effect according to [8.3.2p1], // C++ Builder requires them though as it treats cv-qualified // references as distinct types... -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T& const,T) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T& volatile,T) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T& const volatile,T) +template struct remove_reference{ typedef T type; }; +template struct remove_reference{ typedef T type; }; +template struct remove_reference{ typedef T type; }; #endif } // namespace boost -#include - #endif // BOOST_TT_REMOVE_REFERENCE_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_volatile.hpp b/include/boost/type_traits/remove_volatile.hpp index c202776..475e39d 100644 --- a/include/boost/type_traits/remove_volatile.hpp +++ b/include/boost/type_traits/remove_volatile.hpp @@ -11,67 +11,24 @@ #ifndef BOOST_TT_REMOVE_VOLATILE_HPP_INCLUDED #define BOOST_TT_REMOVE_VOLATILE_HPP_INCLUDED -#include -#include #include #include - #include -// should be the last #include -#include - namespace boost { + // convert a type T to a non-cv-qualified type - remove_volatile + template struct remove_volatile{ typedef T type; }; + template struct remove_volatile{ typedef T type; }; -namespace detail { - -template -struct remove_volatile_helper -{ - typedef T type; -}; - -template -struct remove_volatile_helper -{ - typedef T const type; -}; - -template -struct remove_volatile_impl -{ - typedef typename remove_volatile_helper< - typename cv_traits_imp::unqualified_type - , ::boost::is_const::value - >::type type; -}; - -// -// We can't filter out rvalue_references at the same level as -// references or we get ambiguities from msvc: -// -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -template -struct remove_volatile_impl -{ - typedef T&& type; -}; -#endif -} // namespace detail - -// * convert a type T to a non-volatile type - remove_volatile - -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]) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_volatile,T const volatile[N],T const type[N]) + template struct remove_volatile{ typedef T type[N]; }; +#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) + template struct remove_volatile{ typedef T type[]; }; +#endif #endif } // namespace boost -#include - #endif // BOOST_TT_REMOVE_VOLATILE_HPP_INCLUDED diff --git a/include/boost/type_traits/transform_traits_spec.hpp b/include/boost/type_traits/transform_traits_spec.hpp deleted file mode 100644 index b12b5f8..0000000 --- a/include/boost/type_traits/transform_traits_spec.hpp +++ /dev/null @@ -1,14 +0,0 @@ - -// Copyright 2001 Aleksey Gurtovoy. -// 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_TRANSFORM_TRAITS_HPP_INCLUDED -#define BOOST_TT_TRANSFORM_TRAITS_HPP_INCLUDED - -#include - -#endif diff --git a/include/boost/type_traits/type_with_alignment.hpp b/include/boost/type_traits/type_with_alignment.hpp index 7eb66a7..bfd5476 100644 --- a/include/boost/type_traits/type_with_alignment.hpp +++ b/include/boost/type_traits/type_with_alignment.hpp @@ -8,175 +8,83 @@ #ifndef BOOST_TT_TYPE_WITH_ALIGNMENT_INCLUDED #define BOOST_TT_TYPE_WITH_ALIGNMENT_INCLUDED -#include -#include -#include -#include -#include -#include #include #include #include #include - -// should be the last #include -#include - #include +#include #ifdef BOOST_MSVC # pragma warning(push) # pragma warning(disable: 4121) // alignment is sensitive to packing #endif +#ifdef _MSC_VER +#include +#endif + namespace boost { + namespace detail{ #ifndef __BORLANDC__ -namespace detail { + union max_align + { + char c; + short s; + int i; + long l; +#ifndef BOOST_NO_LONG_LONG + boost::long_long_type ll; +#endif +#ifdef BOOST_HAS_INT128 + boost::int128_type i128; +#endif + float f; + double d; + long double ld; +#ifdef BOOST_HAS_FLOAT128 + __float128 f128; +#endif + }; -class alignment_dummy; -typedef void (*function_ptr)(); -typedef int (alignment_dummy::*member_ptr); -typedef int (alignment_dummy::*member_function_ptr)(); +template struct long_double_alignment{ typedef long double type; }; +template struct long_double_alignment{ typedef boost::detail::max_align type; }; -#ifdef BOOST_HAS_LONG_LONG -#define BOOST_TT_ALIGNMENT_BASE_TYPES BOOST_PP_TUPLE_TO_LIST( \ - 12, ( \ - char, short, int, long, ::boost::long_long_type, float, double, long double \ - , void*, function_ptr, member_ptr, member_function_ptr)) -#else -#define BOOST_TT_ALIGNMENT_BASE_TYPES BOOST_PP_TUPLE_TO_LIST( \ - 11, ( \ - char, short, int, long, float, double, long double \ - , void*, function_ptr, member_ptr, member_function_ptr)) +template struct double_alignment{ typedef double type; }; +template struct double_alignment{ typedef typename long_double_alignment::value >= Target>::type type; }; + +#ifndef BOOST_NO_LONG_LONG +template struct long_long_alignment{ typedef boost::long_long_type type; }; +template struct long_long_alignment{ typedef typename double_alignment::value >= Target>::type type; }; #endif -#define BOOST_TT_HAS_ONE_T(D,Data,T) boost::detail::has_one_T< T > +template struct long_alignment{ typedef long type; }; +#ifndef BOOST_NO_LONG_LONG +template struct long_alignment{ typedef typename long_long_alignment::value >= Target>::type type; }; +#else +template struct long_alignment{ typedef typename double_alignment::value >= Target>::type type; }; +#endif -#define BOOST_TT_ALIGNMENT_STRUCT_TYPES \ - BOOST_PP_LIST_TRANSFORM(BOOST_TT_HAS_ONE_T, \ - X, \ - BOOST_TT_ALIGNMENT_BASE_TYPES) +template struct int_alignment{ typedef int type; }; +template struct int_alignment{ typedef typename long_alignment::value >= Target>::type type; }; -#define BOOST_TT_ALIGNMENT_TYPES \ - BOOST_PP_LIST_APPEND(BOOST_TT_ALIGNMENT_BASE_TYPES, \ - BOOST_TT_ALIGNMENT_STRUCT_TYPES) +template struct short_alignment{ typedef short type; }; +template struct short_alignment{ typedef typename int_alignment::value >= Target>::type type; }; -// -// lower_alignment_helper -- -// -// This template gets instantiated a lot, so use partial -// specialization when available to reduce the compiler burden. -// -template -struct lower_alignment_helper -{ - typedef char type; - enum { value = true }; -}; - -template -struct lower_alignment_helper -{ - enum { value = (alignment_of::value == target) }; - typedef typename mpl::if_c::type type; -}; - -#define BOOST_TT_CHOOSE_MIN_ALIGNMENT(R,P,I,T) \ - typename lower_alignment_helper< \ - BOOST_PP_CAT(found,I),target,T \ - >::type BOOST_PP_CAT(t,I); \ - enum { \ - BOOST_PP_CAT(found,BOOST_PP_INC(I)) \ - = lower_alignment_helper::value \ - }; - -#define BOOST_TT_CHOOSE_T(R,P,I,T) T BOOST_PP_CAT(t,I); - -template -struct has_one_T -{ - T data; -}; - -template -union lower_alignment -{ - enum { found0 = false }; - - BOOST_PP_LIST_FOR_EACH_I( - BOOST_TT_CHOOSE_MIN_ALIGNMENT - , ignored - , BOOST_TT_ALIGNMENT_TYPES - ) -}; - -union max_align -{ - BOOST_PP_LIST_FOR_EACH_I( - BOOST_TT_CHOOSE_T - , ignored - , BOOST_TT_ALIGNMENT_TYPES - ) -}; - -#undef BOOST_TT_ALIGNMENT_BASE_TYPES -#undef BOOST_TT_HAS_ONE_T -#undef BOOST_TT_ALIGNMENT_STRUCT_TYPES -#undef BOOST_TT_ALIGNMENT_TYPES -#undef BOOST_TT_CHOOSE_MIN_ALIGNMENT -#undef BOOST_TT_CHOOSE_T - -template -struct is_aligned -{ - BOOST_STATIC_CONSTANT(bool, - value = (TAlign >= Align) & (TAlign % Align == 0) - ); -}; - - -} // namespace detail - -template -struct is_pod< ::boost::detail::lower_alignment > -{ - BOOST_STATIC_CONSTANT(std::size_t, value = true); -}; - -// This alignment method originally due to Brian Parker, implemented by David -// Abrahams, and then ported here by Doug Gregor. -namespace detail{ - -template -class type_with_alignment_imp -{ - typedef ::boost::detail::lower_alignment t1; - typedef typename mpl::if_c< - ::boost::detail::is_aligned< ::boost::alignment_of::value,Align >::value - , t1 - , ::boost::detail::max_align - >::type align_t; - - BOOST_STATIC_CONSTANT(std::size_t, found = alignment_of::value); - - BOOST_STATIC_ASSERT(found >= Align); - BOOST_STATIC_ASSERT(found % Align == 0); - - public: - typedef align_t type; -}; +template struct char_alignment{ typedef char type; }; +template struct char_alignment{ typedef typename short_alignment::value >= Target>::type type; }; } template -class type_with_alignment - : public ::boost::detail::type_with_alignment_imp +struct type_with_alignment { + typedef typename boost::detail::char_alignment::value >= Align>::type type; }; -#if defined(__GNUC__) || (defined (__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130)) +#if (defined(__GNUC__) || (defined (__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130))) && !defined(BOOST_TT_DISABLE_INTRINSICS) namespace tt_align_ns { struct __attribute__((__aligned__(2))) a2 {}; struct __attribute__((__aligned__(4))) a4 {}; @@ -187,26 +95,25 @@ struct __attribute__((__aligned__(64))) a64 {}; struct __attribute__((__aligned__(128))) a128 {}; } -template<> class type_with_alignment<1> { public: typedef char type; }; -template<> class type_with_alignment<2> { public: typedef tt_align_ns::a2 type; }; -template<> class type_with_alignment<4> { public: typedef tt_align_ns::a4 type; }; -template<> class type_with_alignment<8> { public: typedef tt_align_ns::a8 type; }; -template<> class type_with_alignment<16> { public: typedef tt_align_ns::a16 type; }; -template<> class type_with_alignment<32> { public: typedef tt_align_ns::a32 type; }; -template<> class type_with_alignment<64> { public: typedef tt_align_ns::a64 type; }; -template<> class type_with_alignment<128> { public: typedef tt_align_ns::a128 type; }; +template<> struct type_with_alignment<1> { public: typedef char type; }; +template<> struct type_with_alignment<2> { public: typedef tt_align_ns::a2 type; }; +template<> struct type_with_alignment<4> { public: typedef tt_align_ns::a4 type; }; +template<> struct type_with_alignment<8> { public: typedef tt_align_ns::a8 type; }; +template<> struct type_with_alignment<16> { public: typedef tt_align_ns::a16 type; }; +template<> struct type_with_alignment<32> { public: typedef tt_align_ns::a32 type; }; +template<> struct type_with_alignment<64> { public: typedef tt_align_ns::a64 type; }; +template<> struct type_with_alignment<128> { public: typedef tt_align_ns::a128 type; }; + +template<> struct is_pod< ::boost::tt_align_ns::a2> : public true_type{}; +template<> struct is_pod< ::boost::tt_align_ns::a4> : public true_type{}; +template<> struct is_pod< ::boost::tt_align_ns::a8> : public true_type{}; +template<> struct is_pod< ::boost::tt_align_ns::a16> : public true_type{}; +template<> struct is_pod< ::boost::tt_align_ns::a32> : public true_type{}; +template<> struct is_pod< ::boost::tt_align_ns::a64> : public true_type{}; +template<> struct is_pod< ::boost::tt_align_ns::a128> : public true_type{}; -namespace detail { -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a2,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a4,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a8,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a16,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a32,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a64,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a128,true) -} #endif -#if defined(BOOST_MSVC) || (defined(BOOST_INTEL) && defined(_MSC_VER)) +#if (defined(BOOST_MSVC) || (defined(BOOST_INTEL) && defined(_MSC_VER))) && !defined(BOOST_TT_DISABLE_INTRINSICS) // // MSVC supports types which have alignments greater than the normal // maximum: these are used for example in the types __m64 and __m128 @@ -247,57 +154,56 @@ struct __declspec(align(128)) a128 { }; } -template<> class type_with_alignment<8> +template<> struct type_with_alignment<8> { - typedef mpl::if_c< + typedef boost::conditional< ::boost::alignment_of::value < 8, tt_align_ns::a8, - boost::detail::type_with_alignment_imp<8> >::type t1; + boost::detail::char_alignment<8, false> >::type t1; public: typedef t1::type type; }; -template<> class type_with_alignment<16> +template<> struct type_with_alignment<16> { - typedef mpl::if_c< + typedef boost::conditional< ::boost::alignment_of::value < 16, tt_align_ns::a16, - boost::detail::type_with_alignment_imp<16> >::type t1; + boost::detail::char_alignment<16, false> >::type t1; public: typedef t1::type type; }; -template<> class type_with_alignment<32> +template<> struct type_with_alignment<32> { - typedef mpl::if_c< + typedef boost::conditional< ::boost::alignment_of::value < 32, tt_align_ns::a32, - boost::detail::type_with_alignment_imp<32> >::type t1; + boost::detail::char_alignment<32, false> >::type t1; public: typedef t1::type type; }; -template<> class type_with_alignment<64> { - typedef mpl::if_c< +template<> struct type_with_alignment<64> { + typedef boost::conditional< ::boost::alignment_of::value < 64, tt_align_ns::a64, - boost::detail::type_with_alignment_imp<64> >::type t1; + boost::detail::char_alignment<64, false> >::type t1; public: typedef t1::type type; }; -template<> class type_with_alignment<128> { - typedef mpl::if_c< +template<> struct type_with_alignment<128> { + typedef boost::conditional< ::boost::alignment_of::value < 128, tt_align_ns::a128, - boost::detail::type_with_alignment_imp<128> >::type t1; + boost::detail::char_alignment<128, false> >::type t1; public: typedef t1::type type; }; -namespace detail { -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a8,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a16,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a32,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a64,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a128,true) -} +template<> struct is_pod< ::boost::tt_align_ns::a8> : public true_type{}; +template<> struct is_pod< ::boost::tt_align_ns::a16> : public true_type{}; +template<> struct is_pod< ::boost::tt_align_ns::a32> : public true_type{}; +template<> struct is_pod< ::boost::tt_align_ns::a64> : public true_type{}; +template<> struct is_pod< ::boost::tt_align_ns::a128> : public true_type{}; + #endif #else @@ -321,13 +227,13 @@ namespace detail { typedef ::boost::tt_align_ns::a16 max_align; -//#if ! BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610)) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a2,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a4,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a8,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a16,true) -//#endif } +//#if ! BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610)) +template <> struct is_pod< ::boost::tt_align_ns::a2> : public true_type{}; +template <> struct is_pod< ::boost::tt_align_ns::a4> : public true_type{}; +template <> struct is_pod< ::boost::tt_align_ns::a8> : public true_type{}; +template <> struct is_pod< ::boost::tt_align_ns::a16> : public true_type{}; +//#endif template struct type_with_alignment { @@ -350,8 +256,6 @@ template <> struct type_with_alignment<16>{ typedef tt_align_ns::a16 type; }; # pragma warning(pop) #endif -#include - #endif // BOOST_TT_TYPE_WITH_ALIGNMENT_INCLUDED diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 8f18a9b..0a8d268 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -20,11 +20,12 @@ project : requirements intel:on sun:on msvc:on + libs/tt2/light/include ; rule all-tests { local result ; - for local source in [ glob *_test.cpp ] udt_specialisations.cpp + for local source in [ glob *_test*.cpp ] { result += [ run $(source) ] ; } @@ -33,7 +34,4 @@ rule all-tests { test-suite type_traits : [ all-tests ] ; -compile-fail common_type_fail.cpp ; - - diff --git a/test/aligned_storage_test_a2.cpp b/test/aligned_storage_a2_test.cpp similarity index 98% rename from test/aligned_storage_test_a2.cpp rename to test/aligned_storage_a2_test.cpp index fa7360d..f339359 100644 --- a/test/aligned_storage_test_a2.cpp +++ b/test/aligned_storage_a2_test.cpp @@ -59,7 +59,7 @@ void do_check(const T&) #ifndef TEST_STD // Non-Tr1 behaviour: - typedef typename tt::aligned_storage::type t3; + typedef typename tt::aligned_storage::type t3; t3 as3 = { 0, }; must_be_pod pod3; no_unused_warning(as3); diff --git a/test/common_type_test.cpp b/test/common_type_test.cpp index 111cbb1..047b65f 100644 --- a/test/common_type_test.cpp +++ b/test/common_type_test.cpp @@ -211,5 +211,11 @@ TT_TEST_BEGIN(common_type) #ifndef BOOST_NO_LONG_LONG BOOST_CHECK_TYPE4(tt::common_type::type, boost::long_long_type); #endif + + //changes related to defect LWG2141 + BOOST_CHECK_TYPE(tt::common_type::type, int); + BOOST_CHECK_TYPE(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, long); } TT_TEST_END diff --git a/test/init.cpp b/test/init.cpp deleted file mode 100644 index 95a5a9f..0000000 --- a/test/init.cpp +++ /dev/null @@ -1,23 +0,0 @@ - -// (C) Copyright John Maddock 2000. -// 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" - -boost::unit_test::test_suite* get_master_unit(const char* name) -{ - static boost::unit_test::test_suite* ptest_suite = 0; - if(0 == ptest_suite) - ptest_suite = BOOST_TEST_SUITE( name ? name : "" ); - return ptest_suite; -} - -boost::unit_test::test_suite* init_unit_test_suite ( int , char* [] ) -{ - return get_master_unit(); -} - - - diff --git a/test/is_copy_assignable.cpp b/test/is_copy_assignable_test.cpp similarity index 100% rename from test/is_copy_assignable.cpp rename to test/is_copy_assignable_test.cpp diff --git a/test/is_nothrow_move_constructible_test.cpp b/test/is_nothrow_move_constructible_test.cpp index 9d258ae..a15cacf 100644 --- a/test/is_nothrow_move_constructible_test.cpp +++ b/test/is_nothrow_move_constructible_test.cpp @@ -6,6 +6,7 @@ // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include "test.hpp" +#include #include "check_integral_constant.hpp" #ifdef TEST_STD # include diff --git a/test/is_pointer_test.cpp b/test/is_pointer_test.cpp index 5b71b92..2693e48 100644 --- a/test/is_pointer_test.cpp +++ b/test/is_pointer_test.cpp @@ -50,6 +50,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); diff --git a/test/is_signed_test.cpp b/test/is_signed_test.cpp index c76a97a..66b7e15 100644 --- a/test/is_signed_test.cpp +++ b/test/is_signed_test.cpp @@ -12,6 +12,8 @@ # include #endif +#include + TT_TEST_BEGIN(is_signed) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, true); @@ -35,6 +37,24 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, false); #endif + +#if defined(CHAR_MIN) +#if CHAR_MIN != 0 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, true); +#else +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, false); +#endif +#endif + + +#if defined(WCHAR_MIN) +#if WCHAR_MIN != 0 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, true); +#else +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, false); +#endif +#endif + TT_TEST_END diff --git a/test/is_unsigned_test.cpp b/test/is_unsigned_test.cpp index 484c11e..4323247 100644 --- a/test/is_unsigned_test.cpp +++ b/test/is_unsigned_test.cpp @@ -12,6 +12,8 @@ # include #endif +#include + TT_TEST_BEGIN(is_signed) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned::value, false); @@ -36,6 +38,23 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned::value, fals BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned::value, true); #endif +#if defined(CHAR_MIN) +#if CHAR_MIN != 0 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned::value, false); +#else +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned::value, true); +#endif +#endif + + +#if defined(WCHAR_MIN) +#if WCHAR_MIN != 0 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned::value, false); +#else +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned::value, true); +#endif +#endif + TT_TEST_END diff --git a/test/is_void_test.cpp b/test/is_void_test.cpp index c0a3f09..663702e 100644 --- a/test/is_void_test.cpp +++ b/test/is_void_test.cpp @@ -35,10 +35,3 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void::value, false); TT_TEST_END - - - - - - - diff --git a/test/mpl_interop_test1.cpp b/test/mpl_interop_test1.cpp new file mode 100644 index 0000000..214c951 --- /dev/null +++ b/test/mpl_interop_test1.cpp @@ -0,0 +1,30 @@ + +// (C) Copyright John Maddock 2000. +// 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 + +template +int dispatch_test_imp(const boost::mpl::bool_&) +{ + return 0; +} +template +int dispatch_test_imp(const boost::mpl::bool_&) +{ + return 1; +} + +template +int dispatch_test() +{ + return dispatch_test_imp(boost::is_void()); +} + + +int main() +{ + return (dispatch_test() == 1) && (dispatch_test() == 0) ? 0 : 1; +} \ No newline at end of file diff --git a/test/mpl_interop_test2.cpp b/test/mpl_interop_test2.cpp new file mode 100644 index 0000000..4624e0b --- /dev/null +++ b/test/mpl_interop_test2.cpp @@ -0,0 +1,25 @@ + +// (C) Copyright John Maddock 2000. +// 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 +#include +#include + +template +struct if_test +{ + typedef typename boost::mpl::if_< + boost::is_void, + int, T>::type type; +}; + +if_test::type t1 = 0; +if_test::type t2 = 0; + +int main() +{ + return (int)(t1 + t2); +} \ No newline at end of file diff --git a/test/mpl_interop_test3.cpp b/test/mpl_interop_test3.cpp new file mode 100644 index 0000000..0a4c8ac --- /dev/null +++ b/test/mpl_interop_test3.cpp @@ -0,0 +1,30 @@ + +// (C) Copyright John Maddock 2000. +// 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 +#include +#include +#include +#include +#include +#include + +template +struct lambda_test +{ + typedef typename boost::mpl::remove_if >::type reduced_list; + typedef typename boost::mpl::transform >::type const_list; + typedef typename boost::mpl::front::type type; +}; + + +int main() +{ + typedef boost::mpl::list list_type; + + lambda_test::type i = 0; + return i; +} \ No newline at end of file diff --git a/test/promote_basic_test.cpp b/test/promote_basic_test.cpp old mode 100755 new mode 100644 diff --git a/test/promote_mpl_test.cpp b/test/promote_mpl_test.cpp old mode 100755 new mode 100644 diff --git a/test/promote_util.hpp b/test/promote_util.hpp old mode 100755 new mode 100644 diff --git a/test/tricky_is_enum_test.cpp b/test/tricky_is_enum_test.cpp old mode 100755 new mode 100644