diff --git a/include/boost/type_traits.hpp b/include/boost/type_traits.hpp index 02d76e0..42b85c7 100644 --- a/include/boost/type_traits.hpp +++ b/include/boost/type_traits.hpp @@ -4,39 +4,59 @@ // warranty, and with no claim as to its suitability for any purpose. // See http://www.boost.org for most recent version including documentation. +// See boost/type_traits/*.hpp for full copyright notices. #ifndef BOOST_TYPE_TRAITS_HPP #define BOOST_TYPE_TRAITS_HPP -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/**************************************************************************/ - -// -// undefine helper macro's: -// -#undef BOOST_IS_CLASS -#undef BOOST_IS_ENUM -#undef BOOST_IS_UNION -#undef BOOST_IS_POD -#undef BOOST_IS_EMPTY -#undef BOOST_HAS_TRIVIAL_CONSTRUCTOR -#undef BOOST_HAS_TRIVIAL_COPY -#undef BOOST_HAS_TRIVIAL_ASSIGN -#undef BOOST_HAS_TRIVIAL_DESTRUCTOR +#include "boost/type_traits/add_const.hpp" +#include "boost/type_traits/add_cv.hpp" +#include "boost/type_traits/add_pointer.hpp" +#include "boost/type_traits/add_reference.hpp" +#include "boost/type_traits/add_volatile.hpp" +#include "boost/type_traits/alignment_of.hpp" +#include "boost/type_traits/has_nothrow_assign.hpp" +#include "boost/type_traits/has_nothrow_constructor.hpp" +#include "boost/type_traits/has_nothrow_copy.hpp" +#include "boost/type_traits/has_nothrow_destructor.hpp" +#include "boost/type_traits/has_trivial_assign.hpp" +#include "boost/type_traits/has_trivial_constructor.hpp" +#include "boost/type_traits/has_trivial_copy.hpp" +#include "boost/type_traits/has_trivial_destructor.hpp" +#include "boost/type_traits/is_arithmetic.hpp" +#include "boost/type_traits/is_array.hpp" +#include "boost/type_traits/is_base_and_derived.hpp" +#include "boost/type_traits/is_class.hpp" +#include "boost/type_traits/is_compound.hpp" +#include "boost/type_traits/is_const.hpp" +#include "boost/type_traits/is_convertible.hpp" +#include "boost/type_traits/is_empty.hpp" +#include "boost/type_traits/is_enum.hpp" +#include "boost/type_traits/is_float.hpp" +#include "boost/type_traits/is_function.hpp" +#include "boost/type_traits/is_fundamental.hpp" +#include "boost/type_traits/is_integral.hpp" +#include "boost/type_traits/is_member_function_pointer.hpp" +#include "boost/type_traits/is_member_pointer.hpp" +#include "boost/type_traits/is_object.hpp" +#include "boost/type_traits/is_POD.hpp" +#include "boost/type_traits/is_pointer.hpp" +#include "boost/type_traits/is_reference.hpp" +#include "boost/type_traits/is_same.hpp" +#include "boost/type_traits/is_scalar.hpp" +#include "boost/type_traits/is_stateless.hpp" +#include "boost/type_traits/is_union.hpp" +#include "boost/type_traits/is_void.hpp" +#include "boost/type_traits/is_volatile.hpp" +#include "boost/type_traits/remove_bounds.hpp" +#include "boost/type_traits/remove_const.hpp" +#include "boost/type_traits/remove_cv.hpp" +#include "boost/type_traits/remove_pointer.hpp" +#include "boost/type_traits/remove_reference.hpp" +#include "boost/type_traits/remove_volatile.hpp" +#include "boost/type_traits/type_with_alignment.hpp" #endif // BOOST_TYPE_TRAITS_HPP - diff --git a/include/boost/type_traits/add_const.hpp b/include/boost/type_traits/add_const.hpp new file mode 100644 index 0000000..5c0a83f --- /dev/null +++ b/include/boost/type_traits/add_const.hpp @@ -0,0 +1,48 @@ + +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard +// Hinnant & John Maddock 2000. Permission to copy, use, modify, +// sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided +// "as is" without express or implied warranty, and with no claim as +// to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_ADD_CONST_HPP_INCLUDED +#define BOOST_TT_ADD_CONST_HPP_INCLUDED + +#include "boost/config.hpp" + +// should be the last #include +#include "boost/type_traits/detail/type_trait_def.hpp" + +namespace boost { + +// * 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 +// from some compilers: + +#if defined(BOOST_MSVC) +// This bogus warning will appear when add_const is applied to a +// const volatile reference because we can't detect const volatile +// references with MSVC6. +# pragma warning(push) +# pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored +#endif + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_const,T,T const) + +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_const,T&,T&) +#endif + +} // namespace boost + +#include "boost/type_traits/detail/type_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..3f694db --- /dev/null +++ b/include/boost/type_traits/add_cv.hpp @@ -0,0 +1,48 @@ + +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard +// Hinnant & John Maddock 2000. Permission to copy, use, modify, +// sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided +// "as is" without express or implied warranty, and with no claim as +// to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_ADD_CV_HPP_INCLUDED +#define BOOST_TT_ADD_CV_HPP_INCLUDED + +#include "boost/config.hpp" + +// should be the last #include +#include "boost/type_traits/detail/type_trait_def.hpp" + +namespace boost { + +// * convert a type T to a const volatile type - add_cv +// this is not required since the result is always +// the same as "T const volatile", but it does suppress warnings +// from some compilers: + +#if defined(BOOST_MSVC) +// This bogus warning will appear when add_volatile is applied to a +// const volatile reference because we can't detect const volatile +// references with MSVC6. +# pragma warning(push) +# 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) + +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_cv,T&,T&) +#endif + +} // namespace boost + +#include "boost/type_traits/detail/type_trait_undef.hpp" + +#endif // BOOST_TT_ADD_CV_HPP_INCLUDED diff --git a/include/boost/type_traits/add_pointer.hpp b/include/boost/type_traits/add_pointer.hpp new file mode 100644 index 0000000..982a584 --- /dev/null +++ b/include/boost/type_traits/add_pointer.hpp @@ -0,0 +1,37 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_ADD_POINTER_HPP_INCLUDED +#define BOOST_TT_ADD_POINTER_HPP_INCLUDED + +#include "boost/type_traits/remove_reference.hpp" + +// should be the last #include +#include "boost/type_traits/detail/type_trait_def.hpp" + +namespace boost { + +namespace detail { + +template +struct add_pointer_impl +{ + typedef typename remove_reference::type no_ref_type; + typedef no_ref_type* type; +}; + +} // namespace detail + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_pointer,T,typename detail::add_pointer_impl::type) + +} // namespace boost + +#include "boost/type_traits/detail/type_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..5d2cfcb --- /dev/null +++ b/include/boost/type_traits/add_reference.hpp @@ -0,0 +1,81 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_ADD_REFERENCE_HPP_INCLUDED +#define BOOST_TT_ADD_REFERENCE_HPP_INCLUDED + +#include "boost/type_traits/is_reference.hpp" +#include "boost/config.hpp" + +// should be the last #include +#include "boost/type_traits/detail/type_trait_def.hpp" + +namespace boost { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_reference,T,T&) +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&) + +#elif defined(BOOST_MSVC6_MEMBER_TEMPLATES) + +namespace detail { + +template +struct reference_adder +{ + template struct result_ + { + typedef T& type; + }; +}; + +template <> +struct reference_adder +{ + template struct result_ + { + typedef T type; + }; +}; + +template +struct add_reference_impl +{ + typedef typename reference_adder< + ::boost::is_reference::value + >::template result_ result; + + typedef typename result::type type; +}; + +} // namespace detail + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_reference,T,typename detail::add_reference_impl::type) + +#else + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_reference,T,T&) + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +// +// these full specialisations are always required: +BOOST_TT_AUX_TYPE_TRAIT_SPEC1(add_reference,void,void) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_TYPE_TRAIT_SPEC1(add_reference,void const,void const) +BOOST_TT_AUX_TYPE_TRAIT_SPEC1(add_reference,void volatile,void volatile) +BOOST_TT_AUX_TYPE_TRAIT_SPEC1(add_reference,void const volatile,void const volatile) +#endif + +} // namespace boost + +#include "boost/type_traits/detail/type_trait_undef.hpp" + +#endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED diff --git a/include/boost/type_traits/add_volatile.hpp b/include/boost/type_traits/add_volatile.hpp new file mode 100644 index 0000000..1f99fde --- /dev/null +++ b/include/boost/type_traits/add_volatile.hpp @@ -0,0 +1,48 @@ + +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard +// Hinnant & John Maddock 2000. Permission to copy, use, modify, +// sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided +// "as is" without express or implied warranty, and with no claim as +// to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_ADD_VOLATILE_HPP_INCLUDED +#define BOOST_TT_ADD_VOLATILE_HPP_INCLUDED + +#include "boost/config.hpp" + +// should be the last #include +#include "boost/type_traits/detail/type_trait_def.hpp" + +namespace boost { + +// * convert a type T to volatile type - add_volatile +// this is not required since the result is always +// the same as "T volatile", but it does suppress warnings +// from some compilers: + +#if defined(BOOST_MSVC) +// This bogus warning will appear when add_volatile is applied to a +// const volatile reference because we can't detect const volatile +// references with MSVC6. +# pragma warning(push) +# pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored +#endif + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_volatile,T,T volatile) + +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_volatile,T&,T&) +#endif + +} // namespace boost + +#include "boost/type_traits/detail/type_trait_undef.hpp" + +#endif // BOOST_TT_ADD_VOLATILE_HPP_INCLUDED diff --git a/include/boost/type_traits/alignment_of.hpp b/include/boost/type_traits/alignment_of.hpp new file mode 100644 index 0000000..83ae20b --- /dev/null +++ b/include/boost/type_traits/alignment_of.hpp @@ -0,0 +1,85 @@ + +// (C) Copyright John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. + +#ifndef BOOST_TT_ALIGNMENT_OF_HPP_INCLUDED +#define BOOST_TT_ALIGNMENT_OF_HPP_INCLUDED + +#include "boost/config.hpp" +#include + +// should be the last #include +#include "boost/type_traits/detail/size_t_trait_def.hpp" + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4121) // alignment is sensitive to packing +#endif + +namespace boost { + +template struct alignment_of; + +// get the alignment of some arbitrary type: +namespace detail { + +template +struct alignment_of_hack +{ + char c; + T t; + alignment_of_hack(); +}; + + +template +struct alignment_logic +{ + BOOST_STATIC_CONSTANT(std::size_t, value = A < S ? A : S); +}; + + +template< typename T > +struct alignment_of_impl +{ + BOOST_STATIC_CONSTANT(std::size_t, value = + (::boost::detail::alignment_logic< + sizeof(detail::alignment_of_hack) - sizeof(T), + sizeof(T) + >::value)); +}; + +} // namespace detail + +BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(alignment_of,T,::boost::detail::alignment_of_impl::value) + +// references have to be treated specially, assume +// that a reference is just a special pointer: +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +template +struct alignment_of + : alignment_of +{ +}; +#endif + +// void has to be treated specially: +BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(alignment_of,void,0) +#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) +#endif + +} // namespace boost + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +#include "boost/type_traits/detail/size_t_trait_undef.hpp" + +#endif // BOOST_TT_ALIGNMENT_OF_HPP_INCLUDED diff --git a/include/boost/type_traits/alignment_traits.hpp b/include/boost/type_traits/alignment_traits.hpp index 2289ac0..991ac41 100644 --- a/include/boost/type_traits/alignment_traits.hpp +++ b/include/boost/type_traits/alignment_traits.hpp @@ -5,204 +5,10 @@ // in all copies. This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. -// -// defines alignment_of: +#ifndef BOOST_TT_ALIGNMENT_TRAITS_HPP_INCLUDED +#define BOOST_TT_ALIGNMENT_TRAITS_HPP_INCLUDED -#ifndef ALIGNMENT_TYPE_TRAITS_HPP -#define ALIGNMENT_TYPE_TRAITS_HPP +#include "boost/type_traits/alignment_of.hpp" +#include "boost/type_traits/type_with_alignment.hpp" -#include -#include -#ifndef BOOST_ICE_TYPE_TRAITS_HPP -#include -#endif -#include -#include -#include -#include -#include - -#ifdef BOOST_MSVC -# pragma warning(push) -# pragma warning(disable: 4121) // alignment is sensitive to packing -#endif - -namespace boost{ -template struct alignment_of; - -// -// get the alignment of some arbitrary type: -namespace detail{ - -template -struct alignment_of_hack -{ - char c; - T t; - alignment_of_hack(); -}; - - -template -struct alignment_logic -{ - BOOST_STATIC_CONSTANT(std::size_t, value = A < S ? A : S); -}; - -} // namespace detail - -template -struct alignment_of -{ - BOOST_STATIC_CONSTANT(std::size_t, value = - (::boost::detail::alignment_logic< - sizeof(detail::alignment_of_hack) - sizeof(T), - sizeof(T) - >::value)); -}; - -// -// references have to be treated specially, assume -// that a reference is just a special pointer: -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -template -struct alignment_of -{ -public: - BOOST_STATIC_CONSTANT(std::size_t, value = ::boost::alignment_of::value); -}; -#endif -// -// void has to be treated specially: -template <> -struct alignment_of -{ BOOST_STATIC_CONSTANT(std::size_t, value = 0); }; -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -template <> -struct alignment_of -{ BOOST_STATIC_CONSTANT(std::size_t, value = 0); }; -template <> -struct alignment_of -{ BOOST_STATIC_CONSTANT(std::size_t, value = 0); }; -template <> -struct alignment_of -{ BOOST_STATIC_CONSTANT(std::size_t, value = 0); }; -#endif - -namespace detail { -class alignment_dummy; -typedef void (*function_ptr)(); -typedef int (alignment_dummy::*member_ptr); -typedef int (alignment_dummy::*member_function_ptr)(); - -/* - * The ct_if implementation is temporary code. It will be replaced with MPL - * in the future... - */ -struct select_then -{ - template - struct result - { - typedef Then type; - }; -}; - -struct select_else -{ - template - struct result - { - typedef Else type; - }; -}; - -template -struct ct_if_selector -{ - typedef select_then type; -}; - -template<> -struct ct_if_selector -{ - typedef select_else type; -}; - -template -struct ct_if -{ - typedef typename ct_if_selector::type select; - typedef typename select::template result::type type; -}; - -#define BOOST_TT_ALIGNMENT_TYPES BOOST_PP_TUPLE_TO_LIST( \ - 11, ( \ - char, short, int, long, float, double, long double \ - , void*, function_ptr, member_ptr, member_function_ptr)) - -#define BOOST_TT_CHOOSE_MIN_ALIGNMENT(R,P,I,T) \ - typename ct_if< \ - alignment_of::value <= target, T, char>::type BOOST_PP_CAT(t,I); - -#define BOOST_TT_CHOOSE_T(R,P,I,T) T BOOST_PP_CAT(t,I); - -template -union min_alignment -{ - 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_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)); -}; - -} - -// This alignment method originally due to Brian Parker, implemented by David -// Abrahams, and then ported here by Doug Gregor. -template -class type_with_alignment -{ - typedef detail::min_alignment t1; - - typedef type_with_alignment this_type; - - typedef typename detail::ct_if< - (detail::is_aligned<(alignment_of::value), Align>::value) - , t1 - , 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; -}; - -} // namespace boost - -#ifdef BOOST_MSVC -# pragma warning(pop) -#endif - -#endif // ALIGNMENT_TYPE_TRAITS_HPP +#endif // BOOST_TT_ALIGNMENT_TRAITS_HPP_INCLUDED diff --git a/include/boost/type_traits/arithmetic_traits.hpp b/include/boost/type_traits/arithmetic_traits.hpp index 1d111c4..b7d0f06 100644 --- a/include/boost/type_traits/arithmetic_traits.hpp +++ b/include/boost/type_traits/arithmetic_traits.hpp @@ -8,259 +8,14 @@ // // defines traits classes for arithmetic types: // is_void, is_integral, is_float, is_arithmetic, is_fundamental. -// - -// Revision History: -// Feb 19 2001 Added #include (David Abrahams) - -#ifndef BOOST_ARITHMETIC_TYPE_TRAITS_HPP -#define BOOST_ARITHMETIC_TYPE_TRAITS_HPP - -#ifndef BOOST_ICE_TYPE_TRAITS_HPP -#include -#endif -#ifndef BOOST_FWD_TYPE_TRAITS_HPP -#include -#endif - -#include // for ULLONG_MAX/ULONG_LONG_MAX - -namespace boost{ - -//* is a type T void - is_void -template struct is_void{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template <> struct is_void{ BOOST_STATIC_CONSTANT(bool, value = true); }; - -//* is a type T an [cv-qualified-] integral type described in the standard (3.9.1p3) -// as an extention we include long long, as this is likely to be added to the -// standard at a later date -template struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#ifndef BOOST_NO_INTRINSIC_WCHAR_T -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#endif -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; - -# if defined(BOOST_HAS_LONG_LONG) -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#elif defined(BOOST_HAS_MS_INT64) -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral<__int64> -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#endif - -//* is a type T a floating-point type described in the standard (3.9.1p8) -template struct is_float -{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template <> struct is_float -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_float -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_float -{ BOOST_STATIC_CONSTANT(bool, value = true); }; - -// -// declare cv-qualified specialisations of these templates only -// if BOOST_NO_CV_SPECIALIZATIONS is not defined: -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -template <> struct is_void -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_void -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_void -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#endif -#ifndef BOOST_NO_CV_SPECIALIZATIONS -// const-variations: -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#ifndef BOOST_NO_INTRINSIC_WCHAR_T -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#endif -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; - -# if defined(BOOST_HAS_LONG_LONG) -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#elif defined(BOOST_HAS_MS_INT64) -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#endif //__int64 - -template <> struct is_float -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_float -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_float -{ BOOST_STATIC_CONSTANT(bool, value = true); }; - -// volatile-variations: -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#ifndef BOOST_NO_INTRINSIC_WCHAR_T -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#endif -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; - -# if defined(BOOST_HAS_LONG_LONG) -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#elif defined(BOOST_HAS_MS_INT64) -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#endif //__int64 - -template <> struct is_float -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_float -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_float -{ BOOST_STATIC_CONSTANT(bool, value = true); }; - -// const-volatile-variations: -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#ifndef BOOST_NO_INTRINSIC_WCHAR_T -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#endif -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; - -# if defined(BOOST_HAS_LONG_LONG) -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#elif defined(BOOST_HAS_MS_INT64) -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_integral -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#endif //__int64 - -template <> struct is_float -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_float -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> struct is_float -{ BOOST_STATIC_CONSTANT(bool, value = true); }; - -#endif // BOOST_NO_CV_SPECIALIZATIONS - -//* is a type T an arithmetic type described in the standard (3.9.1p8) -template -struct is_arithmetic -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::is_integral::value, - ::boost::is_float::value - >::value)); -}; - -//* is a type T a fundamental type described in the standard (3.9.1) -template -struct is_fundamental -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::is_arithmetic::value, - ::boost::is_void::value - >::value)); -}; - -} // namespace boost - -#endif - - - - +#ifndef BOOST_TT_ARITHMETIC_TRAITS_HPP_INCLUDED +#define BOOST_TT_ARITHMETIC_TRAITS_HPP_INCLUDED +#include "boost/type_traits/is_arithmetic.hpp" +#include "boost/type_traits/is_float.hpp" +#include "boost/type_traits/is_fundamental.hpp" +#include "boost/type_traits/is_integral.hpp" +#include "boost/type_traits/is_void.hpp" +#endif // BOOST_TT_ARITHMETIC_TRAITS_HPP_INCLUDED diff --git a/include/boost/type_traits/array_traits.hpp b/include/boost/type_traits/array_traits.hpp index 622c28f..38f78b0 100644 --- a/include/boost/type_traits/array_traits.hpp +++ b/include/boost/type_traits/array_traits.hpp @@ -6,82 +6,10 @@ // to its suitability for any purpose. // // See http://www.boost.org for most recent version including documentation. -// -#ifndef BOOST_TT_ARRAY_TRAITS_HPP -# define BOOST_TT_ARRAY_TRAITS_HPP -# include -# include -# include -namespace boost { +#ifndef BOOST_TT_ARRAY_TRAITS_HPP_INCLUDED +#define BOOST_TT_ARRAY_TRAITS_HPP_INCLUDED -/********************************************** - * - * is_array - * - **********************************************/ -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -template struct is_array -{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template struct is_array -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template struct is_array -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template struct is_array -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template struct is_array -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -namespace detail -{ - using ::boost::type_traits::yes_type; - using ::boost::type_traits::no_type; - using ::boost::type_traits::wrap; - - template T(* is_array_helper1(wrap) )(wrap); - char is_array_helper1(...); +#include "boost/type_traits/is_array.hpp" - template no_type is_array_helper2(T(*)(wrap)); - yes_type is_array_helper2(...); -} - -template -struct is_array -{ -public: - BOOST_STATIC_CONSTANT( - bool, value = sizeof( - ::boost::detail::is_array_helper2( - ::boost::detail::is_array_helper1( - ::boost::type_traits::wrap()))) == 1 - ); -}; - -template <> -struct is_array -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; - -# ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -template <> -struct is_array -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -template <> -struct is_array -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -template <> -struct is_array -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -# endif -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - -} // namespace boost - -#endif // BOOST_TT_ARRAY_TRAITS_HPP +#endif // BOOST_TT_ARRAY_TRAITS_HPP_INCLUDED diff --git a/include/boost/type_traits/broken_compiler_spec.hpp b/include/boost/type_traits/broken_compiler_spec.hpp new file mode 100644 index 0000000..4ef151e --- /dev/null +++ b/include/boost/type_traits/broken_compiler_spec.hpp @@ -0,0 +1,108 @@ + +// Copyright (c) 2001 Aleksey Gurtovoy. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. +// This software is provided "as is" without express or implied warranty, +// and with no claim as to its suitability for any purpose. + +#ifndef BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED +#define BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED + +#include "boost/config.hpp" + +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + +# define BOOST_TT_BROKEN_COMPILER_SPEC(T) /**/ + +#else + +namespace boost { +// forward declarations +template< typename T > struct remove_const; +template< typename T > struct remove_volatile; +template< typename T > struct remove_cv; +template< typename T > struct remove_pointer; +template< typename T > struct remove_reference; +} + +// same as BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1 macro, except that it +// never gets #undef-ined +# define BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(trait,spec,result) \ +template<> struct trait \ +{ \ + typedef result type; \ +}; \ +/**/ + +# define BOOST_TT_AUX_REMOVE_CONST_VOLATILE_RANK1_SPEC(T) \ + BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_const,T const,T) \ + BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_const,T const volatile,T volatile) \ + BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_volatile,T volatile,T) \ + BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_volatile,T const volatile,T const) \ + BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_cv,T const,T) \ + BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_cv,T volatile,T) \ + BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_cv,T const volatile,T) \ + /**/ + +# define BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T) \ + BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_pointer,T*,T) \ + BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_reference,T&,T) \ + /**/ + +# define BOOST_TT_AUX_REMOVE_PTR_REF_RANK_2_SPEC(T) \ + BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T) \ + BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T const) \ + BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T volatile) \ + BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T const volatile) \ + /**/ + +# define BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T) \ + BOOST_TT_AUX_REMOVE_PTR_REF_RANK_2_SPEC(T) \ + BOOST_TT_AUX_REMOVE_CONST_VOLATILE_RANK1_SPEC(T) \ + /**/ + +# define BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T) \ + BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T*) \ + BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T const*) \ + BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T volatile*) \ + BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T const volatile*) \ + /**/ + +# define BOOST_TT_BROKEN_COMPILER_SPEC(T) \ + namespace boost { \ + BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T) \ + BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T) \ + BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T*) \ + BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T const*) \ + BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T volatile*) \ + BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T const volatile*) \ + } \ + /**/ + +# include "boost/type_traits/detail/type_trait_undef.hpp" + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +BOOST_TT_BROKEN_COMPILER_SPEC(bool) +BOOST_TT_BROKEN_COMPILER_SPEC(char) +#ifndef BOOST_NO_INTRINSIC_WCHAR_T +BOOST_TT_BROKEN_COMPILER_SPEC(wchar_t) +#endif +BOOST_TT_BROKEN_COMPILER_SPEC(signed char) +BOOST_TT_BROKEN_COMPILER_SPEC(unsigned char) +BOOST_TT_BROKEN_COMPILER_SPEC(signed short) +BOOST_TT_BROKEN_COMPILER_SPEC(unsigned short) +BOOST_TT_BROKEN_COMPILER_SPEC(signed int) +BOOST_TT_BROKEN_COMPILER_SPEC(unsigned int) +BOOST_TT_BROKEN_COMPILER_SPEC(signed long) +BOOST_TT_BROKEN_COMPILER_SPEC(unsigned long) +BOOST_TT_BROKEN_COMPILER_SPEC(float) +BOOST_TT_BROKEN_COMPILER_SPEC(double) +BOOST_TT_BROKEN_COMPILER_SPEC(long double) + +// for backward compatibility +#define BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(T) \ + BOOST_TT_BROKEN_COMPILER_SPEC(T) \ +/**/ + +#endif // BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED diff --git a/include/boost/type_traits/composite_traits.hpp b/include/boost/type_traits/composite_traits.hpp index 11c6a7f..71e6414 100644 --- a/include/boost/type_traits/composite_traits.hpp +++ b/include/boost/type_traits/composite_traits.hpp @@ -19,992 +19,18 @@ // by Andrei Alexandrescu (see http://www.cuj.com/experts/1810/alexandr.html). // Fixes for is_array are based on a newgroup posting by Jonathan Lundquist. -// -// Revision History: -// 21st March 2001: -// Fixed is_enum so that it works with incomplete types. +#ifndef BOOST_TT_COMPOSITE_TRAITS_HPP_INCLUDED +#define BOOST_TT_COMPOSITE_TRAITS_HPP_INCLUDED -#ifndef BOOST_COMPOSITE_TYPE_TRAITS_HPP -#define BOOST_COMPOSITE_TYPE_TRAITS_HPP +#include "boost/type_traits/is_array.hpp" +#include "boost/type_traits/is_enum.hpp" +#include "boost/type_traits/is_member_pointer.hpp" +#include "boost/type_traits/is_member_function_pointer.hpp" +#include "boost/type_traits/is_pointer.hpp" +#include "boost/type_traits/is_reference.hpp" +#include "boost/type_traits/is_union.hpp" -#ifndef BOOST_ICE_TYPE_TRAITS_HPP -# include -#endif -#ifndef BOOST_FWD_TYPE_TRAITS_HPP -# include -#endif -#ifndef BOOST_CONVERSION_TYPE_TRAITS_HPP -# include -#endif -#ifndef BOOST_CV_TYPE_TRAITS_HPP -# include -#endif -#ifndef BOOST_ARITHMETIC_TYPE_TRAITS_HPP -# include -#endif -#ifndef BOOST_TRANSFORM_TRAITS_HPP -# include -#endif -#ifndef BOOST_TT_REFERENCE_TRAITS_HPP -# include -#endif -#ifndef BOOST_TT_ARRAY_TRAITS_HPP -# include -#endif -#ifndef BOOST_TYPE_TRAITS_IS_CLASS_HPP -# include -#endif - -namespace boost{ - -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -namespace detail{ - - struct pointer_helper - { - pointer_helper(const volatile void*); - }; - yes_type BOOST_TT_DECL is_pointer_helper(pointer_helper); - no_type BOOST_TT_DECL is_pointer_helper(...); - -::boost::type_traits::no_type BOOST_TT_DECL is_function_tester(...); -template -::boost::type_traits::yes_type is_function_tester(R (*)(void)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28)); -template -::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29)); -} // namespace detail -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - -namespace detail -{ - // Utility metafunction which returns true if its argument is not an - // array and not a reference. - template - struct neither_array_nor_reference : ::boost::type_traits::ice_not< - ::boost::type_traits::ice_or< - ::boost::is_reference::value - , ::boost::is_array::value - >::value> - {}; -} - -/********************************************** - * - * is_pointer - * - **********************************************/ -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -namespace detail{ -template struct is_pointer_helper -{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template struct is_pointer_helper -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template struct is_pointer_helper -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template struct is_pointer_helper -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template struct is_pointer_helper -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -} // namespace detail -template struct is_pointer -{ BOOST_STATIC_CONSTANT(bool, value = (::boost::type_traits::ice_and< ::boost::detail::is_pointer_helper::value, ::boost::type_traits::ice_not< ::boost::is_member_pointer::value >::value >::value)); }; -#else - -namespace detail -{ - // is_pointer implementation - template - struct is_pointer_select : ::boost::type_traits::false_unary_metafunction - { - }; - - template <> - struct is_pointer_select - { - template - struct apply - { - static T& make_t(); - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - (1 == sizeof(is_pointer_helper(make_t()))), - (1 == sizeof(is_function_tester(make_t()))) - >::value)); - }; - }; -} - -template -struct is_pointer : ::boost::detail::is_pointer_select< - ::boost::detail::neither_array_nor_reference::value ->::template apply -{}; - -template <> -struct is_pointer -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -template <> -struct is_pointer -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -template <> -struct is_pointer -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -template <> -struct is_pointer -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -#endif -#endif - -/********************************************** - * - * is_union - * - **********************************************/ -template struct is_union -{ -private: - typedef typename remove_cv::type cvt; -public: - BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(cvt)); -}; - -/********************************************** - * - * is_enum - * - **********************************************/ -namespace detail -{ - struct int_convertible - { - int_convertible(int); - }; - - // Don't evaluate convertibility to int_convertible unless the type - // is non-arithmetic. This suppresses warnings with GCC. - template - struct is_enum_helper - { - template - struct type - { - BOOST_STATIC_CONSTANT(bool, value = false); - }; - }; - - template <> - struct is_enum_helper - { - template - struct type - : ::boost::is_convertible - { - }; - }; -} // namespace detail -#if !(defined(__BORLANDC__) && (__BORLANDC__ <= 0x551)) -template struct is_enum -{ -private: - typedef ::boost::add_reference ar_t; - typedef typename ar_t::type r_type; - -# if (defined(__MWERKS__) && __MWERKS__ >= 0x3000) || BOOST_MSVC > 1301 || defined(BOOST_NO_COMPILER_CONFIG) - BOOST_STATIC_CONSTANT(bool, selector = - (::boost::type_traits::ice_or< - ::boost::is_arithmetic::value - , ::boost::is_reference::value - // We MUST do this on conforming compilers in order to - // correctly deduce that noncopyable types are not enums (dwa - // 2002/04/15)... - , ::boost::is_class::value - >::value)); -# else - BOOST_STATIC_CONSTANT(bool, selector = - (::boost::type_traits::ice_or< - ::boost::is_arithmetic::value - , ::boost::is_reference::value - // However, not doing this on non-conforming compilers prevents - // a dependency recursion. - >::value)); -# endif -#ifdef __BORLANDC__ - typedef ::boost::detail::is_enum_helper< ::boost::is_enum::selector> se_t; -#else - typedef ::boost::detail::is_enum_helper se_t; -#endif - typedef typename se_t::template type helper; -public: - BOOST_STATIC_CONSTANT(bool, value = helper::value); -}; - -// Specializations suppress some nasty warnings with GCC -template<> -struct is_enum -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; - -template<> -struct is_enum -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; - -template<> -struct is_enum -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; - -#else // __BORLANDC__ -// -// buggy is_convertible prevents working -// implementation of is_enum: -template struct is_enum -{ -public: - BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_ENUM(T)); -}; -#endif - -/********************************************** - * - * is_member_pointer - * - **********************************************/ -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(__BORLANDC__) -template struct is_member_pointer -{ BOOST_STATIC_CONSTANT(bool, value = ::boost::is_member_function_pointer::value); }; -template struct is_member_pointer -{ BOOST_STATIC_CONSTANT(bool, value = true); }; - -/********************************************** - * - * is_member_function_pointer - * - **********************************************/ -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = false); }; - -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; - -// Metrowerks thinks this creates ambiguities -# if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 - -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; - -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; - -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = true); }; - -# endif // __MWERKS__ < 0x3000 -#else - -namespace detail{ -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(void)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28)); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29)); - -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(void) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28) const); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29) const); - -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(void) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28) volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29) volatile); - -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(void) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28) const volatile); -template -::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29) const volatile); -::boost::type_traits::no_type BOOST_TT_DECL is_member_function_pointer_helper(...); - -template -::boost::type_traits::yes_type BOOST_TT_DECL is_member_pointer_helper(R T::*); -::boost::type_traits::no_type BOOST_TT_DECL is_member_pointer_helper(...); - -} - -#ifndef __BORLANDC__ - -namespace detail -{ - template - struct is_member_function_pointer_select - : ::boost::type_traits::false_unary_metafunction - { - }; - - template <> - struct is_member_function_pointer_select - { - template - struct apply - { - static T& make_t; - typedef apply self_type; - - BOOST_STATIC_CONSTANT( - bool, value = (1 == sizeof(detail::is_member_function_pointer_helper(self_type::make_t))) ); - }; - }; -} - -template -struct is_member_function_pointer : ::boost::detail::is_member_function_pointer_select< - ::boost::detail::neither_array_nor_reference::value ->::template apply -{}; - -#else // Borland C++ - -template -struct is_member_function_pointer -{ - static T& m_t; - BOOST_STATIC_CONSTANT( - bool, value = - (1 == sizeof(detail::is_member_function_pointer_helper(m_t))) ); -}; - -template -struct is_member_function_pointer -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; - -#endif - -template <> -struct is_member_function_pointer -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -template <> -struct is_member_function_pointer -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -template <> -struct is_member_function_pointer -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -template <> -struct is_member_function_pointer -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -#endif -#ifdef __BORLANDC__ -template struct is_member_pointer -{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template struct is_member_pointer -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#else - -namespace detail -{ - template - struct is_member_pointer_select - : ::boost::type_traits::false_unary_metafunction - { - }; - - template <> - struct is_member_pointer_select - { - template - struct apply - { - static T& make_t(); - - BOOST_STATIC_CONSTANT( - bool, value = - (::boost::type_traits::ice_or< - (1 == sizeof(detail::is_member_function_pointer_helper(make_t()))), - (1 == sizeof(detail::is_member_pointer_helper(make_t()))) - >::value) ); - }; - }; -} - -template -struct is_member_pointer : ::boost::detail::is_member_pointer_select< - ::boost::detail::neither_array_nor_reference::value ->::template apply -{}; - -template <> -struct is_member_pointer -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -template <> -struct is_member_pointer -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -template <> -struct is_member_pointer -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -template <> -struct is_member_pointer -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -#endif -#endif // __BORLANDC__ - -#endif - - -} // namespace boost - -#endif // BOOST_COMPOSITE_TYPE_TRAITS_HPP +#endif // BOOST_TT_COMPOSITE_TRAITS_HPP_INCLUDED diff --git a/include/boost/type_traits/config.hpp b/include/boost/type_traits/config.hpp new file mode 100644 index 0000000..749b7d6 --- /dev/null +++ b/include/boost/type_traits/config.hpp @@ -0,0 +1,94 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_CONFIG_HPP_INCLUDED +#define BOOST_TT_CONFIG_HPP_INCLUDED + +#ifndef BOOST_CONFIG_HPP +#include "boost/config.hpp" +#endif + +// +// Helper macros for builtin compiler support. +// If your compiler has builtin support for any of the following +// traits concepts, then redefine the appropriate macros to pick +// up on the compiler support: +// +// (these should largely ignore cv-qualifiers) +// BOOST_IS_CLASS(T) should evaluate to true if T is a class or struct type +// BOOST_IS_ENUM(T) should evaluate to true if T is an enumerator type +// BOOST_IS_UNION(T) should evaluate to true if T is a union type +// BOOST_IS_POD(T) should evaluate to true if T is a POD type +// BOOST_IS_EMPTY(T) should evaluate to true if T is an empty struct or union +// BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) should evaluate to true if "T x;" has no effect +// BOOST_HAS_TRIVIAL_COPY(T) should evaluate to true if T(t) <==> memcpy +// BOOST_HAS_TRIVIAL_ASSIGN(T) should evaluate to true if t = u <==> memcpy +// BOOST_HAS_TRIVIAL_DESTRUCTOR(T) should evaluate to true if ~T() has no effect + +#ifdef BOOST_HAS_SGI_TYPE_TRAITS +# include "boost/type_traits/is_same.hpp" +# include +# define BOOST_IS_POD(T) ::boost::is_same< typename ::__type_traits::is_POD_type, ::__true_type>::value +# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) ::boost::is_same< typename ::__type_traits::has_trivial_default_constructor, ::__true_type>::value +# define BOOST_HAS_TRIVIAL_COPY(T) ::boost::is_same< typename ::__type_traits::has_trivial_copy_constructor, ::__true_type>::value +# define BOOST_HAS_TRIVIAL_ASSIGN(T) ::boost::is_same< typename ::__type_traits::has_trivial_assignment_operator, ::__true_type>::value +# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) ::boost::is_same< typename ::__type_traits::has_trivial_destructor, ::__true_type>::value +#endif + +#ifndef BOOST_IS_CLASS +# define BOOST_IS_CLASS(T) false +#endif + +#ifndef BOOST_IS_ENUM +# define BOOST_IS_ENUM(T) false +#endif + +#ifndef BOOST_IS_UNION +# define BOOST_IS_UNION(T) false +#endif + +#ifndef BOOST_IS_POD +# define BOOST_IS_POD(T) false +#endif + +#ifndef BOOST_IS_EMPTY +# define BOOST_IS_EMPTY(T) false +#endif + +#ifndef BOOST_HAS_TRIVIAL_CONSTRUCTOR +# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) false +#endif + +#ifndef BOOST_HAS_TRIVIAL_COPY +# define BOOST_HAS_TRIVIAL_COPY(T) false +#endif + +#ifndef BOOST_HAS_TRIVIAL_ASSIGN +# define BOOST_HAS_TRIVIAL_ASSIGN(T) false +#endif + +#ifndef BOOST_HAS_TRIVIAL_DESTRUCTOR +# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) false +#endif + +// +// whenever we have a conversion function with elipses +// it needs to be declared __cdecl to suppress compiler +// warnings from MS and Borland compilers: +#if defined(BOOST_MSVC) || defined(__BORLANDC__) +# define BOOST_TT_DECL __cdecl +#else +# define BOOST_TT_DECL /**/ +#endif + +# if (defined(__MWERKS__) && __MWERKS__ >= 0x3000) || BOOST_MSVC > 1301 || defined(BOOST_NO_COMPILER_CONFIG) +# define BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION +#endif + +#endif // BOOST_TT_CONFIG_HPP_INCLUDED diff --git a/include/boost/type_traits/conversion_traits.hpp b/include/boost/type_traits/conversion_traits.hpp index f5642cd..5c3e3e5 100644 --- a/include/boost/type_traits/conversion_traits.hpp +++ b/include/boost/type_traits/conversion_traits.hpp @@ -13,316 +13,9 @@ // and with no claim as to its suitability for any purpose. // -#ifndef BOOST_CONVERSION_TYPE_TRAITS_HPP -#define BOOST_CONVERSION_TYPE_TRAITS_HPP - -#ifndef BOOST_ICE_TYPE_TRAITS_HPP -#include -#endif -#ifndef BOOST_FWD_TYPE_TRAITS_HPP -#include -#endif -#ifndef BOOST_ARITHMETIC_TYPE_TRAITS_HPP -#include -#endif -// -// is one type convertable to another? -// -// there are multiple versions of the is_convertible -// template, almost every compiler seems to require its -// own version. -// -// Thanks to Andrei Alexandrescu for the original version of the -// conversion detection technique! -// - -namespace boost{ - -#if defined(BOOST_MSVC) - -// -// MS specific version: -// -namespace detail{ - - // This workaround is necessary to handle when From is void - // which is normally taken care of by the partial specialization - // of the is_convertible class. - using ::boost::type_traits::yes_type; - using ::boost::type_traits::no_type; - - struct from_not_void_conversion { - template - struct n_bind { - static no_type BOOST_TT_DECL _m_check(...); - static yes_type BOOST_TT_DECL _m_check(To); - public: - void foo(); // avoid warning about all members being private - static From _m_from; - enum { exists = sizeof( _m_check(_m_from) ) == sizeof(yes_type) }; - }; - }; - struct from_is_void_conversion { - template - struct n_bind { - enum { exists = ::boost::is_void::value }; - }; - }; - - template - struct conversion_helper { - typedef from_not_void_conversion type; - }; - template <> - struct conversion_helper { - typedef from_is_void_conversion type; - }; -} // namespace detail - -template -struct is_convertible -{ - typedef typename detail::conversion_helper::type Selector; - typedef typename Selector::template n_bind Conversion; -public: - enum { value = Conversion::exists }; -}; - -#elif defined(__BORLANDC__) -// -// special version for Borland compilers -// this version breaks when used for some -// UDT conversions: -// -template -struct is_convertible -{ -private: -#pragma option push -w-8074 - // This workaround for Borland breaks the EDG C++ frontend, - // so we only use it for Borland. - template - struct checker - { - static type_traits::no_type BOOST_TT_DECL _m_check(...); - static type_traits::yes_type BOOST_TT_DECL _m_check(T); - }; - static From _m_from; -public: - static const bool value = sizeof( checker::_m_check(_m_from) ) == sizeof(type_traits::yes_type); - - void foo(); // avoid warning about all members being private -#pragma option pop -}; - -#elif defined(__GNUC__) -// -// special version for gcc compiler -// -namespace detail{ - struct any_conversion - { - template - any_conversion(const T&); - template - any_conversion(T&); - }; - template - struct checker - { - static boost::type_traits::no_type _m_check(any_conversion ...); - static boost::type_traits::yes_type _m_check(T, int); - }; -} // namespace detail -template -struct is_convertible -{ -private: - static From _m_from; -public: - static const bool value = sizeof( detail::checker::_m_check(_m_from, 0) ) == sizeof(type_traits::yes_type); - - void foo(); // avoid warning about all members being private -}; - -// Declare specializations of is_convertible for all of the floating -// types to all of the integral types. This suppresses some nasty -// warnings - -# define BOOST_IS_CONVERTIBLE(T1,T2) template<>struct is_convertible{static const bool value=true;}; -# define BOOST_IS_CONVERTIBLE2(T1,T2) \ - BOOST_IS_CONVERTIBLE(T1,signed T2) \ - BOOST_IS_CONVERTIBLE(T1,unsigned T2) - -# define BOOST_FLOAT_IS_CONVERTIBLE(F) \ - BOOST_IS_CONVERTIBLE(F,char) \ - BOOST_IS_CONVERTIBLE2(F,char) \ - BOOST_IS_CONVERTIBLE2(F,short) \ - BOOST_IS_CONVERTIBLE2(F,int) \ - BOOST_IS_CONVERTIBLE2(F,long) \ - BOOST_IS_CONVERTIBLE2(F,long long) - -BOOST_FLOAT_IS_CONVERTIBLE(float) -BOOST_FLOAT_IS_CONVERTIBLE(double) -BOOST_FLOAT_IS_CONVERTIBLE(long double) -BOOST_FLOAT_IS_CONVERTIBLE(float const) -BOOST_FLOAT_IS_CONVERTIBLE(double const) -BOOST_FLOAT_IS_CONVERTIBLE(long double const) -BOOST_FLOAT_IS_CONVERTIBLE(float volatile) -BOOST_FLOAT_IS_CONVERTIBLE(double volatile) -BOOST_FLOAT_IS_CONVERTIBLE(long double volatile) -BOOST_FLOAT_IS_CONVERTIBLE(float const volatile) -BOOST_FLOAT_IS_CONVERTIBLE(double const volatile) -BOOST_FLOAT_IS_CONVERTIBLE(long double const volatile) -# undef BOOST_FLOAT_IS_CONVERTIBLE -# undef BOOST_IS_CONVERTIBLE2 -# undef BOOST_IS_CONVERTIBLE -#else - -template -struct is_convertible -{ -private: - static type_traits::no_type BOOST_TT_DECL _m_check(...); - static type_traits::yes_type BOOST_TT_DECL _m_check(To); - static From _m_from; -public: - BOOST_STATIC_CONSTANT(bool, value = sizeof( _m_check(_m_from) ) == sizeof(type_traits::yes_type)); - void foo(); // avoid warning about all members being private -}; - -#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION -// A definition is required even for integral static constants -template -const bool is_convertible::value; -#endif - - -#endif // is_convertible - -// -// Now add the full and partial specialisations -// for void types, these are common to all the -// implementation above: -// -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -template -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -template -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -template -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -template -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -#endif // BOOST_NO_CV_VOID_SPECIALIZATIONS - -template -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -template -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -template -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -template -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -#endif -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - -template <> -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -template <> -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; -template <> -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; -template <> -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; -template <> -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; -template <> -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; -template <> -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; -template <> -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; -template <> -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; -template <> -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; -template <> -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; -template <> -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; -template <> -struct is_convertible -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; -#endif - -} // namespace boost - -#endif // include guard +#ifndef BOOST_TT_CONVERSION_TRAITS_HPP_INCLUDED +#define BOOST_TT_CONVERSION_TRAITS_HPP_INCLUDED +#include "boost/type_traits/is_convertible.hpp" +#endif // BOOST_TT_CONVERSION_TRAITS_HPP_INCLUDED diff --git a/include/boost/type_traits/cv_traits.hpp b/include/boost/type_traits/cv_traits.hpp index 514e0c1..6d57c62 100644 --- a/include/boost/type_traits/cv_traits.hpp +++ b/include/boost/type_traits/cv_traits.hpp @@ -9,392 +9,17 @@ // // defines traits classes for cv-qualified types: // is_const, is_volatile, remove_const, remove_volatile, remove_cv. -// -// Revision History: -// 24th March 2001: -// Fixed is_const/is_volatile so that they work with reference types - -#ifndef BOOST_CV_TYPE_TRAITS_HPP -#define BOOST_CV_TYPE_TRAITS_HPP - -#ifndef BOOST_ICE_TYPE_TRAITS_HPP -#include -#endif -#ifndef BOOST_FWD_TYPE_TRAITS_HPP -#include -#endif -#ifndef BOOST_TT_REFERENCE_TRAITS_HPP -# include -#endif -#ifndef BOOST_TT_ARRAY_TRAITS_HPP -# include -#endif -#ifndef BOOST_TT_UTILITY_HPP -# include -#endif - -namespace boost{ - -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -namespace detail{ -// -// implementation helper: -// -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; -}; - -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 remove_const_helper -{ - typedef T type; -}; -template -struct remove_const_helper -{ - typedef volatile T type; -}; - -template -struct remove_volatile_helper -{ - typedef T type; -}; -template -struct remove_volatile_helper -{ - typedef const T type; -}; - -} // namespace detail - -// * convert a type T to a non-volatile type - remove_volatile -template -struct remove_volatile -{ - typedef typename detail::cv_traits_imp::unqualified_type uq_type; - typedef typename detail::remove_volatile_helper::value>::type type; -}; -template struct remove_volatile{ typedef T& type; }; -template struct remove_volatile{ typedef T type[N]; }; -template struct remove_volatile{ typedef const T type[N]; }; - -// * convert a type T to non-const type - remove_const -template -struct remove_const -{ - typedef typename detail::cv_traits_imp::unqualified_type uq_type; - typedef typename detail::remove_const_helper::value>::type type; -}; -template struct remove_const{ typedef T& type; }; -template struct remove_const{ typedef T type[N]; }; -template struct remove_const{ typedef volatile T type[N]; }; - -// convert a type T to a non-cv-qualified type - remove_cv -template -struct remove_cv -{ - typedef typename detail::cv_traits_imp::unqualified_type type; -}; -template struct remove_cv{ typedef T& type; }; -template struct remove_cv{ typedef T type[N]; }; -template struct remove_cv{ typedef T type[N]; }; -template struct remove_cv{ typedef T type[N]; }; - -//* is a type T declared const - is_const -template -struct is_const -{ - BOOST_STATIC_CONSTANT(bool, value = detail::cv_traits_imp::is_const); -}; -template struct is_const -{ BOOST_STATIC_CONSTANT(bool, value = false); }; -#if defined(__BORLANDC__) -// 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... -template struct is_const -{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template struct is_const -{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template struct is_const -{ BOOST_STATIC_CONSTANT(bool, value = false); }; -#endif - -//* is a type T declared volatile - is_volatile -template -struct is_volatile -{ - BOOST_STATIC_CONSTANT(bool, value = detail::cv_traits_imp::is_volatile); -}; -template struct is_volatile -{ BOOST_STATIC_CONSTANT(bool, value = false); }; -#if defined(__BORLANDC__) -// 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... -template struct is_volatile -{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template struct is_volatile -{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template struct is_volatile -{ BOOST_STATIC_CONSTANT(bool, value = false); }; -#endif - -#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -// The following three don't work: -template struct remove_volatile{ typedef T type; }; -template struct remove_const{ typedef T type; }; -template struct remove_cv{ typedef T type; }; - -namespace detail{ - using ::boost::type_traits::yes_type; - using ::boost::type_traits::no_type; - yes_type is_const_helper(const volatile void*); - no_type is_const_helper(volatile void *); - yes_type is_volatile_helper(const volatile void*); - no_type is_volatile_helper(const void *); -} - -namespace detail -{ - template - struct is_const_impl - : ::boost::type_traits::false_unary_metafunction - {}; - - template <> - struct is_const_impl - { - template - struct apply - { - private: - static T* t; - public: - BOOST_STATIC_CONSTANT(bool, value = (sizeof(detail::yes_type) == sizeof(detail::is_const_helper(t)))); - }; - }; - - template <> - struct is_const_impl - { - template - struct apply - { - private: - static T t; - public: - BOOST_STATIC_CONSTANT(bool, value = (sizeof(detail::yes_type) == sizeof(detail::is_const_helper(&t)))); - }; - }; -} - -template -struct is_const - : ::boost::detail::is_const_impl< - is_reference::value - , is_array::value - >::template apply -{ -}; - -template <> -struct is_const -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -template <> -struct is_const -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; -template <> -struct is_const -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -template <> -struct is_const -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; -#endif - -namespace detail -{ - template - struct is_volatile_impl - : ::boost::type_traits::false_unary_metafunction - {}; - - template <> - struct is_volatile_impl - { - template - struct apply - { - private: - static T* t; - public: - BOOST_STATIC_CONSTANT(bool, value = (sizeof(detail::yes_type) == sizeof(detail::is_volatile_helper(t)))); - }; - }; - - template <> - struct is_volatile_impl - { - template - struct apply - { - private: - static T t; - public: - BOOST_STATIC_CONSTANT(bool, value = (sizeof(detail::yes_type) == sizeof(detail::is_volatile_helper(&t)))); - }; - }; -} - -template -struct is_volatile - : ::boost::detail::is_volatile_impl< - is_reference::value - , is_array::value - >::template apply -{ -}; - - -template <> -struct is_volatile -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -template <> -struct is_volatile -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -template <> -struct is_volatile -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; -template <> -struct is_volatile -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; -#endif - -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - -// * 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 -// from some compilers: -template -struct add_const -{ -#if defined(BOOST_MSVC) - // This bogus warning will appear when add_const is applied to a - // const volatile reference because we can't detect const volatile - // references with MSVC6. -# pragma warning(push) -# pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored -#endif - typedef T const type; -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif -}; -// * convert a type T to volatile type - add_volatile -// this is not required since the result is always -// the same as "T volatile", but it does suppress warnings -// from some compilers: -template -struct add_volatile -{ -#if defined(BOOST_MSVC) - // This bogus warning will appear when add_volatile is applied to a - // const volatile reference because we can't detect const volatile - // references with MSVC6. -# pragma warning(push) -# pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored -#endif - typedef T volatile type; -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif -}; -// * convert a type T to a const volatile type - add_cv -// this is not required since the result is always -// the same as "T const volatile", but it does suppress warnings -// from some compilers: -template -struct add_cv -{ -#if defined(BOOST_MSVC) - // This bogus warning will appear when add_volatile is applied to a - // const volatile reference because we can't detect const volatile - // references with MSVC6. -# pragma warning(push) -# pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored -#endif - typedef T const volatile type; -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif -}; -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -template -struct add_const{ typedef T& type; }; -template -struct add_volatile{ typedef T& type; }; -template -struct add_cv{ typedef T& type; }; -#endif - -} // namespace boost - - -#endif // BOOST_CV_TYPE_TRAITS_HPP - +#ifndef BOOST_TT_CV_TRAITS_HPP_INCLUDED +#define BOOST_TT_CV_TRAITS_HPP_INCLUDED +#include "boost/type_traits/add_const.hpp" +#include "boost/type_traits/add_volatile.hpp" +#include "boost/type_traits/add_cv.hpp" +#include "boost/type_traits/is_const.hpp" +#include "boost/type_traits/is_volatile.hpp" +#include "boost/type_traits/remove_const.hpp" +#include "boost/type_traits/remove_volatile.hpp" +#include "boost/type_traits/remove_cv.hpp" +#endif // BOOST_TT_CV_TRAITS_HPP_INCLUDED diff --git a/include/boost/type_traits/detail/bool_trait.hpp b/include/boost/type_traits/detail/bool_trait.hpp new file mode 100644 index 0000000..226d3d2 --- /dev/null +++ b/include/boost/type_traits/detail/bool_trait.hpp @@ -0,0 +1,40 @@ +//----------------------------------------------------------------------------- +// boost/type_traits/detail/bool_trait.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2002 +// Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. + +#ifndef BOOST_TT_DETAIL_BOOL_TRAIT_HPP_INCLUDED +#define BOOST_TT_DETAIL_BOOL_TRAIT_HPP_INCLUDED + +#include "boost/mpl/bool_c.hpp" +#include "boost/config.hpp" + +namespace boost { +namespace type_traits { + +template< bool C > struct bool_trait +{ + typedef mpl::bool_c type; + BOOST_STATIC_CONSTANT(bool, value = C); +}; + +#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION +template< bool C > +bool const bool_trait::value; +#endif + +} // namespace type_traits +} // namespace boost + +#endif // BOOST_TT_DETAIL_BOOL_TRAIT_HPP_INCLUDED diff --git a/include/boost/type_traits/detail/bool_trait_def.hpp b/include/boost/type_traits/detail/bool_trait_def.hpp new file mode 100644 index 0000000..f3f4f0a --- /dev/null +++ b/include/boost/type_traits/detail/bool_trait_def.hpp @@ -0,0 +1,117 @@ +//----------------------------------------------------------------------------- +// boost/type_traits/detail/bool_trait_def.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2002 +// Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. + +// no include guards, the header is intended for multiple inclusion! + +#include "boost/type_traits/detail/template_arity_spec.hpp" +#include "boost/mpl/bool_c.hpp" +#include "boost/mpl/aux_/lambda_support.hpp" +#include "boost/config.hpp" + +#if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 +# define BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) /**/ +#else +# define BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ + typedef mpl::bool_c< C > base_; \ + using base_::value; \ + /**/ +#endif + +#define BOOST_TT_AUX_BOOL_TRAIT_DEF1(trait,T,C) \ +template< typename T > struct trait \ + : mpl::bool_c< C > \ +{ \ + BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(T)) \ +}; \ +\ +BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) \ +/**/ + +#define BOOST_TT_AUX_BOOL_TRAIT_DEF2(trait,T1,T2,C) \ +template< typename T1, typename T2 > struct trait \ + : mpl::bool_c< C > \ +{ \ + 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) \ +/**/ + +#define BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp,C) \ +template<> struct trait \ + : mpl::bool_c< C > \ +{ \ + BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(sp)) \ +}; \ +/**/ + +#define BOOST_TT_AUX_BOOL_TRAIT_SPEC2(trait,sp1,sp2,C) \ +template<> struct trait \ + : mpl::bool_c< C > \ +{ \ + BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ + BOOST_MPL_AUX_LAMBDA_SUPPORT(2,trait,(sp1,sp2)) \ +}; \ +/**/ + +#define BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(param,trait,sp,C) \ +template< param > struct trait \ + : mpl::bool_c< C > \ +{ \ + BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ +}; \ +/**/ + +#define BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(param1,param2,trait,sp,C) \ +template< param1, param2 > struct trait \ + : mpl::bool_c< C > \ +{ \ + BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ +}; \ +/**/ + +#define BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(param,trait,sp1,sp2,C) \ +template< param > struct trait \ + : mpl::bool_c< C > \ +{ \ + BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ + BOOST_MPL_AUX_LAMBDA_SUPPORT(2,trait,(sp1,sp2)) \ +}; \ +/**/ + +#define BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(param1,param2,trait,sp1,sp2,C) \ +template< param1, param2 > struct trait \ + : mpl::bool_c< C > \ +{ \ + BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ +}; \ +/**/ + +#ifndef BOOST_NO_CV_SPECIALIZATIONS +# define BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(trait,sp,value) \ + BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp,value) \ + BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp const,value) \ + BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp volatile,value) \ + BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp const volatile,value) \ + /**/ +#else +# define BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(trait,sp,value) \ + BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp,value) \ + /**/ +#endif diff --git a/include/boost/type_traits/detail/bool_trait_undef.hpp b/include/boost/type_traits/detail/bool_trait_undef.hpp new file mode 100644 index 0000000..45bdd14 --- /dev/null +++ b/include/boost/type_traits/detail/bool_trait_undef.hpp @@ -0,0 +1,27 @@ +//----------------------------------------------------------------------------- +// boost/type_traits/detail/bool_trait_undef.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2002 +// Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. + +// no include guards, the header is intended for multiple inclusion! + +#undef BOOST_TT_AUX_BOOL_TRAIT_DEF1 +#undef BOOST_TT_AUX_BOOL_TRAIT_DEF2 +#undef BOOST_TT_AUX_BOOL_TRAIT_SPEC1 +#undef BOOST_TT_AUX_BOOL_TRAIT_SPEC2 +#undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1 +#undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2 +#undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1 +#undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2 +#undef BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1 diff --git a/include/boost/type_traits/detail/cv_traits_impl.hpp b/include/boost/type_traits/detail/cv_traits_impl.hpp new file mode 100644 index 0000000..f0e26f2 --- /dev/null +++ b/include/boost/type_traits/detail/cv_traits_impl.hpp @@ -0,0 +1,62 @@ + +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard +// Hinnant & John Maddock 2000. Permission to copy, use, modify, +// sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided +// "as is" without express or implied warranty, and with no claim as +// to its suitability for any purpose. +// +// See http://www.boost.org 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 "boost/config.hpp" + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +namespace boost { +namespace detail { + +// implementation helper: + +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; +}; + +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_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +#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 new file mode 100644 index 0000000..e0287cf --- /dev/null +++ b/include/boost/type_traits/detail/false_result.hpp @@ -0,0 +1,26 @@ +// Copyright David Abrahams 2002. Permission to copy, use, +// modify, sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided +// "as is" without express or implied warranty, and with no claim as +// to its suitability for any purpose. + +#ifndef BOOST_TT_DETAIL_FALSE_RESULT_HPP_INCLUDED +#define BOOST_TT_DETAIL_FALSE_RESULT_HPP_INCLUDED + +#include "boost/config.hpp" + +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/ice_and.hpp b/include/boost/type_traits/detail/ice_and.hpp new file mode 100644 index 0000000..890cb61 --- /dev/null +++ b/include/boost/type_traits/detail/ice_and.hpp @@ -0,0 +1,36 @@ +// (C) Copyright John Maddock and Steve Cleary 2000. +// +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_DETAIL_ICE_AND_HPP_INCLUDED +#define BOOST_TT_DETAIL_ICE_AND_HPP_INCLUDED + +#include "boost/config.hpp" + +namespace boost { +namespace type_traits { + +template +struct ice_and; + +template +struct ice_and +{ + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +template <> +struct ice_and +{ + BOOST_STATIC_CONSTANT(bool, value = true); +}; + +} // namespace type_traits +} // namespace boost + +#endif // BOOST_TT_DETAIL_ICE_AND_HPP_INCLUDED diff --git a/include/boost/type_traits/detail/ice_eq.hpp b/include/boost/type_traits/detail/ice_eq.hpp new file mode 100644 index 0000000..ba91e37 --- /dev/null +++ b/include/boost/type_traits/detail/ice_eq.hpp @@ -0,0 +1,38 @@ +// (C) Copyright John Maddock and Steve Cleary 2000. +// +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_DETAIL_ICE_EQ_HPP_INCLUDED +#define BOOST_TT_DETAIL_ICE_EQ_HPP_INCLUDED + +#include "boost/config.hpp" + +namespace boost { +namespace type_traits { + +template +struct ice_eq +{ + BOOST_STATIC_CONSTANT(bool, value = (b1 == b2)); +}; + +template +struct ice_ne +{ + BOOST_STATIC_CONSTANT(bool, value = (b1 != b2)); +}; + +#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION +template bool const ice_eq::value; +template bool const ice_ne::value; +#endif + +} // namespace type_traits +} // namespace boost + +#endif // BOOST_TT_DETAIL_ICE_EQ_HPP_INCLUDED diff --git a/include/boost/type_traits/detail/ice_not.hpp b/include/boost/type_traits/detail/ice_not.hpp new file mode 100644 index 0000000..1c04873 --- /dev/null +++ b/include/boost/type_traits/detail/ice_not.hpp @@ -0,0 +1,33 @@ +// (C) Copyright John Maddock and Steve Cleary 2000. +// +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_DETAIL_ICE_NOT_HPP_INCLUDED +#define BOOST_TT_DETAIL_ICE_NOT_HPP_INCLUDED + +#include "boost/config.hpp" + +namespace boost { +namespace type_traits { + +template +struct ice_not +{ + BOOST_STATIC_CONSTANT(bool, value = true); +}; + +template <> +struct ice_not +{ + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +} // namespace type_traits +} // namespace boost + +#endif // BOOST_TT_DETAIL_ICE_NOT_HPP_INCLUDED diff --git a/include/boost/type_traits/detail/ice_or.hpp b/include/boost/type_traits/detail/ice_or.hpp new file mode 100644 index 0000000..0eca649 --- /dev/null +++ b/include/boost/type_traits/detail/ice_or.hpp @@ -0,0 +1,36 @@ +// (C) Copyright John Maddock and Steve Cleary 2000. +// +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_DETAIL_ICE_OR_HPP_INCLUDED +#define BOOST_TT_DETAIL_ICE_OR_HPP_INCLUDED + +#include "boost/config.hpp" + +namespace boost { +namespace type_traits { + +template +struct ice_or; + +template +struct ice_or +{ + BOOST_STATIC_CONSTANT(bool, value = true); +}; + +template <> +struct ice_or +{ + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +} // namespace type_traits +} // namespace boost + +#endif // BOOST_TT_DETAIL_ICE_OR_HPP_INCLUDED diff --git a/include/boost/type_traits/detail/is_function_ptr_helper.hpp b/include/boost/type_traits/detail/is_function_ptr_helper.hpp new file mode 100644 index 0000000..e254c17 --- /dev/null +++ b/include/boost/type_traits/detail/is_function_ptr_helper.hpp @@ -0,0 +1,142 @@ + +// Copyright (C) 2000 John Maddock (john_maddock@compuserve.com) +// Copyright (C) 2002 Aleksey Gurtovoy (agurtovoy@meta-comm.com) +// +// Permission to copy and use this software is granted, +// provided this copyright notice appears in all copies. +// Permission to modify the code and to distribute modified code is granted, +// provided this copyright notice appears in all copies, and a notice +// that the code was modified is included with the copyright notice. +// +// This software is provided "as is" without express or implied warranty, +// and with no claim as to its suitability for any purpose. + +#if !defined(BOOST_PP_IS_ITERATING) + +///// header body + +#ifndef BOOST_TT_DETAIL_IS_FUNCTION_PTR_HELPER_HPP_INCLUDED +#define BOOST_TT_DETAIL_IS_FUNCTION_PTR_HELPER_HPP_INCLUDED + +#include "boost/type_traits/config.hpp" + +#if defined(BOOST_TT_PREPROCESSING_MODE) +# include "boost/preprocessor/iterate.hpp" +# include "boost/preprocessor/enum_params.hpp" +# include "boost/preprocessor/comma_if.hpp" +#endif + +namespace boost { +namespace type_traits { + +template +struct is_function_ptr_helper +{ + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +#if !defined(BOOST_TT_PREPROCESSING_MODE) +// preprocessor-generated part, don't edit by hand! + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool,value = true); }; + +#else + +#undef BOOST_STATIC_CONSTANT +#define BOOST_PP_ITERATION_PARAMS_1 \ + (0, 25, "boost/type_traits/detail/is_function_ptr_helper.hpp") +#include BOOST_PP_ITERATE() + +#endif // BOOST_TT_PREPROCESSING_MODE + +} // namespace type_traits +} // namespace boost + +#endif // BOOST_TT_DETAIL_IS_FUNCTION_PTR_HELPER_HPP_INCLUDED + +///// iteration + +#else +#define i BOOST_PP_FRAME_ITERATION(1) + +template +struct is_function_ptr_helper { BOOST_STATIC_CONSTANT(bool, value = true); }; + +#undef i +#endif // BOOST_PP_IS_ITERATING diff --git a/include/boost/type_traits/detail/is_function_ptr_tester.hpp b/include/boost/type_traits/detail/is_function_ptr_tester.hpp new file mode 100644 index 0000000..ce95c12 --- /dev/null +++ b/include/boost/type_traits/detail/is_function_ptr_tester.hpp @@ -0,0 +1,133 @@ + +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, +// Aleksey Gurtovoy, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software +// is granted provided this copyright notice appears in all copies. +// This software is provided "as is" without express or implied warranty, +// and with no claim as to its suitability for any purpose. + +#if !defined(BOOST_PP_IS_ITERATING) + +///// header body + +#ifndef BOOST_TT_DETAIL_IS_FUNCTION_PTR_TESTER_HPP_INCLUDED +#define BOOST_TT_DETAIL_IS_FUNCTION_PTR_TESTER_HPP_INCLUDED + +#include "boost/type_traits/detail/yes_no_type.hpp" +#include "boost/type_traits/config.hpp" + +#if defined(BOOST_TT_PREPROCESSING_MODE) +# include "boost/preprocessor/iterate.hpp" +# include "boost/preprocessor/enum_params.hpp" +# include "boost/preprocessor/comma_if.hpp" +#endif + +namespace boost { +namespace type_traits { + +no_type BOOST_TT_DECL is_function_ptr_tester(...); + +#if !defined(BOOST_TT_PREPROCESSING_MODE) +// preprocessor-generated part, don't edit by hand! + +template +yes_type is_function_ptr_tester(R (*)()); + +template +yes_type is_function_ptr_tester(R (*)(T0)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4,T5)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4,T5,T6)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4,T5,T6,T7)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4,T5,T6,T7,T8)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23)); + +template +yes_type is_function_ptr_tester(R (*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24)); + +#else + +#define BOOST_PP_ITERATION_PARAMS_1 \ + (0, 25, "boost/type_traits/detail/is_function_ptr_tester.hpp") +#include BOOST_PP_ITERATE() + +#endif // BOOST_TT_PREPROCESSING_MODE + +} // namespace type_traits +} // namespace boost + +#endif // BOOST_TT_DETAIL_IS_FUNCTION_PTR_TESTER_HPP_INCLUDED + +///// iteration + +#else +#define i BOOST_PP_FRAME_ITERATION(1) + +template +yes_type is_function_ptr_tester(R (*)(BOOST_PP_ENUM_PARAMS(i,T))); + +#undef i +#endif // BOOST_PP_IS_ITERATING diff --git a/include/boost/type_traits/detail/is_function_type_tester.hpp b/include/boost/type_traits/detail/is_function_type_tester.hpp new file mode 100644 index 0000000..09b56c5 --- /dev/null +++ b/include/boost/type_traits/detail/is_function_type_tester.hpp @@ -0,0 +1,133 @@ + +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, +// Aleksey Gurtovoy, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software +// is granted provided this copyright notice appears in all copies. +// This software is provided "as is" without express or implied warranty, +// and with no claim as to its suitability for any purpose. + +#if !defined(BOOST_PP_IS_ITERATING) + +///// header body + +#ifndef BOOST_TT_DETAIL_IS_FUNCTION_TYPE_TESTER_HPP_INCLUDED +#define BOOST_TT_DETAIL_IS_FUNCTION_TYPE_TESTER_HPP_INCLUDED + +#include "boost/type_traits/detail/yes_no_type.hpp" +#include "boost/type_traits/config.hpp" + +#if defined(BOOST_TT_PREPROCESSING_MODE) +# include "boost/preprocessor/iterate.hpp" +# include "boost/preprocessor/enum_params.hpp" +# include "boost/preprocessor/comma_if.hpp" +#endif + +namespace boost { +namespace type_traits { + +no_type BOOST_TT_DECL is_function_type_tester(...); + +#if !defined(BOOST_TT_PREPROCESSING_MODE) +// preprocessor-generated part, don't edit by hand! + +template +yes_type is_function_type_tester(R f()); + +template +yes_type is_function_type_tester(R f(T0)); + +template +yes_type is_function_type_tester(R f(T0,T1)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4,T5)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4,T5,T6)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4,T5,T6,T7)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4,T5,T6,T7,T8)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23)); + +template +yes_type is_function_type_tester(R f(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24)); + +#else + +#define BOOST_PP_ITERATION_PARAMS_1 \ + (0, 25, "boost/type_traits/detail/is_function_type_tester.hpp") +#include BOOST_PP_ITERATE() + +#endif // BOOST_TT_PREPROCESSING_MODE + +} // namespace type_traits +} // namespace boost + +#endif // BOOST_TT_DETAIL_IS_FUNCTION_TYPE_TESTER_HPP_INCLUDED + +///// iteration + +#else +#define i BOOST_PP_FRAME_ITERATION(1) + +template +yes_type is_function_type_tester(R f(BOOST_PP_ENUM_PARAMS(i,T))); + +#undef i +#endif // BOOST_PP_IS_ITERATING 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 new file mode 100644 index 0000000..617cd33 --- /dev/null +++ b/include/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp @@ -0,0 +1,358 @@ + +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, +// Aleksey Gurtovoy, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software +// is granted provided this copyright notice appears in all copies. +// This software is provided "as is" without express or implied warranty, +// and with no claim as to its suitability for any purpose. + +#if !defined(BOOST_PP_IS_ITERATING) + +///// header body + +#ifndef BOOST_TT_DETAIL_IS_MEM_FUN_POINTER_IMPL_HPP_INCLUDED +#define BOOST_TT_DETAIL_IS_MEM_FUN_POINTER_IMPL_HPP_INCLUDED + +#include "boost/config.hpp" + +#if defined(BOOST_TT_PREPROCESSING_MODE) +# include "boost/preprocessor/iterate.hpp" +# include "boost/preprocessor/enum_params.hpp" +# include "boost/preprocessor/comma_if.hpp" +#endif + +namespace boost { +namespace type_traits { + +template +struct is_mem_fun_pointer_impl +{ + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +#if !defined(BOOST_TT_PREPROCESSING_MODE) +// preprocessor-generated part, don't edit by hand! + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; +#endif // __MWERKS__ < 0x3000 + +#else + +#undef BOOST_STATIC_CONSTANT +#define BOOST_PP_ITERATION_PARAMS_1 \ + (0, 25, "boost/type_traits/detail/is_mem_fun_pointer_impl.hpp") +#include BOOST_PP_ITERATE() + +#endif // BOOST_TT_PREPROCESSING_MODE + +} // namespace type_traits +} // namespace boost + +#endif // BOOST_TT_DETAIL_IS_MEM_FUN_POINTER_IMPL_HPP_INCLUDED + +///// iteration + +#else +#define i BOOST_PP_FRAME_ITERATION(1) + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; + +// Metrowerks thinks this creates ambiguities +//: #if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; + +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +//: #endif // __MWERKS__ < 0x3000 + + +#undef i +#endif // BOOST_PP_IS_ITERATING 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 new file mode 100644 index 0000000..46e9faf --- /dev/null +++ b/include/boost/type_traits/detail/is_mem_fun_pointer_tester.hpp @@ -0,0 +1,298 @@ + +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, +// Aleksey Gurtovoy, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software +// is granted provided this copyright notice appears in all copies. +// This software is provided "as is" without express or implied warranty, +// and with no claim as to its suitability for any purpose. + +#if !defined(BOOST_PP_IS_ITERATING) + +///// header body + +#ifndef BOOST_TT_DETAIL_IS_MEM_FUN_POINTER_TESTER_HPP_INCLUDED +#define BOOST_TT_DETAIL_IS_MEM_FUN_POINTER_TESTER_HPP_INCLUDED + +#include "boost/type_traits/detail/yes_no_type.hpp" +#include "boost/type_traits/config.hpp" + +#if defined(BOOST_TT_PREPROCESSING_MODE) +# include "boost/preprocessor/iterate.hpp" +# include "boost/preprocessor/enum_params.hpp" +# include "boost/preprocessor/comma_if.hpp" +#endif + +namespace boost { +namespace type_traits { + +no_type BOOST_TT_DECL is_mem_fun_pointer_tester(...); + +#if !defined(BOOST_TT_PREPROCESSING_MODE) +// preprocessor-generated part, don't edit by hand! + +template +yes_type is_mem_fun_pointer_tester(R (T::*)()); +template +yes_type is_mem_fun_pointer_tester(R (T::*)() const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)() volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)() const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23) const volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24)); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24) const); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24) volatile); +template +yes_type is_mem_fun_pointer_tester(R (T::*)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24) const volatile); + +#else + +#define BOOST_PP_ITERATION_PARAMS_1 \ + (0, 25, "boost/type_traits/detail/is_mem_fun_pointer_tester.hpp") +#include BOOST_PP_ITERATE() + +#endif // BOOST_TT_PREPROCESSING_MODE + +} // namespace type_traits +} // namespace boost + +#endif // BOOST_TT_DETAIL_IS_MEM_FUN_POINTER_TESTER_HPP_INCLUDED + +///// iteration + +#else +#define i BOOST_PP_FRAME_ITERATION(1) + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(BOOST_PP_ENUM_PARAMS(i,T))); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(BOOST_PP_ENUM_PARAMS(i,T)) const); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(BOOST_PP_ENUM_PARAMS(i,T)) volatile); + +template +yes_type is_mem_fun_pointer_tester(R (T::*)(BOOST_PP_ENUM_PARAMS(i,T)) const volatile); + +#undef i +#endif // BOOST_PP_IS_ITERATING diff --git a/include/boost/type_traits/detail/size_t_trait.hpp b/include/boost/type_traits/detail/size_t_trait.hpp new file mode 100644 index 0000000..021ed5d --- /dev/null +++ b/include/boost/type_traits/detail/size_t_trait.hpp @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------------- +// boost type_traits/aux_/size_t_trait.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2002 +// Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. + +#ifndef BOOST_TT_DETAIL_SIZE_T_TRAIT_HPP_INCLUDED +#define BOOST_TT_DETAIL_SIZE_T_TRAIT_HPP_INCLUDED + +#include "boost/mpl/integral_c.hpp" +#include "boost/config.hpp" + +#include + +namespace boost { +namespace type_traits { + +template< std::size_t N > +struct size_t_trait +{ + typedef mpl::integral_c type; + BOOST_STATIC_CONSTANT(std::size_t, value = N); +}; + +#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION +template< std::size_t N > +std::size_t const size_t_trait::value; +#endif + +} // namespace type_traits +} // namespace boost + +#endif // BOOST_TT_DETAIL_SIZE_T_TRAIT_HPP_INCLUDED diff --git a/include/boost/type_traits/detail/size_t_trait_def.hpp b/include/boost/type_traits/detail/size_t_trait_def.hpp new file mode 100644 index 0000000..d88db9c --- /dev/null +++ b/include/boost/type_traits/detail/size_t_trait_def.hpp @@ -0,0 +1,48 @@ +//----------------------------------------------------------------------------- +// boost/type_traits/detail/size_t_trait_def.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2002 +// Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. + +// no include guards, the header is intended for multiple inclusion! + +#include "boost/type_traits/detail/size_t_trait.hpp" +#include "boost/type_traits/detail/template_arity_spec.hpp" +#include "boost/mpl/aux_/lambda_support.hpp" + +#define BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(trait,T,value) \ +template< typename T > struct trait \ + : ::boost::type_traits::size_t_trait< value > \ +{ \ + 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,value) \ +template<> struct trait \ + : ::boost::type_traits::size_t_trait< value > \ +{ \ + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(spec)) \ +}; \ +/**/ + +// BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) + +#define BOOST_TT_AUX_SIZE_T_TRAIT_PARTIAL_SPEC1_1(param,trait,spec,value) \ +template< param > struct trait \ + : ::boost::type_traits::size_t_trait< value > \ +{ \ +}; \ +/**/ diff --git a/include/boost/type_traits/detail/size_t_trait_undef.hpp b/include/boost/type_traits/detail/size_t_trait_undef.hpp new file mode 100644 index 0000000..cc1c608 --- /dev/null +++ b/include/boost/type_traits/detail/size_t_trait_undef.hpp @@ -0,0 +1,21 @@ +//----------------------------------------------------------------------------- +// boost/type_traits/detail/size_t_trait_undef.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2002 +// Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. + +// no include guards, the header is intended for multiple inclusion! + +#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 new file mode 100644 index 0000000..81e7921 --- /dev/null +++ b/include/boost/type_traits/detail/template_arity_spec.hpp @@ -0,0 +1,40 @@ +//----------------------------------------------------------------------------- +// boost/type_traits/detail/template_arity_spec.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2002 +// Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. + +// no include guards, the header is intended for multiple inclusion! + +#include "boost/mpl/aux_/template_arity_fwd.hpp" +#include "boost/mpl/aux_/preprocessor/params.hpp" +#include "boost/mpl/aux_/lambda_support.hpp" +#include "boost/mpl/aux_/config/overload_resolution.hpp" +#include "boost/config.hpp" + +#if defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT) && \ + defined(BOOST_MPL_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) > \ + > \ +{ \ + BOOST_STATIC_CONSTANT(int, value = i ); \ +}; \ +}} \ +/**/ +#else +# define BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(i, name) /**/ +#endif diff --git a/include/boost/type_traits/detail/type_trait_def.hpp b/include/boost/type_traits/detail/type_trait_def.hpp new file mode 100644 index 0000000..bdcc478 --- /dev/null +++ b/include/boost/type_traits/detail/type_trait_def.hpp @@ -0,0 +1,52 @@ +//----------------------------------------------------------------------------- +// boost/type_traits/detail/type_trait_def.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2002 +// Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. + +// no include guards, the header is intended for multiple inclusion! + +#include "boost/type_traits/detail/template_arity_spec.hpp" +#include "boost/mpl/aux_/lambda_support.hpp" + +#define BOOST_TT_AUX_TYPE_TRAIT_DEF1(trait,T,result) \ +template< typename T > struct trait \ +{ \ + 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 \ +{ \ + typedef result type; \ + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(spec)) \ +}; \ +/**/ + +#define BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(param,trait,spec,result) \ +template< param > struct trait \ +{ \ + typedef result type; \ +}; \ +/**/ + +#define BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(param1,param2,trait,spec,result) \ +template< param1, param2 > struct trait \ +{ \ + typedef result; \ +}; \ +/**/ diff --git a/include/boost/type_traits/detail/type_trait_undef.hpp b/include/boost/type_traits/detail/type_trait_undef.hpp new file mode 100644 index 0000000..e001dcd --- /dev/null +++ b/include/boost/type_traits/detail/type_trait_undef.hpp @@ -0,0 +1,22 @@ +//----------------------------------------------------------------------------- +// boost/type_traits/detail/type_trait_undef.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2002 +// Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. + +// no include guards, the header is intended for multiple inclusion! + +#undef BOOST_TT_AUX_TYPE_TRAIT_DEF1 +#undef BOOST_TT_AUX_TYPE_TRAIT_SPEC1 +#undef BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1 +#undef BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2 diff --git a/include/boost/type_traits/detail/wrap.hpp b/include/boost/type_traits/detail/wrap.hpp new file mode 100644 index 0000000..ed36df2 --- /dev/null +++ b/include/boost/type_traits/detail/wrap.hpp @@ -0,0 +1,17 @@ +// Copyright David Abrahams 2002. Permission to copy, use, +// modify, sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided +// "as is" without express or implied warranty, and with no claim as +// to its suitability for any purpose. + +#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/detail/yes_no_type.hpp b/include/boost/type_traits/detail/yes_no_type.hpp new file mode 100644 index 0000000..3df055f --- /dev/null +++ b/include/boost/type_traits/detail/yes_no_type.hpp @@ -0,0 +1,24 @@ + +// (C) Copyright John Maddock and Steve Cleary 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. + +// See http://www.boost.org for most recent version including documentation. +// +// macros and helpers for working with integral-constant-expressions. + +#ifndef BOOST_TT_DETAIL_YES_NO_TYPE_HPP_INCLUDED +#define BOOST_TT_DETAIL_YES_NO_TYPE_HPP_INCLUDED + +namespace boost { +namespace type_traits { + +typedef char yes_type; +typedef double no_type; + +} // namespace type_traits +} // namespace boost + +#endif // BOOST_TT_DETAIL_YES_NO_TYPE_HPP_INCLUDED diff --git a/include/boost/type_traits/function_traits.hpp b/include/boost/type_traits/function_traits.hpp index 2ec084b..c38d76e 100644 --- a/include/boost/type_traits/function_traits.hpp +++ b/include/boost/type_traits/function_traits.hpp @@ -10,143 +10,14 @@ // This software is provided "as is" without express or implied warranty, // and with no claim as to its suitability for any purpose. -#ifndef BOOST_FUNCTION_TYPE_TRAITS_HPP -#define BOOST_FUNCTION_TYPE_TRAITS_HPP +#ifndef BOOST_TT_FUNCTION_TRAITS_HPP_INCLUDED +#define BOOST_TT_FUNCTION_TRAITS_HPP_INCLUDED -#ifndef BOOST_ICE_TYPE_TRAITS_HPP -#include -#endif -#ifndef BOOST_FWD_TYPE_TRAITS_HPP -#include -#endif -#ifndef BOOST_COMPOSITE_TYPE_TRAITS_HPP -#include -#endif -// -// is a type a function? -// Please note that this implementation is unnecessarily complex: -// we could just use !is_convertible::value, -// except that some compilers erroneously allow conversions from -// function pointers to void*. -// -namespace boost{ -namespace detail{ +#include +#include +#include -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template -struct is_function_helper_base{ BOOST_STATIC_CONSTANT(bool, value = true); }; - -template -struct is_function_helper : is_function_helper_base{}; - -#else - -template -struct is_function_helper -{ - static T* t; - BOOST_STATIC_CONSTANT(bool, value = sizeof(is_function_tester(t)) == sizeof(::boost::type_traits::yes_type)); - //BOOST_STATIC_CONSTANT(bool, value = (!::boost::is_convertible::value)); -}; - -#endif - -template -struct is_function_ref_helper -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; - -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) -template -struct is_function_chooser -{ - typedef is_function_helper type; -}; -template -struct is_function_chooser -{ - typedef is_function_ref_helper type; -}; -#endif -} // namespace detail - -template -struct is_function -{ -private: -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - typedef typename detail::is_function_chooser::value>::type m_type; -#else - // without partial specialistaion we can't use is_reference on - // function types, that leaves this template broken in the case that - // T is a reference: - typedef detail::is_function_helper m_type; -#endif -public: - BOOST_STATIC_CONSTANT(bool, value = m_type::value); -}; +namespace boost { #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION namespace detail { @@ -361,6 +232,6 @@ struct function_traits }; #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -} // boost +} -#endif // BOOST_FUNCTION_TYPE_TRAITS_HPP +#endif // BOOST_TT_FUNCTION_TRAITS_HPP_INCLUDED diff --git a/include/boost/type_traits/fwd.hpp b/include/boost/type_traits/fwd.hpp deleted file mode 100644 index c58dd9c..0000000 --- a/include/boost/type_traits/fwd.hpp +++ /dev/null @@ -1,201 +0,0 @@ -// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. -// Permission to copy, use, modify, sell and -// distribute this software is granted provided this copyright notice appears -// in all copies. This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. -// -// See http://www.boost.org for most recent version including documentation. -// -// forward declarations of type_traits classes -// -#ifndef BOOST_FWD_TYPE_TRAITS_HPP -#define BOOST_FWD_TYPE_TRAITS_HPP - -#include -#include - -#ifndef BOOST_CONFIG_HPP -#include -#endif - -// -// Helper macros for builtin compiler support. -// If your compiler has builtin support for any of the following -// traits concepts, then redefine the appropriate macros to pick -// up on the compiler support: -// -// (these should largely ignore cv-qualifiers) -// BOOST_IS_CLASS(T) should evaluate to true if T is a class or struct type -// BOOST_IS_ENUM(T) should evaluate to true if T is an enumerator type -// BOOST_IS_UNION(T) should evaluate to true if T is a union type -// BOOST_IS_POD(T) should evaluate to true if T is a POD type -// BOOST_IS_EMPTY(T) should evaluate to true if T is an empty struct or union -// BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) should evaluate to true if "T x;" has no effect -// BOOST_HAS_TRIVIAL_COPY(T) should evaluate to true if T(t) <==> memcpy -// BOOST_HAS_TRIVIAL_ASSIGN(T) should evaluate to true if t = u <==> memcpy -// BOOST_HAS_TRIVIAL_DESTRUCTOR(T) should evaluate to true if ~T() has no effect - -#ifdef BOOST_HAS_SGI_TYPE_TRAITS -# define BOOST_IS_POD(T) ::boost::is_same< typename ::__type_traits::is_POD_type, ::__true_type>::value -# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) ::boost::is_same< typename ::__type_traits::has_trivial_default_constructor, ::__true_type>::value -# define BOOST_HAS_TRIVIAL_COPY(T) ::boost::is_same< typename ::__type_traits::has_trivial_copy_constructor, ::__true_type>::value -# define BOOST_HAS_TRIVIAL_ASSIGN(T) ::boost::is_same< typename ::__type_traits::has_trivial_assignment_operator, ::__true_type>::value -# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) ::boost::is_same< typename ::__type_traits::has_trivial_destructor, ::__true_type>::value -#endif - -#ifndef BOOST_IS_CLASS -# define BOOST_IS_CLASS(T) false -#endif - -#ifndef BOOST_IS_ENUM -# define BOOST_IS_ENUM(T) false -#endif - -#ifndef BOOST_IS_UNION -# define BOOST_IS_UNION(T) false -#endif - -#ifndef BOOST_IS_POD -# define BOOST_IS_POD(T) false -#endif - -#ifndef BOOST_IS_EMPTY -# define BOOST_IS_EMPTY(T) false -#endif - -#ifndef BOOST_HAS_TRIVIAL_CONSTRUCTOR -# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) false -#endif - -#ifndef BOOST_HAS_TRIVIAL_COPY -# define BOOST_HAS_TRIVIAL_COPY(T) false -#endif - -#ifndef BOOST_HAS_TRIVIAL_ASSIGN -# define BOOST_HAS_TRIVIAL_ASSIGN(T) false -#endif - -#ifndef BOOST_HAS_TRIVIAL_DESTRUCTOR -# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) false -#endif - -// -// whenever we have a conversion function with elipses -// it needs to be declared __cdecl to suppress compiler -// warnings from MS and Borland compilers: -#if defined(BOOST_MSVC) || defined(__BORLANDC__) -#define BOOST_TT_DECL __cdecl -#else -#define BOOST_TT_DECL -#endif - - -namespace boost{ -// -// forward declare all type traits templates here -// -// conversion_traits.hpp: -template -struct is_convertible; -// alignment_traits.hpp: -template -struct alignment_of; -// arithmetic_traits.hpp: -template -struct is_void; -template -struct is_integral; -template -struct is_float; -template -struct is_arithmetic; -template -struct is_fundamental; - -// cv_traits.hpp: -template -struct is_const; -template -struct is_volatile; -template -struct remove_const; -template -struct remove_volatile; -template -struct remove_cv; -template -struct add_const; -template -struct add_volatile; -template -struct add_cv; - -// composite_traits.hpp: -template -struct is_array; -template -struct is_pointer; -template -struct is_reference; -template -struct is_member_pointer; -template -struct is_member_function_pointer; -template -struct is_enum; -template -struct is_union; - -// object_traits.hpp: -template -struct is_object; -template -struct is_scalar; -template -struct is_class; -template -struct is_compound; -template -struct is_POD; -template -struct has_trivial_constructor; -template -struct has_trivial_copy; -template -struct has_trivial_assign; -template -struct has_trivial_destructor; -template -struct has_nothrow_constructor; -template -struct has_nothrow_copy; -template -struct has_nothrow_assign; -template -struct is_empty; -template -struct is_base_and_derived; - -// transform_traits.hpp: -template -struct remove_reference; -template -struct add_reference; -template -struct remove_bounds; -template -struct remove_pointer; -template -struct add_pointer; - -// same_traits.hpp: -template -struct is_same; - -} // namespace boost - -#endif // BOOST_FWD_TYPE_TRAITS_HPP - - - - diff --git a/include/boost/type_traits/has_nothrow_assign.hpp b/include/boost/type_traits/has_nothrow_assign.hpp new file mode 100644 index 0000000..a4a8531 --- /dev/null +++ b/include/boost/type_traits/has_nothrow_assign.hpp @@ -0,0 +1,26 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_HAS_NOTHROW_ASSIGN_HPP_INCLUDED +#define BOOST_TT_HAS_NOTHROW_ASSIGN_HPP_INCLUDED + +#include "boost/type_traits/has_trivial_assign.hpp" + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_assign,T,::boost::has_trivial_assign::value) + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..c60c0cb --- /dev/null +++ b/include/boost/type_traits/has_nothrow_constructor.hpp @@ -0,0 +1,26 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED +#define BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED + +#include "boost/type_traits/has_trivial_constructor.hpp" + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_constructor,T,::boost::has_trivial_constructor::value) + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..224b154 --- /dev/null +++ b/include/boost/type_traits/has_nothrow_copy.hpp @@ -0,0 +1,26 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_HAS_NOTHROW_COPY_HPP_INCLUDED +#define BOOST_TT_HAS_NOTHROW_COPY_HPP_INCLUDED + +#include "boost/type_traits/has_trivial_copy.hpp" + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_copy,T,::boost::has_trivial_copy::value) + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..9eea57e --- /dev/null +++ b/include/boost/type_traits/has_nothrow_destructor.hpp @@ -0,0 +1,26 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED +#define BOOST_TT_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED + +#include "boost/type_traits/has_trivial_destructor.hpp" + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_destructor,T,::boost::has_trivial_destructor::value) + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#endif // BOOST_TT_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED diff --git a/include/boost/type_traits/has_trivial_assign.hpp b/include/boost/type_traits/has_trivial_assign.hpp new file mode 100644 index 0000000..7da4560 --- /dev/null +++ b/include/boost/type_traits/has_trivial_assign.hpp @@ -0,0 +1,50 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_HAS_TRIVIAL_ASSIGN_HPP_INCLUDED +#define BOOST_TT_HAS_TRIVIAL_ASSIGN_HPP_INCLUDED + +#include "boost/type_traits/is_POD.hpp" +#include "boost/type_traits/is_const.hpp" +#include "boost/type_traits/is_volatile.hpp" +#include "boost/type_traits/detail/ice_and.hpp" +#include "boost/type_traits/detail/ice_or.hpp" +#include "boost/type_traits/detail/ice_not.hpp" +#include "boost/type_traits/config.hpp" + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +namespace detail { + +template +struct has_trivial_assign_impl +{ + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_and< + ::boost::type_traits::ice_or< + ::boost::is_POD::value, + BOOST_HAS_TRIVIAL_ASSIGN(T) + >::value, + ::boost::type_traits::ice_not< ::boost::is_const::value >::value, + ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value + >::value)); +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_assign,T,::boost::detail::has_trivial_assign_impl::value) + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..38cd8e2 --- /dev/null +++ b/include/boost/type_traits/has_trivial_constructor.hpp @@ -0,0 +1,42 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_HAS_TRIVIAL_CONSTRUCTOR_HPP_INCLUDED +#define BOOST_TT_HAS_TRIVIAL_CONSTRUCTOR_HPP_INCLUDED + +#include "boost/type_traits/is_POD.hpp" +#include "boost/type_traits/detail/ice_or.hpp" +#include "boost/type_traits/config.hpp" + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +namespace detail { + +template +struct has_trivial_ctor_impl +{ + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_or< + ::boost::is_POD::value, + BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) + >::value)); +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_constructor,T,::boost::detail::has_trivial_ctor_impl::value) + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..5d31cf5 --- /dev/null +++ b/include/boost/type_traits/has_trivial_copy.hpp @@ -0,0 +1,48 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_HAS_TRIVIAL_COPY_HPP_INCLUDED +#define BOOST_TT_HAS_TRIVIAL_COPY_HPP_INCLUDED + +#include "boost/type_traits/is_volatile.hpp" +#include "boost/type_traits/is_POD.hpp" +#include "boost/type_traits/detail/ice_and.hpp" +#include "boost/type_traits/detail/ice_or.hpp" +#include "boost/type_traits/detail/ice_not.hpp" +#include "boost/type_traits/config.hpp" + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +namespace detail { + +template +struct has_trivial_copy_impl +{ + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_and< + ::boost::type_traits::ice_or< + ::boost::is_POD::value, + BOOST_HAS_TRIVIAL_COPY(T) + >::value, + ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value + >::value)); +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_copy,T,::boost::detail::has_trivial_copy_impl::value) + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..2314271 --- /dev/null +++ b/include/boost/type_traits/has_trivial_destructor.hpp @@ -0,0 +1,42 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_HAS_TRIVIAL_DESTRUCTOR_HPP_INCLUDED +#define BOOST_TT_HAS_TRIVIAL_DESTRUCTOR_HPP_INCLUDED + +#include "boost/type_traits/is_POD.hpp" +#include "boost/type_traits/detail/ice_or.hpp" +#include "boost/type_traits/config.hpp" + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +namespace detail { + +template +struct has_trivial_dtor_impl +{ + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_or< + ::boost::is_POD::value, + BOOST_HAS_TRIVIAL_DESTRUCTOR(T) + >::value)); +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_destructor,T,::boost::detail::has_trivial_dtor_impl::value) + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#endif // BOOST_TT_HAS_TRIVIAL_DESTRUCTOR_HPP_INCLUDED diff --git a/include/boost/type_traits/ice.hpp b/include/boost/type_traits/ice.hpp index 36e0e2e..0195136 100644 --- a/include/boost/type_traits/ice.hpp +++ b/include/boost/type_traits/ice.hpp @@ -9,79 +9,13 @@ // // macros and helpers for working with integral-constant-expressions. -#ifndef BOOST_ICE_TYPE_TRAITS_HPP -#define BOOST_ICE_TYPE_TRAITS_HPP - -#ifndef BOOST_CONFIG_HPP -#include -#endif - - -namespace boost{ -namespace type_traits{ - -typedef char yes_type; -typedef double no_type; - -template -struct ice_not -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template <> -struct ice_not -{ BOOST_STATIC_CONSTANT(bool, value = false); }; - -template -struct ice_or; -template -struct ice_or -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; -template <> -struct ice_or -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; - -template -struct ice_and; -template -struct ice_and -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -template <> -struct ice_and -{ - BOOST_STATIC_CONSTANT(bool, value = true); -}; - -template -struct ice_eq -{ - BOOST_STATIC_CONSTANT(bool, value = (b1 == b2)); -}; - -template -struct ice_ne -{ - BOOST_STATIC_CONSTANT(bool, value = (b1 != b2)); -}; - -#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION -template -const bool ice_eq::value; -template -const bool ice_ne::value; -#endif - -} // namespace type_traits - -} // namespace boost - -#endif // BOOST_ICE_TYPE_TRAITS_HPP - - - +#ifndef BOOST_TT_ICE_HPP_INCLUDED +#define BOOST_TT_ICE_HPP_INCLUDED +#include "boost/type_traits/detail/yes_no_type.hpp" +#include "boost/type_traits/detail/ice_or.hpp" +#include "boost/type_traits/detail/ice_and.hpp" +#include "boost/type_traits/detail/ice_not.hpp" +#include "boost/type_traits/detail/ice_eq.hpp" +#endif // BOOST_TT_ICE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_arithmetic.hpp b/include/boost/type_traits/is_arithmetic.hpp new file mode 100644 index 0000000..21c87ae --- /dev/null +++ b/include/boost/type_traits/is_arithmetic.hpp @@ -0,0 +1,44 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_IS_ARITHMETIC_HPP_INCLUDED +#define BOOST_TT_IS_ARITHMETIC_HPP_INCLUDED + +#include "boost/type_traits/is_integral.hpp" +#include "boost/type_traits/is_float.hpp" +#include "boost/type_traits/detail/ice_or.hpp" +#include "boost/config.hpp" + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +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 + +//* is a type T an arithmetic type described in the standard (3.9.1p8) +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_arithmetic,T,::boost::detail::is_arithmetic_impl::value) + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..72a83b2 --- /dev/null +++ b/include/boost/type_traits/is_array.hpp @@ -0,0 +1,78 @@ + +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard +// Hinnant & John Maddock 2000. Permission to copy, use, modify, +// sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided +// "as is" without express or implied warranty, and with no claim as +// to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_IS_ARRAY_HPP_INCLUDED +#define BOOST_TT_IS_ARRAY_HPP_INCLUDED + +#include "boost/type_traits/config.hpp" + +#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# include "boost/type_traits/detail/yes_no_type.hpp" +# include "boost/type_traits/detail/wrap.hpp" +#endif + +#include + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_array,T,false) +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) + +#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +namespace detail { + +using ::boost::type_traits::yes_type; +using ::boost::type_traits::no_type; +using ::boost::type_traits::wrap; + +template< typename T > T(* is_array_tester1(wrap) )(wrap); +char BOOST_TT_DECL is_array_tester1(...); + +template< typename T> no_type is_array_tester2(T(*)(wrap)); +yes_type BOOST_TT_DECL is_array_tester2(...); + +template< typename T > +struct is_array_impl +{ + BOOST_STATIC_CONSTANT(bool, value = + sizeof(::boost::detail::is_array_tester2( + ::boost::detail::is_array_tester1( + ::boost::type_traits::wrap() + ) + )) == 1 + ); +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_array,T,::boost::detail::is_array_impl::value) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_array,void,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_array,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_array,void volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_array,void const volatile,false) +#endif + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..b6c69bf --- /dev/null +++ b/include/boost/type_traits/is_base_and_derived.hpp @@ -0,0 +1,56 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_IS_BASE_AND_DERIVED_HPP_INCLUDED +#define BOOST_TT_IS_BASE_AND_DERIVED_HPP_INCLUDED + +#include "boost/type_traits/is_class.hpp" +#include "boost/type_traits/is_convertible.hpp" +#include "boost/type_traits/detail/ice_and.hpp" +#include "boost/config.hpp" + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +namespace detail { + +template +struct is_base_and_derived_impl +{ + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_and< + ::boost::is_convertible::value, + ::boost::is_class::value, + ::boost::is_class::value + >::value) + ); +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF2( + is_base_and_derived + , Base + , Derived + , (::boost::detail::is_base_and_derived_impl::value) + ) + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +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) +#endif + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#endif // BOOST_TT_IS_BASE_AND_DERIVED_HPP_INCLUDED diff --git a/include/boost/type_traits/is_class.hpp b/include/boost/type_traits/is_class.hpp index 4dceaf2..c652491 100644 --- a/include/boost/type_traits/is_class.hpp +++ b/include/boost/type_traits/is_class.hpp @@ -6,44 +6,91 @@ // to its suitability for any purpose. // // See http://www.boost.org for most recent version including documentation. -// -#ifndef BOOST_TYPE_TRAITS_IS_CLASS_HPP -# define BOOST_TYPE_TRAITS_IS_CLASS_HPP -# if (defined(__MWERKS__) && __MWERKS__ >= 0x3000) || defined(BOOST_MSVC) && _MSC_FULL_VER > 13012108 || defined(BOOST_NO_COMPILER_CONFIG) -# ifndef BOOST_ICE_TYPE_TRAITS_HPP -# include -# endif +#ifndef BOOST_TT_IS_CLASS_HPP_INCLUDED +#define BOOST_TT_IS_CLASS_HPP_INCLUDED + +#include "boost/type_traits/config.hpp" + +#ifdef BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION +# include "boost/type_traits/detail/yes_no_type.hpp" +#else +# include "boost/type_traits/is_union.hpp" +# include "boost/type_traits/is_scalar.hpp" +# include "boost/type_traits/is_array.hpp" +# include "boost/type_traits/is_reference.hpp" +# include "boost/type_traits/is_void.hpp" +# include "boost/type_traits/is_function.hpp" +# include "boost/type_traits/detail/ice_and.hpp" +# include "boost/type_traits/detail/ice_not.hpp" +#endif + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" -# define BOOST_TYPE_TRAITS_IS_CLASS_DEFINED namespace boost { -template -struct is_class -{ - // This is actually the conforming implementation which works with - // abstract classes. However, enough compilers have trouble with - // it that most will use the one in - // boost/type_traits/object_traits.hpp. This implementation - // actually works with VC7.0, but other interactions seem to fail - // when we use it. +namespace detail { + +#ifdef BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION + +// This is actually the conforming implementation which works with +// abstract classes. However, enough compilers have trouble with +// it that most will use the one in +// boost/type_traits/object_traits.hpp. This implementation +// actually works with VC7.0, but other interactions seem to fail +// when we use it. // is_class<> metafunction due to Paul Mensonides // (leavings@attbi.com). For more details: // http://groups.google.com/groups?hl=en&selm=000001c1cc83%24e154d5e0%247772e50c%40c161550a&rnum=1 - private: - template static ::boost::type_traits::yes_type is_class_helper(void(U::*)(void)); - template static ::boost::type_traits::no_type is_class_helper(...); - public: - BOOST_STATIC_CONSTANT( - bool, value = sizeof( - is_class_helper(0) - ) == sizeof(::boost::type_traits::yes_type)); + +template +struct is_class_impl +{ + template static ::boost::type_traits::yes_type is_class_tester(void(U::*)(void)); + template static ::boost::type_traits::no_type is_class_tester(...); + + BOOST_STATIC_CONSTANT(bool, value = + sizeof(is_class_tester(0)) == sizeof(::boost::type_traits::yes_type) + ); }; -} -# else // nonconforming compilers will use a different impelementation, in object_traits.hpp +#else -# endif // nonconforming implementations +template +struct is_class_impl +{ +# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + 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)); +# else + 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 + >::value)); +# endif +}; -#endif // BOOST_TYPE_TRAITS_IS_CLASS_HPP +# endif // BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_class,T,::boost::detail::is_class_impl::value) + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#endif // BOOST_TT_IS_CLASS_HPP_INCLUDED diff --git a/include/boost/type_traits/is_compound.hpp b/include/boost/type_traits/is_compound.hpp new file mode 100644 index 0000000..29691ab --- /dev/null +++ b/include/boost/type_traits/is_compound.hpp @@ -0,0 +1,53 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_IS_COMPOUND_HPP_INCLUDED +#define BOOST_TT_IS_COMPOUND_HPP_INCLUDED + +#include "boost/type_traits/is_array.hpp" +#include "boost/type_traits/is_pointer.hpp" +#include "boost/type_traits/is_reference.hpp" +#include "boost/type_traits/is_class.hpp" +#include "boost/type_traits/is_union.hpp" +#include "boost/type_traits/is_enum.hpp" +#include "boost/type_traits/is_member_pointer.hpp" +#include "boost/type_traits/detail/ice_or.hpp" +#include "boost/config.hpp" + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +namespace detail { + +template +struct is_compound_impl +{ + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_or< + ::boost::is_array::value, + ::boost::is_pointer::value, + ::boost::is_reference::value, + ::boost::is_class::value, + ::boost::is_union::value, + ::boost::is_enum::value, + ::boost::is_member_pointer::value + >::value)); +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_compound,T,::boost::detail::is_compound_impl::value) + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..34149dd --- /dev/null +++ b/include/boost/type_traits/is_const.hpp @@ -0,0 +1,112 @@ + +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard +// Hinnant & John Maddock 2000. Permission to copy, use, modify, +// sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided +// "as is" without express or implied warranty, and with no claim as +// to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_IS_CONST_HPP_INCLUDED +#define BOOST_TT_IS_CONST_HPP_INCLUDED + +#include "boost/config.hpp" + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# include "boost/type_traits/detail/cv_traits_impl.hpp" +#else +# include "boost/type_traits/is_reference.hpp" +# include "boost/type_traits/is_array.hpp" +# include "boost/type_traits/detail/yes_no_type.hpp" +# include "boost/type_traits/detail/false_result.hpp" +#endif + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +//* is a type T declared const - is_const +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_const,T,::boost::detail::cv_traits_imp::is_const) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T&,false) + +#if defined(__BORLANDC__) +// 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 + +#else + +namespace detail { + +using ::boost::type_traits::yes_type; +using ::boost::type_traits::no_type; + +yes_type is_const_tester(const volatile void*); +no_type is_const_tester(volatile void *); + +template +struct is_const_helper + : ::boost::type_traits::false_result +{ +}; + +template <> +struct is_const_helper +{ + template struct result_ + { + static T* t; + BOOST_STATIC_CONSTANT(bool, value = ( + sizeof(detail::yes_type) == sizeof(detail::is_const_tester(t)) + )); + }; +}; + +template <> +struct is_const_helper +{ + template struct result_ + { + static T t; + BOOST_STATIC_CONSTANT(bool, value = ( + sizeof(detail::yes_type) == sizeof(detail::is_const_tester(&t)) + )); + }; +}; + +template +struct is_const_impl + : is_const_helper< + is_reference::value + , is_array::value + >::template result_ +{ +}; + +} // namespace detail + +//* is a type T declared const - is_const +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_const,T,::boost::detail::is_const_impl::value) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_const,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_const,void const,true) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_const,void volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_const,void const volatile,true) +#endif + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..3027cff --- /dev/null +++ b/include/boost/type_traits/is_convertible.hpp @@ -0,0 +1,235 @@ + +// Copyright (C) 2000 John Maddock (john_maddock@compuserve.com) +// Copyright (C) 2000 Jeremy Siek (jsiek@lsc.nd.edu) +// Copyright (C) 1999, 2000 Jaakko J„rvi (jaakko.jarvi@cs.utu.fi) +// +// Permission to copy and use this software is granted, +// provided this copyright notice appears in all copies. +// Permission to modify the code and to distribute modified code is granted, +// provided this copyright notice appears in all copies, and a notice +// that the code was modified is included with the copyright notice. +// +// This software is provided "as is" without express or implied warranty, +// and with no claim as to its suitability for any purpose. +// + +#ifndef BOOST_TT_IS_CONVERTIBLE_HPP_INCLUDED +#define BOOST_TT_IS_CONVERTIBLE_HPP_INCLUDED + +#include "boost/type_traits/detail/yes_no_type.hpp" +#include "boost/type_traits/config.hpp" + +#if defined(BOOST_MSVC) && (BOOST_MSVC <= 1300) +# include "boost/type_traits/is_void.hpp" +#endif + +// should be always the last #include directive +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +// is one type convertable to another? +// +// there are multiple versions of the is_convertible +// template, almost every compiler seems to require its +// own version. +// +// Thanks to Andrei Alexandrescu for the original version of the +// conversion detection technique! +// + +namespace detail { + +// MS specific version: + +#if defined(BOOST_MSVC) && (BOOST_MSVC <= 1300) + +// This workaround is necessary to handle when From is void +// which is normally taken care of by the partial specialization +// of the is_convertible typename. +using ::boost::type_traits::yes_type; +using ::boost::type_traits::no_type; + +template< typename From > +struct does_conversion_exist +{ + template< typename To > struct result_ + { + static no_type BOOST_TT_DECL _m_check(...); + static yes_type BOOST_TT_DECL _m_check(To); + static From _m_from; + enum { value = sizeof( _m_check(_m_from) ) == sizeof(yes_type) }; + }; +}; + +template<> +struct does_conversion_exist +{ + template< typename To > struct result_ + { + enum { value = ::boost::is_void::value }; + }; +}; + +template +struct is_convertible_impl + : does_conversion_exist::template result_ +{ +}; + +#elif defined(__BORLANDC__) +// +// special version for Borland compilers +// this version breaks when used for some +// UDT conversions: +// +template +struct is_convertible_impl +{ +#pragma option push -w-8074 + // This workaround for Borland breaks the EDG C++ frontend, + // so we only use it for Borland. + template struct checker + { + static ::boost::type_traits::no_type BOOST_TT_DECL _m_check(...); + static ::boost::type_traits::yes_type BOOST_TT_DECL _m_check(T); + }; + + static From _m_from; + static bool const value = sizeof( checker::_m_check(_m_from) ) + == sizeof(::boost::type_traits::yes_type); +#pragma option pop +}; + +#elif defined(__GNUC__) +// special version for gcc compiler + +struct any_conversion +{ + template any_conversion(const T&); + template any_conversion(T&); +}; + +template struct checker +{ + static boost::type_traits::no_type _m_check(any_conversion ...); + static boost::type_traits::yes_type _m_check(T, int); +}; + +template +struct is_convertible_impl +{ + static From _m_from; + static bool const value = sizeof( detail::checker::_m_check(_m_from, 0) ) + == sizeof(::boost::type_traits::yes_type); +}; + +#else + +template +struct is_convertible_impl +{ + static ::boost::type_traits::no_type BOOST_TT_DECL _m_check(...); + static ::boost::type_traits::yes_type BOOST_TT_DECL _m_check(To); + static From _m_from; + + BOOST_STATIC_CONSTANT(bool, value = + sizeof( _m_check(_m_from) ) == sizeof(::boost::type_traits::yes_type) + ); +}; + +#endif // is_convertible_impl + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF2(is_convertible,From,To,(::boost::detail::is_convertible_impl::value)) + +// +// Now add the full and partial specialisations +// for void types, these are common to all the +// implementation above: +// +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename To,is_convertible,void,To,false) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename From,is_convertible,From,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename To,is_convertible,void const,To,false) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename To,is_convertible,void volatile,To,false) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename To,is_convertible,void const volatile,To,false) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename From,is_convertible,From,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename From,is_convertible,From,void volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename From,is_convertible,From,void const volatile,false) +#endif +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +# define TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1(trait,spec1,spec2,value) \ + BOOST_TT_AUX_BOOL_TRAIT_SPEC2(trait,spec1,spec2,value) \ + BOOST_TT_AUX_BOOL_TRAIT_SPEC2(trait,spec1,spec2 const,value) \ + BOOST_TT_AUX_BOOL_TRAIT_SPEC2(trait,spec1,spec2 volatile,value) \ + BOOST_TT_AUX_BOOL_TRAIT_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) \ + /**/ + + TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2(is_convertible,void,void,true) + +# undef TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2 +# undef TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1 + +#else + BOOST_TT_AUX_BOOL_TRAIT_SPEC2(is_convertible,void,void,true) +#endif // BOOST_NO_CV_VOID_SPECIALIZATIONS + + +#if defined(__GNUC__) + +// Declare specializations of is_convertible for all of the floating +// types to all of the integral types. This suppresses some nasty +// warnings + +# define TT_AUX_IS_CONVERTIBLE_SPEC(T1,T2) \ + BOOST_TT_AUX_BOOL_TRAIT_SPEC2(is_convertible,T1,T2,true) \ + /**/ + +# define TT_AUX_IS_CONVERTIBLE_SPEC_2(T1,T2) \ + TT_AUX_IS_CONVERTIBLE_SPEC(T1,signed T2) \ + TT_AUX_IS_CONVERTIBLE_SPEC(T1,unsigned T2) \ + /**/ + +# define TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_SPEC(F) \ + TT_AUX_IS_CONVERTIBLE_SPEC(F,char) \ + TT_AUX_IS_CONVERTIBLE_SPEC_2(F,char) \ + TT_AUX_IS_CONVERTIBLE_SPEC_2(F,short) \ + TT_AUX_IS_CONVERTIBLE_SPEC_2(F,int) \ + TT_AUX_IS_CONVERTIBLE_SPEC_2(F,long) \ + TT_AUX_IS_CONVERTIBLE_SPEC_2(F,long long) \ + /**/ + +# define TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_CV_SPEC(F) \ + TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_SPEC(F const) \ + TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_SPEC(F volatile) \ + TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_SPEC(F const volatile) \ + /**/ + +TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_CV_SPEC(float) +TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_CV_SPEC(double) +TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_CV_SPEC(long double) + +# undef TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_CV_SPEC +# undef TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_SPEC +# undef TT_AUX_IS_CONVERTIBLE_SPEC_2 +# undef TT_AUX_IS_CONVERTIBLE_SPEC + +#endif // __GNUC__ + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#endif // BOOST_TT_IS_CONVERTIBLE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_empty.hpp b/include/boost/type_traits/is_empty.hpp new file mode 100644 index 0000000..9c9191b --- /dev/null +++ b/include/boost/type_traits/is_empty.hpp @@ -0,0 +1,198 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_IS_EMPTY_HPP_INCLUDED +#define BOOST_TT_IS_EMPTY_HPP_INCLUDED + +#include "boost/type_traits/is_convertible.hpp" +#include "boost/type_traits/detail/ice_or.hpp" +#include "boost/type_traits/config.hpp" + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# include "boost/type_traits/remove_cv.hpp" +# include "boost/type_traits/is_class.hpp" +# include "boost/type_traits/add_reference.hpp" +#else +# include "boost/type_traits/is_reference.hpp" +# include "boost/type_traits/is_pointer.hpp" +# include "boost/type_traits/is_member_pointer.hpp" +# include "boost/type_traits/is_array.hpp" +# include "boost/type_traits/is_void.hpp" +# include "boost/type_traits/detail/ice_and.hpp" +# include "boost/type_traits/detail/ice_not.hpp" +#endif + +// should be always the last #include directive +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +namespace detail { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +template +struct empty_helper_t1 : public T +{ + empty_helper_t1(); // hh compiler bug workaround + int i[256]; +}; + +struct empty_helper_t2 { int i[256]; }; + +#ifndef __BORLANDC__ + +template +struct empty_helper +{ + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +template +struct empty_helper +{ + BOOST_STATIC_CONSTANT( + bool, value = (sizeof(empty_helper_t1) == sizeof(empty_helper_t2)) + ); +}; + +template +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_IS_EMPTY(cvt) + >::value + )); +}; + +#else // __BORLANDC__ + +template +struct empty_helper +{ + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +template +struct empty_helper +{ + BOOST_STATIC_CONSTANT(bool, value = ( + sizeof(empty_helper_t1) == sizeof(empty_helper_t2) + )); +}; + +template +struct is_empty_impl +{ + typedef typename remove_cv::type cvt; + typedef typename add_reference::type r_type; + + 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_IS_EMPTY(cvt) + >::value)); +}; + +#endif // __BORLANDC__ + +#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +#ifdef BOOST_MSVC6_MEMBER_TEMPLATES + +template +struct empty_helper_t1 : public T +{ + empty_helper_t1(); + int i[256]; +}; + +struct empty_helper_t2 { int i[256]; }; + +template +struct empty_helper_base +{ + enum { value = (sizeof(empty_helper_t1) == sizeof(empty_helper_t2)) }; +}; + +template +struct empty_helper_nonbase +{ + enum { value = false }; +}; + +template +struct empty_helper_chooser +{ + template struct result_ + { + typedef empty_helper_nonbase type; + }; +}; + +template <> +struct empty_helper_chooser +{ + template struct result_ + { + typedef empty_helper_base type; + }; +}; + +template +struct is_empty_impl +{ + typedef ::boost::detail::empty_helper_chooser< + ::boost::type_traits::ice_and< + ::boost::type_traits::ice_not< ::boost::is_reference::value >::value, + ::boost::type_traits::ice_not< ::boost::is_convertible::value >::value, + ::boost::type_traits::ice_not< ::boost::is_pointer::value >::value, + ::boost::type_traits::ice_not< ::boost::is_member_pointer::value >::value, + ::boost::type_traits::ice_not< ::boost::is_array::value >::value, + ::boost::type_traits::ice_not< ::boost::is_void::value >::value, + ::boost::type_traits::ice_not< + ::boost::is_convertible::value + >::value + >::value > chooser; + + typedef typename chooser::template result_ result; + typedef typename result::type eh_type; + + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_or::value)); +}; + +#else + +template struct is_empty_impl +{ + BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_EMPTY(T)); +}; + +#endif // BOOST_MSVC6_MEMBER_TEMPLATES + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_empty,T,::boost::detail::is_empty_impl::value) + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..f094c0f --- /dev/null +++ b/include/boost/type_traits/is_enum.hpp @@ -0,0 +1,113 @@ + +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard +// Hinnant & John Maddock 2000. Permission to copy, use, modify, +// sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided +// "as is" without express or implied warranty, and with no claim as +// to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_IS_ENUM_HPP_INCLUDED +#define BOOST_TT_IS_ENUM_HPP_INCLUDED + +#include "boost/type_traits/add_reference.hpp" +#include "boost/type_traits/is_arithmetic.hpp" +#include "boost/type_traits/is_reference.hpp" +#include "boost/type_traits/is_convertible.hpp" +#include "boost/type_traits/config.hpp" + +#ifdef BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION +# include "boost/type_traits/is_class.hpp" +#endif + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +#if !(defined(__BORLANDC__) && (__BORLANDC__ <= 0x551)) + +namespace detail { + +struct int_convertible +{ + int_convertible(int); +}; + +// Don't evaluate convertibility to int_convertible unless the type +// is non-arithmetic. This suppresses warnings with GCC. +template +struct is_enum_helper +{ + template struct type + { + BOOST_STATIC_CONSTANT(bool, value = false); + }; +}; + +template <> +struct is_enum_helper +{ + template struct type + : ::boost::is_convertible + { + }; +}; + +template struct is_enum_impl +{ + typedef ::boost::add_reference ar_t; + typedef typename ar_t::type r_type; + +#if defined(BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION) + BOOST_STATIC_CONSTANT(bool, selector = + (::boost::type_traits::ice_or< + ::boost::is_arithmetic::value + , ::boost::is_reference::value + // We MUST do this on conforming compilers in order to + // correctly deduce that noncopyable types are not enums (dwa + // 2002/04/15)... + , ::boost::is_class::value + >::value)); +#else + BOOST_STATIC_CONSTANT(bool, selector = + (::boost::type_traits::ice_or< + ::boost::is_arithmetic::value + , ::boost::is_reference::value + // However, not doing this on non-conforming compilers prevents + // a dependency recursion. + >::value)); +#endif + +#ifdef __BORLANDC__ + typedef ::boost::detail::is_enum_helper< ::boost::is_enum::selector> se_t; +#else + typedef ::boost::detail::is_enum_helper se_t; +#endif + typedef typename se_t::template type helper; + BOOST_STATIC_CONSTANT(bool, value = helper::value); +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_enum,T,::boost::detail::is_enum_impl::value) + +// Specializations suppress some nasty warnings with GCC +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_enum,float,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_enum,double,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_enum,long double,false) + +#else // __BORLANDC__ +// +// buggy is_convertible prevents working +// implementation of is_enum: +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_enum,T,BOOST_IS_ENUM(T)) + +#endif + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#endif // BOOST_TT_IS_ENUM_HPP_INCLUDED diff --git a/include/boost/type_traits/is_float.hpp b/include/boost/type_traits/is_float.hpp new file mode 100644 index 0000000..5450fca --- /dev/null +++ b/include/boost/type_traits/is_float.hpp @@ -0,0 +1,28 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED +#define BOOST_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +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) + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..02c661d --- /dev/null +++ b/include/boost/type_traits/is_function.hpp @@ -0,0 +1,85 @@ + +// Copyright (C) 2000 John Maddock (john_maddock@compuserve.com) +// Copyright (C) 2002 Aleksey Gurtovoy (agurtovoy@meta-comm.com) +// +// Permission to copy and use this software is granted, +// provided this copyright notice appears in all copies. +// Permission to modify the code and to distribute modified code is granted, +// provided this copyright notice appears in all copies, and a notice +// that the code was modified is included with the copyright notice. +// +// This software is provided "as is" without express or implied warranty, +// and with no claim as to its suitability for any purpose. + +#ifndef BOOST_TT_IS_FUNCTION_HPP_INCLUDED +#define BOOST_TT_IS_FUNCTION_HPP_INCLUDED + +#include "boost/type_traits/is_reference.hpp" +#include "boost/type_traits/detail/false_result.hpp" +#include "boost/config.hpp" + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# include "boost/type_traits/detail/is_function_ptr_helper.hpp" +#else +# include "boost/type_traits/detail/is_function_ptr_tester.hpp" +# include "boost/type_traits/detail/yes_no_type.hpp" +#endif + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +// is a type a function? +// Please note that this implementation is unnecessarily complex: +// we could just use !is_convertible::value, +// except that some compilers erroneously allow conversions from +// function pointers to void*. + +namespace boost { +namespace detail { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +template +struct is_function_chooser + : ::boost::type_traits::false_result +{ +}; + +template <> +struct is_function_chooser +{ + template< typename T > struct result_ + : ::boost::type_traits::is_function_ptr_helper + { + }; +}; + +template +struct is_function_impl + : is_function_chooser< ::boost::is_reference::value > + ::template result_ +{ +}; + +#else + +template +struct is_function_impl +{ + static T* t; + BOOST_STATIC_CONSTANT( + bool, value = sizeof(::boost::type_traits::is_function_ptr_tester(t)) + == sizeof(::boost::type_traits::yes_type) + ); +}; + +#endif + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_function,T,::boost::detail::is_function_impl::value) + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..09e4da9 --- /dev/null +++ b/include/boost/type_traits/is_fundamental.hpp @@ -0,0 +1,42 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_IS_FUNDAMENTAL_HPP_INCLUDED +#define BOOST_TT_IS_FUNDAMENTAL_HPP_INCLUDED + +#include "boost/type_traits/is_arithmetic.hpp" +#include "boost/type_traits/is_void.hpp" +#include "boost/type_traits/detail/ice_or.hpp" + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +namespace detail { + +template +struct is_fundamental_impl + : ::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) +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_fundamental,T,::boost::detail::is_fundamental_impl::value) + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..e02a468 --- /dev/null +++ b/include/boost/type_traits/is_integral.hpp @@ -0,0 +1,54 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_IS_INTEGRAL_HPP_INCLUDED +#define BOOST_TT_IS_INTEGRAL_HPP_INCLUDED + +#include "boost/config.hpp" + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +//* is a type T an [cv-qualified-] integral type described in the standard (3.9.1p3) +// as an extention we include long long, as this is likely to be added to the +// standard at a later date +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_integral,T,false) + +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) + +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) + +#ifndef BOOST_NO_INTRINSIC_WCHAR_T +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true) +#endif + +# if defined(BOOST_HAS_LONG_LONG) +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned long long,true) +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,long long,true) +#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) +#endif + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#endif // BOOST_TT_IS_INTEGRAL_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 719ae5d..cab7ea4 100644 --- a/include/boost/type_traits/is_member_function_pointer.hpp +++ b/include/boost/type_traits/is_member_function_pointer.hpp @@ -79,21 +79,25 @@ struct is_mem_fun_pointer_impl #else // Borland C++ +namespace detail { + template -struct is_member_function_pointer_impl +struct is_mem_fun_pointer_impl { static T& m_t; BOOST_STATIC_CONSTANT( bool, value = - (1 == sizeof(detail::is_member_function_pointer_helper(m_t))) ); + (1 == sizeof(type_traits::is_mem_fun_pointer_tester(m_t))) ); }; template -struct is_member_function_pointer_impl +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = false); }; +} // namespace detail + #endif BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_function_pointer,T,::boost::detail::is_mem_fun_pointer_impl::value) diff --git a/include/boost/type_traits/is_member_pointer.hpp b/include/boost/type_traits/is_member_pointer.hpp new file mode 100644 index 0000000..f285d32 --- /dev/null +++ b/include/boost/type_traits/is_member_pointer.hpp @@ -0,0 +1,96 @@ + +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard +// Hinnant & John Maddock 2000. Permission to copy, use, modify, +// sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided +// "as is" without express or implied warranty, and with no claim as +// to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED +#define BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED + +#include "boost/type_traits/config.hpp" + +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(__BORLANDC__) +# include "boost/type_traits/is_member_function_pointer.hpp" +#else +# include "boost/type_traits/is_reference.hpp" +# include "boost/type_traits/is_array.hpp" +# include "boost/type_traits/detail/is_mem_fun_pointer_tester.hpp" +# include "boost/type_traits/detail/yes_no_type.hpp" +# include "boost/type_traits/detail/false_result.hpp" +# include "boost/type_traits/detail/ice_or.hpp" +#endif + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +#if defined(__BORLANDC__) +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) + +#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,::boost::is_member_function_pointer::value) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*,true) + +#else // no partial template specialization + +namespace detail { + +template +::boost::type_traits::yes_type BOOST_TT_DECL is_member_pointer_tester(R T::*); +::boost::type_traits::no_type BOOST_TT_DECL is_member_pointer_tester(...); + +template +struct is_member_pointer_select + : ::boost::type_traits::false_result +{ +}; + +template <> +struct is_member_pointer_select +{ + template struct result_ + { + static T& make_t(); + BOOST_STATIC_CONSTANT( + bool, value = + (::boost::type_traits::ice_or< + (1 == sizeof(::boost::type_traits::is_mem_fun_pointer_tester(make_t()))), + (1 == sizeof(is_member_pointer_tester(make_t()))) + >::value) ); + }; +}; + +template +struct is_member_pointer_impl + : is_member_pointer_select< + ::boost::type_traits::ice_or< + ::boost::is_reference::value + , ::boost::is_array::value + >::value + >::template result_ +{ +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,::boost::detail::is_member_pointer_impl::value) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_member_pointer,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_member_pointer,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_member_pointer,void volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_member_pointer,void const volatile,false) +#endif + +#endif // __BORLANDC__ + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#endif // BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/is_object.hpp b/include/boost/type_traits/is_object.hpp new file mode 100644 index 0000000..efe737b --- /dev/null +++ b/include/boost/type_traits/is_object.hpp @@ -0,0 +1,54 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_IS_OBJECT_HPP_INCLUDED +#define BOOST_TT_IS_OBJECT_HPP_INCLUDED + +#include "boost/type_traits/is_reference.hpp" +#include "boost/type_traits/is_void.hpp" +#include "boost/type_traits/is_function.hpp" +#include "boost/type_traits/detail/ice_and.hpp" +#include "boost/type_traits/detail/ice_not.hpp" +#include "boost/config.hpp" + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +namespace detail { + +template +struct is_object_impl +{ +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + 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)); +#else + 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 + >::value)); +#endif +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_object,T,::boost::detail::is_object_impl::value) + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..907e1b3 --- /dev/null +++ b/include/boost/type_traits/is_pod.hpp @@ -0,0 +1,123 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_IS_POD_HPP_INCLUDED +#define BOOST_TT_IS_POD_HPP_INCLUDED + +#include "boost/type_traits/is_void.hpp" +#include "boost/type_traits/is_scalar.hpp" +#include "boost/type_traits/detail/ice_or.hpp" +#include "boost/type_traits/config.hpp" + +#include + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +// forward declaration, needed by 'is_POD_array_helper' template below +template< typename T > struct is_POD; + +namespace detail { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +template struct is_POD_impl +{ + BOOST_STATIC_CONSTANT( + bool, value = + (::boost::type_traits::ice_or< + ::boost::is_scalar::value, + ::boost::is_void::value, + BOOST_IS_POD(T) + >::value)); +}; + +template +struct is_POD_impl + : is_POD_impl +{ +}; + +#else + +template +struct is_POD_helper +{ + template struct result_ + { + BOOST_STATIC_CONSTANT( + bool, value = + (::boost::type_traits::ice_or< + ::boost::is_scalar::value, + ::boost::is_void::value, + BOOST_IS_POD(T) + >::value)); + }; +}; + +template +struct bool_to_yes_no_type +{ + typedef ::boost::type_traits::no_type type; +}; + +template <> +struct bool_to_yes_no_type +{ + typedef ::boost::type_traits::yes_type type; +}; + +template +struct is_POD_array_helper +{ + enum { is_pod = ::boost::is_POD::value }; // MSVC workaround + typedef typename bool_to_yes_no_type::type type; + type instance() const; +}; + +template +is_POD_array_helper is_POD_array(T*); + +template <> +struct is_POD_helper +{ + template struct result_ + { + static T& help(); + BOOST_STATIC_CONSTANT(bool, value = + sizeof(is_POD_array(help()).instance()) == sizeof(::boost::type_traits::yes_type) + ); + }; +}; + + +template struct is_POD_impl +{ + BOOST_STATIC_CONSTANT( + bool, value = ( + ::boost::detail::is_POD_helper< + ::boost::is_array::value + >::template result_::value + ) + ); +}; + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_POD,T,::boost::detail::is_POD_impl::value) + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..a483585 --- /dev/null +++ b/include/boost/type_traits/is_pointer.hpp @@ -0,0 +1,132 @@ + +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard +// Hinnant & John Maddock 2000. Permission to copy, use, modify, +// sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided +// "as is" without express or implied warranty, and with no claim as +// to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_IS_POINTER_HPP_INCLUDED +#define BOOST_TT_IS_POINTER_HPP_INCLUDED + +#include "boost/type_traits/is_member_pointer.hpp" +#include "boost/type_traits/detail/ice_and.hpp" +#include "boost/type_traits/detail/ice_not.hpp" +#include "boost/type_traits/config.hpp" + +#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# include "boost/type_traits/is_reference.hpp" +# include "boost/type_traits/is_array.hpp" +# include "boost/type_traits/detail/is_function_ptr_tester.hpp" +# include "boost/type_traits/detail/false_result.hpp" +# include "boost/type_traits/detail/ice_or.hpp" +#endif + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +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) +TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T* const,true) +TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T* volatile,true) +TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T* const volatile,true) + +# undef TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC + +template< typename T > +struct is_pointer_impl +{ + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_and< + ::boost::detail::is_pointer_helper::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) + +#else // no partial template specialization + +namespace detail { + +struct pointer_helper +{ + pointer_helper(const volatile void*); +}; + +yes_type BOOST_TT_DECL is_pointer_tester(pointer_helper); +no_type BOOST_TT_DECL is_pointer_tester(...); + +template +struct is_pointer_select + : ::boost::type_traits::false_result +{ +}; + +template <> +struct is_pointer_select +{ + template struct result_ + { + static T& make_t(); + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_or< + (1 == sizeof(is_pointer_tester(make_t()))), + (1 == sizeof(type_traits::is_function_ptr_tester(make_t()))) + >::value)); + }; +}; + +template +struct is_pointer_impl + : is_pointer_select< + ::boost::type_traits::ice_or< + ::boost::is_reference::value + , ::boost::is_array::value + >::value + >::template result_ +{ +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pointer,T,::boost::detail::is_pointer_impl::value) + +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_pointer,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_pointer,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_pointer,void volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_pointer,void const volatile,false) +#endif + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#endif // BOOST_TT_IS_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/is_reference.hpp b/include/boost/type_traits/is_reference.hpp new file mode 100644 index 0000000..354d8be --- /dev/null +++ b/include/boost/type_traits/is_reference.hpp @@ -0,0 +1,95 @@ + +// (C) Copyright David Abrahams Steve Cleary, Beman Dawes, Howard +// Hinnant & John Maddock 2000-2002. Permission to copy, use, +// modify, sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided +// "as is" without express or implied warranty, and with no claim as +// to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_IS_REFERENCE_HPP_INCLUDED +#define BOOST_TT_IS_REFERENCE_HPP_INCLUDED + +#include "boost/type_traits/config.hpp" + +#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# include "boost/type_traits/detail/yes_no_type.hpp" +# include "boost/type_traits/detail/wrap.hpp" +#endif + +#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && defined(BOOST_MSVC) +# include "boost/type_traits/detail/is_function_type_tester.hpp" +# include "boost/type_traits/detail/false_result.hpp" +#endif + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_reference,T,false) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_reference,T&,true) + +#if defined(__BORLANDC__) +// 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_reference,T& const,true) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_reference,T& volatile,true) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_reference,T& const volatile,true) +#endif + +#else + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4181) +#endif + +namespace detail { + +using ::boost::type_traits::yes_type; +using ::boost::type_traits::no_type; +using ::boost::type_traits::wrap; + +template T&(* is_reference_helper1(wrap) )(wrap); +char is_reference_helper1(...); + +template no_type is_reference_helper2(T&(*)(wrap)); +yes_type is_reference_helper2(...); + +template +struct is_reference_impl +{ + BOOST_STATIC_CONSTANT( + bool, value = sizeof( + ::boost::detail::is_reference_helper2( + ::boost::detail::is_reference_helper1(::boost::type_traits::wrap()))) == 1 + ); +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_reference,T,::boost::detail::is_reference_impl::value) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_reference,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_reference,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_reference,void volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_reference,void const volatile,false) +#endif + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..8cd18ab --- /dev/null +++ b/include/boost/type_traits/is_same.hpp @@ -0,0 +1,81 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Aleksey Gurtovoy, +// Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This +// software is provided "as is" without express or implied warranty, and +// with no claim as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_IS_SAME_HPP_INCLUDED +#define BOOST_TT_IS_SAME_HPP_INCLUDED + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +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) + +#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +namespace detail { + +#ifdef BOOST_MSVC +// the following VC6 specific implementation is *NOT* legal +// C++, but has the advantage that it works for incomplete +// types. + +template< typename T1 > +struct is_same_part_1 +{ + template struct part_2 { enum { value = false }; }; + template<> struct part_2 { enum { value = true }; }; +}; + +template< typename T1, typename T2 > +struct is_same_impl +{ + enum { value = detail::is_same_part_1::template part_2::value }; +}; + +#else // generic "no-partial-specialization" version + +template +::boost::type_traits::yes_type +BOOST_TT_DECL is_same_tester(T*, T*); + +::boost::type_traits::no_type +BOOST_TT_DECL is_same_tester(...); + +template +struct is_same_impl +{ + static T t; + static U u; + + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_and< + (sizeof(type_traits::yes_type) == sizeof(detail::is_same_tester(&t,&u))), + (::boost::is_reference::value == ::boost::is_reference::value), + (sizeof(T) == sizeof(U)) + >::value)); +}; + +#endif // BOOST_MSVC + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF2(is_same,T,U,(::boost::detail::is_same_impl::value)) + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..51f587f --- /dev/null +++ b/include/boost/type_traits/is_scalar.hpp @@ -0,0 +1,47 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_IS_SCALAR_HPP_INCLUDED +#define BOOST_TT_IS_SCALAR_HPP_INCLUDED + +#include "boost/type_traits/is_arithmetic.hpp" +#include "boost/type_traits/is_enum.hpp" +#include "boost/type_traits/is_pointer.hpp" +#include "boost/type_traits/is_member_pointer.hpp" +#include "boost/type_traits/detail/ice_or.hpp" +#include "boost/config.hpp" + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +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)); +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_scalar,T,::boost::detail::is_scalar_impl::value) + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#endif // BOOST_TT_IS_SCALAR_HPP_INCLUDED diff --git a/include/boost/type_traits/is_stateless.hpp b/include/boost/type_traits/is_stateless.hpp new file mode 100644 index 0000000..d2c764b --- /dev/null +++ b/include/boost/type_traits/is_stateless.hpp @@ -0,0 +1,49 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_IS_STATELESS_HPP_INCLUDED +#define BOOST_TT_IS_STATELESS_HPP_INCLUDED + +#include "boost/type_traits/has_trivial_constructor.hpp" +#include "boost/type_traits/has_trivial_copy.hpp" +#include "boost/type_traits/has_trivial_destructor.hpp" +#include "boost/type_traits/is_class.hpp" +#include "boost/type_traits/is_empty.hpp" +#include "boost/type_traits/detail/ice_and.hpp" +#include "boost/config.hpp" + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +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) + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..507c000 --- /dev/null +++ b/include/boost/type_traits/is_union.hpp @@ -0,0 +1,36 @@ + +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard +// Hinnant & John Maddock 2000. Permission to copy, use, modify, +// sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided +// "as is" without express or implied warranty, and with no claim as +// to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_IS_UNION_HPP_INCLUDED +#define BOOST_TT_IS_UNION_HPP_INCLUDED + +#include "boost/type_traits/remove_cv.hpp" +#include "boost/type_traits/config.hpp" + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +namespace detail { +template struct is_union_impl +{ + typedef typename remove_cv::type cvt; + BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(cvt)); +}; +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_union,T,::boost::detail::is_union_impl::value) + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#endif // BOOST_TT_IS_UNION_HPP_INCLUDED diff --git a/include/boost/type_traits/is_void.hpp b/include/boost/type_traits/is_void.hpp new file mode 100644 index 0000000..1ef7eb7 --- /dev/null +++ b/include/boost/type_traits/is_void.hpp @@ -0,0 +1,34 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_IS_VOID_HPP_INCLUDED +#define BOOST_TT_IS_VOID_HPP_INCLUDED + +#include "boost/config.hpp" + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +//* is a type T void - is_void +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_void,T,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void,true) + +#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 + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..dd3395a --- /dev/null +++ b/include/boost/type_traits/is_volatile.hpp @@ -0,0 +1,112 @@ + +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard +// Hinnant & John Maddock 2000. Permission to copy, use, modify, +// sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided +// "as is" without express or implied warranty, and with no claim as +// to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_IS_VOLATILE_HPP_INCLUDED +#define BOOST_TT_IS_VOLATILE_HPP_INCLUDED + +#include "boost/config.hpp" + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# include "boost/type_traits/detail/cv_traits_impl.hpp" +#else +# include "boost/type_traits/is_reference.hpp" +# include "boost/type_traits/is_array.hpp" +# include "boost/type_traits/detail/yes_no_type.hpp" +# include "boost/type_traits/detail/false_result.hpp" +#endif + +// should be the last #include +#include "boost/type_traits/detail/bool_trait_def.hpp" + +namespace boost { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +//* is a type T declared volatile - is_volatile +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,::boost::detail::cv_traits_imp::is_volatile) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T&,false) + +#if defined(__BORLANDC__) +// 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 + +#else + +namespace detail { + +using ::boost::type_traits::yes_type; +using ::boost::type_traits::no_type; + +yes_type is_volatile_tester(void const volatile*); +no_type is_volatile_tester(void const*); + +template +struct is_volatile_helper + : ::boost::type_traits::false_result +{ +}; + +template <> +struct is_volatile_helper +{ + template struct result_ + { + static T* t; + BOOST_STATIC_CONSTANT(bool, value = ( + sizeof(detail::yes_type) == sizeof(detail::is_volatile_tester(t)) + )); + }; +}; + +template <> +struct is_volatile_helper +{ + template struct result_ + { + static T t; + BOOST_STATIC_CONSTANT(bool, value = ( + sizeof(detail::yes_type) == sizeof(detail::is_volatile_tester(&t)) + )); + }; +}; + +template +struct is_volatile_impl + : is_volatile_helper< + is_reference::value + , is_array::value + >::template result_ +{ +}; + +} // namespace detail + +//* is a type T declared volatile - is_volatile +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,::boost::detail::is_volatile_impl::value) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_volatile,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_volatile,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_volatile,void volatile,true) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_volatile,void const volatile,true) +#endif + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include "boost/type_traits/detail/bool_trait_undef.hpp" + +#endif // BOOST_TT_IS_VOLATILE_HPP_INCLUDED diff --git a/include/boost/type_traits/object_traits.hpp b/include/boost/type_traits/object_traits.hpp index 4386e9c..f9c963a 100644 --- a/include/boost/type_traits/object_traits.hpp +++ b/include/boost/type_traits/object_traits.hpp @@ -12,551 +12,23 @@ // has_trivial_destructor, is_empty. // -#ifndef BOOST_OBJECT_TYPE_TRAITS_HPP -#define BOOST_OBJECT_TYPE_TRAITS_HPP - -#ifndef BOOST_ICE_TYPE_TRAITS_HPP -#include -#endif -#ifndef BOOST_FWD_TYPE_TRAITS_HPP -#include -#endif -#ifndef BOOST_COMPOSITE_TYPE_TRAITS_HPP -#include -#endif -#ifndef BOOST_ARITHMETIC_TYPE_TRAITS_HPP -#include -#endif -#ifndef BOOST_FUNCTION_TYPE_TRAITS_HPP -#include -#endif -#ifndef BOOST_TYPE_TRAITS_IS_CLASS_HPP -# include -#endif - -#ifdef BOOST_HAS_SGI_TYPE_TRAITS -# include -# include -#endif - -namespace boost{ - -/********************************************** - * - * is_object - * - **********************************************/ -template -struct is_object -{ -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - 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)); -#else - 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 - >::value)); -#endif -}; - -/********************************************** - * - * is_scalar - * - **********************************************/ -template -struct is_scalar -{ - 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)); -}; - -# ifndef BOOST_TYPE_TRAITS_IS_CLASS_DEFINED -// conforming compilers use the implementation in -/********************************************** - * - * is_class - * - **********************************************/ -template -struct is_class -{ -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - - 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)); -# else - 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 - >::value)); -# endif -}; -# endif // nonconforming implementations -/********************************************** - * - * is_compound - * - **********************************************/ -template struct is_compound -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::is_array::value, - ::boost::is_pointer::value, - ::boost::is_reference::value, - ::boost::is_class::value, - ::boost::is_union::value, - ::boost::is_enum::value, - ::boost::is_member_pointer::value - >::value)); -}; - -/********************************************** - * - * is_POD - * - **********************************************/ - -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -template struct is_POD -{ - BOOST_STATIC_CONSTANT( - bool, value = - (::boost::type_traits::ice_or< - ::boost::is_scalar::value, - ::boost::is_void::value, - BOOST_IS_POD(T) - >::value)); -}; - -template -struct is_POD -{ - BOOST_STATIC_CONSTANT(bool, value = ::boost::is_POD::value); -}; -#else -namespace detail -{ - template struct is_POD_helper; -} - -template struct is_POD -{ - BOOST_STATIC_CONSTANT( - bool, value = ( - ::boost::detail::is_POD_helper< - ::boost::is_array::value - >::template apply::value - ) - ); -}; - -namespace detail -{ - template - struct is_POD_helper - { - template struct apply - { - BOOST_STATIC_CONSTANT( - bool, value = - (::boost::type_traits::ice_or< - ::boost::is_scalar::value, - ::boost::is_void::value, - BOOST_IS_POD(T) - >::value)); - }; - }; - - template - struct bool_to_type - { - typedef ::boost::type_traits::no_type type; - }; - - template <> - struct bool_to_type - { - typedef ::boost::type_traits::yes_type type; - }; - - template - struct is_POD_array_helper - { - typedef -#if !defined(__BORLANDC__) || __BORLANDC__ > 0x551 - typename -#endif - ::boost::detail::bool_to_type<(::boost::is_POD::value)>::type type; - - type instance() const; - }; - - template - is_POD_array_helper is_POD_array(T*); - - template <> - struct is_POD_helper - { - template struct apply - { - static T& help(); - - BOOST_STATIC_CONSTANT( - bool, value = - sizeof(is_POD_array(help()).instance()) == sizeof(::boost::type_traits::yes_type)); - }; - }; -} -#endif - -/********************************************** - * - * has_trivial_constructor - * - **********************************************/ -template -struct has_trivial_constructor -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::is_POD::value, - BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) - >::value)); -}; - -/********************************************** - * - * has_trivial_copy - * - **********************************************/ -template -struct has_trivial_copy -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - ::boost::type_traits::ice_or< - ::boost::is_POD::value, - BOOST_HAS_TRIVIAL_COPY(T) - >::value, - ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value - >::value)); -}; - -/********************************************** - * - * has_trivial_assign - * - **********************************************/ -template -struct has_trivial_assign -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - ::boost::type_traits::ice_or< - ::boost::is_POD::value, - BOOST_HAS_TRIVIAL_ASSIGN(T) - >::value, - ::boost::type_traits::ice_not< ::boost::is_const::value >::value, - ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value - >::value)); -}; - -/********************************************** - * - * has_trivial_destructor - * - **********************************************/ -template -struct has_trivial_destructor -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::is_POD::value, - BOOST_HAS_TRIVIAL_DESTRUCTOR(T) - >::value)); -}; - -/********************************************** - * - * has_nothrow_constructor - * - **********************************************/ -template -struct has_nothrow_constructor -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::has_trivial_constructor::value)); -}; - -/********************************************** - * - * has_nothrow_copy - * - **********************************************/ -template -struct has_nothrow_copy -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::has_trivial_copy::value)); -}; - -/********************************************** - * - * has_nothrow_assign - * - **********************************************/ -template -struct has_nothrow_assign -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::has_trivial_assign::value)); -}; - -/********************************************** - * - * is_empty - * - **********************************************/ -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -namespace detail -{ - template - struct empty_helper_t1 : public T - { -//#ifdef __MWERKS__ - empty_helper_t1(); // hh compiler bug workaround -//#endif - int i[256]; - }; - struct empty_helper_t2 { int i[256]; }; -} - -# ifndef __BORLANDC__ -namespace detail -{ - template - struct empty_helper{ BOOST_STATIC_CONSTANT(bool, value = false); }; - - template - struct empty_helper - { - BOOST_STATIC_CONSTANT( - bool, value = (sizeof(empty_helper_t1) == sizeof(empty_helper_t2))); - }; -} - -template -struct is_empty -{ - private: - typedef typename remove_cv::type cvt; - - public: - BOOST_STATIC_CONSTANT( - bool, value = ( - ::boost::type_traits::ice_or< - ::boost::detail::empty_helper::value>::value - , BOOST_IS_EMPTY(cvt) - >::value - )); -}; - -# else // __BORLANDC__ - -namespace detail -{ - template - struct empty_helper{ BOOST_STATIC_CONSTANT(bool, value = false); }; - - template - struct empty_helper - { - BOOST_STATIC_CONSTANT(bool, value = - (sizeof(empty_helper_t1) == sizeof(empty_helper_t2))); - }; -} - -template -struct is_empty -{ -private: - typedef typename remove_cv::type cvt; - typedef typename add_reference::type r_type; -public: - BOOST_STATIC_CONSTANT( - bool, value = ( - ::boost::type_traits::ice_or< - ::boost::detail::empty_helper< - T - , ::boost::is_class::value - , ::boost::is_convertible< r_type,int>::value - >::value - , BOOST_IS_EMPTY(cvt) - >::value)); -}; -# endif // __BORLANDC__ - -#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -#ifdef BOOST_MSVC6_MEMBER_TEMPLATES - -namespace detail{ - -template -struct empty_helper_t1 : public T -{ - empty_helper_t1(); - int i[256]; -}; -struct empty_helper_t2 { int i[256]; }; - -template -struct empty_helper_base -{ - enum{ value = (sizeof(empty_helper_t1) == sizeof(empty_helper_t2)) }; -}; - -template -struct empty_helper_nonbase -{ - enum{ value = false }; -}; - -template -struct empty_helper_chooser -{ - template - struct rebind - { - typedef empty_helper_nonbase type; - }; -}; - -template <> -struct empty_helper_chooser -{ - template - struct rebind - { - typedef empty_helper_base type; - }; -}; - -} // namespace detail - -template -struct is_empty -{ -private: - typedef ::boost::detail::empty_helper_chooser< - ::boost::type_traits::ice_and< - ::boost::type_traits::ice_not< - ::boost::is_reference::value>::value, - ::boost::type_traits::ice_not< - ::boost::is_convertible::value>::value, - ::boost::type_traits::ice_not< - ::boost::is_pointer::value>::value, - ::boost::type_traits::ice_not< - ::boost::is_member_pointer::value>::value, - ::boost::type_traits::ice_not< - ::boost::is_array::value>::value, - ::boost::type_traits::ice_not< - ::boost::is_void::value>::value, - ::boost::type_traits::ice_not< - ::boost::is_convertible::value>::value - >::value> chooser; - typedef typename chooser::template rebind bound_type; - typedef typename bound_type::type eh_type; -public: - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or::value)); -}; - -#else -template struct is_empty -{ enum{ value = BOOST_IS_EMPTY(T) }; }; -#endif // BOOST_MSVC6_MEMBER_TEMPLATES - -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - -/********************************************** - * - * is_stateless - * - **********************************************/ -template -struct is_stateless -{ - 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)); -}; - -template -struct is_base_and_derived -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - ::boost::is_convertible::value, - ::boost::is_class::value, - ::boost::is_class::value - >::value) - ); -}; - -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -template -struct is_base_and_derived -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -template -struct is_base_and_derived -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -template -struct is_base_and_derived -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -#endif - -} // namespace boost - -#endif // BOOST_OBJECT_TYPE_TRAITS_HPP - - - - - +#ifndef BOOST_TT_OBJECT_TRAITS_HPP_INLCUDED +#define BOOST_TT_OBJECT_TRAITS_HPP_INLCUDED +#include "boost/type_traits/has_trivial_assign.hpp" +#include "boost/type_traits/has_trivial_constructor.hpp" +#include "boost/type_traits/has_trivial_copy.hpp" +#include "boost/type_traits/has_trivial_destructor.hpp" +#include "boost/type_traits/has_nothrow_constructor.hpp" +#include "boost/type_traits/has_nothrow_copy.hpp" +#include "boost/type_traits/has_nothrow_assign.hpp" +#include "boost/type_traits/is_base_and_derived.hpp" +#include "boost/type_traits/is_class.hpp" +#include "boost/type_traits/is_compound.hpp" +#include "boost/type_traits/is_empty.hpp" +#include "boost/type_traits/is_object.hpp" +#include "boost/type_traits/is_POD.hpp" +#include "boost/type_traits/is_scalar.hpp" +#include "boost/type_traits/is_stateless.hpp" +#endif // BOOST_TT_OBJECT_TRAITS_HPP_INLCUDED diff --git a/include/boost/type_traits/reference_traits.hpp b/include/boost/type_traits/reference_traits.hpp index b9df72a..aa7729b 100644 --- a/include/boost/type_traits/reference_traits.hpp +++ b/include/boost/type_traits/reference_traits.hpp @@ -6,85 +6,10 @@ // to its suitability for any purpose. // // See http://www.boost.org for most recent version including documentation. -// -#ifndef BOOST_TT_REFERENCE_TRAITS_HPP -# define BOOST_TT_REFERENCE_TRAITS_HPP -# ifndef BOOST_TT_UTILITY_HPP -# include -# endif // BOOST_TT_UTILITY_HPP +#ifndef BOOST_TT_REFERENCE_TRAITS_HPP_INCLUDED +#define BOOST_TT_REFERENCE_TRAITS_HPP_INCLUDED -namespace boost { +#include "boost/type_traits/is_reference.hpp" -/********************************************** - * - * is_reference - * - **********************************************/ -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -template struct is_reference -{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template struct is_reference -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#if defined(__BORLANDC__) -// 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... -template struct is_reference -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template struct is_reference -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -template struct is_reference -{ BOOST_STATIC_CONSTANT(bool, value = true); }; -#endif -#else -# ifdef BOOST_MSVC -# pragma warning(push) -# pragma warning(disable: 4181) -#endif // BOOST_MSVC - -namespace detail -{ - using ::boost::type_traits::yes_type; - using ::boost::type_traits::no_type; - using ::boost::type_traits::wrap; - - template T&(* is_reference_helper1(wrap) )(wrap); - char is_reference_helper1(...); - - template no_type is_reference_helper2(T&(*)(wrap)); - yes_type is_reference_helper2(...); -} - -template -struct is_reference -{ - BOOST_STATIC_CONSTANT( - bool, value = sizeof( - ::boost::detail::is_reference_helper2( - ::boost::detail::is_reference_helper1(::boost::type_traits::wrap()))) == 1 - ); -}; - -template <> struct is_reference -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -template <> struct is_reference -{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template <> struct is_reference -{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template <> struct is_reference -{ BOOST_STATIC_CONSTANT(bool, value = false); }; -#endif - -# ifdef BOOST_MSVC -# pragma warning(pop) -# endif // BOOST_MSVC -#endif - -} // namespace boost::type_traits - -#endif // BOOST_TT_REFERENCE_TRAITS_HPP +#endif // BOOST_TT_REFERENCE_TRAITS_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_bounds.hpp b/include/boost/type_traits/remove_bounds.hpp new file mode 100644 index 0000000..20199d3 --- /dev/null +++ b/include/boost/type_traits/remove_bounds.hpp @@ -0,0 +1,34 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED +#define BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED + +#include "boost/config.hpp" +#include + +// should be the last #include +#include "boost/type_traits/detail/type_trait_def.hpp" + +namespace boost { + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_bounds,T,T) + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +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) +#endif + +} // namespace boost + +#include "boost/type_traits/detail/type_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..5edeffe --- /dev/null +++ b/include/boost/type_traits/remove_const.hpp @@ -0,0 +1,71 @@ + +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard +// Hinnant & John Maddock 2000. Permission to copy, use, modify, +// sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided +// "as is" without express or implied warranty, and with no claim as +// to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_REMOVE_CONST_HPP_INCLUDED +#define BOOST_TT_REMOVE_CONST_HPP_INCLUDED + +#include "boost/type_traits/is_volatile.hpp" +#include "boost/type_traits/broken_compiler_spec.hpp" +#include "boost/type_traits/detail/cv_traits_impl.hpp" +#include "boost/config.hpp" + +#include + +// should be the last #include +#include "boost/type_traits/detail/type_trait_def.hpp" + +namespace boost { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +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; +}; + +} // namespace detail + +// * convert a type T to non-const type - remove_const + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_const,T,typename detail::remove_const_impl::type) +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_const,T&,T&) +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]) + +#else + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_const,T,T) + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include "boost/type_traits/detail/type_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..1b1f60a --- /dev/null +++ b/include/boost/type_traits/remove_cv.hpp @@ -0,0 +1,45 @@ + +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard +// Hinnant & John Maddock 2000. Permission to copy, use, modify, +// sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided +// "as is" without express or implied warranty, and with no claim as +// to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_REMOVE_CV_HPP_INCLUDED +#define BOOST_TT_REMOVE_CV_HPP_INCLUDED + +#include "boost/type_traits/broken_compiler_spec.hpp" +#include "boost/type_traits/detail/cv_traits_impl.hpp" +#include "boost/config.hpp" + +#include + +// should be the last #include +#include "boost/type_traits/detail/type_trait_def.hpp" + +namespace boost { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +// convert a type T to a non-cv-qualified type - remove_cv +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_cv,T,typename detail::cv_traits_imp::unqualified_type) +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_cv,T&,T&) +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]) + +#else + +// doesn't work +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_cv,T,T) + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include "boost/type_traits/detail/type_trait_undef.hpp" + +#endif // BOOST_TT_REMOVE_CV_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_pointer.hpp b/include/boost/type_traits/remove_pointer.hpp new file mode 100644 index 0000000..fc51c4a --- /dev/null +++ b/include/boost/type_traits/remove_pointer.hpp @@ -0,0 +1,34 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_REMOVE_POINTER_HPP_INCLUDED +#define BOOST_TT_REMOVE_POINTER_HPP_INCLUDED + +#include "boost/type_traits/broken_compiler_spec.hpp" +#include "boost/config.hpp" + +// should be the last #include +#include "boost/type_traits/detail/type_trait_def.hpp" + +namespace boost { + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_pointer,T,T) + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +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) +#endif + +} // namespace boost + +#include "boost/type_traits/detail/type_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..45bd305 --- /dev/null +++ b/include/boost/type_traits/remove_reference.hpp @@ -0,0 +1,42 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This software +// is provided "as is" without express or implied warranty, and with no claim +// as to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_REMOVE_REFERENCE_HPP_INCLUDED +#define BOOST_TT_REMOVE_REFERENCE_HPP_INCLUDED + +#include "boost/type_traits/broken_compiler_spec.hpp" +#include "boost/config.hpp" + +// should be the last #include +#include "boost/type_traits/detail/type_trait_def.hpp" + +namespace boost { + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_reference,T,T) + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T&,T) + +#if defined(__BORLANDC__) +// 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) +#endif + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include "boost/type_traits/detail/type_trait_undef.hpp" + +#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 new file mode 100644 index 0000000..83c9f62 --- /dev/null +++ b/include/boost/type_traits/remove_volatile.hpp @@ -0,0 +1,71 @@ + +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard +// Hinnant & John Maddock 2000. Permission to copy, use, modify, +// sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided +// "as is" without express or implied warranty, and with no claim as +// to its suitability for any purpose. +// +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_TT_REMOVE_VOLATILE_HPP_INCLUDED +#define BOOST_TT_REMOVE_VOLATILE_HPP_INCLUDED + +#include "boost/type_traits/is_const.hpp" +#include "boost/type_traits/broken_compiler_spec.hpp" +#include "boost/type_traits/detail/cv_traits_impl.hpp" +#include "boost/config.hpp" + +#include + +// should be the last #include +#include "boost/type_traits/detail/type_trait_def.hpp" + +namespace boost { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +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; +}; + +} // namespace detail + +// * convert a type T to a non-volatile type - remove_volatile + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_volatile,T,typename detail::remove_volatile_impl::type) +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_volatile,T&,T&) +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]) + +#else + +// doesn't work +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_volatile,T,T) + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include "boost/type_traits/detail/type_trait_undef.hpp" + +#endif // BOOST_TT_REMOVE_VOLATILE_HPP_INCLUDED diff --git a/include/boost/type_traits/same_traits.hpp b/include/boost/type_traits/same_traits.hpp index e05579c..c66dddb 100644 --- a/include/boost/type_traits/same_traits.hpp +++ b/include/boost/type_traits/same_traits.hpp @@ -8,101 +8,9 @@ // // defines is_same: -// Revision History -// 19 Feb 2001 Fixed for MSVC (David Abrahams) - -#ifndef BOOST_SAME_TRAITS_HPP -#define BOOST_SAME_TRAITS_HPP - -#ifndef BOOST_ICE_TYPE_TRAITS_HPP -#include -#endif -#ifndef BOOST_FWD_TYPE_TRAITS_HPP -#include -#endif -#if !defined(BOOST_COMPOSITE_TYPE_TRAITS_HPP) && defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC) -#include -#endif - -namespace boost{ - -/********************************************** - * - * is_same - * - **********************************************/ -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - -template -struct is_same -{ BOOST_STATIC_CONSTANT(bool, value = false); }; - -template -struct is_same -{ BOOST_STATIC_CONSTANT(bool, value = true); }; - -#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION -// A definition is required even for integral static constants -template -const bool is_same::value; - -template -const bool is_same::value; -#endif - -#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - -#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 -// -// the following VC6 specific implementation is *NOT* legal -// C++, but has the advantage that it works for incomplete -// types. -// -namespace detail{ - -template -struct is_same_part_1 { - template struct part_2 { enum { value = false }; }; - template<> struct part_2 { enum { value = true }; }; -}; - -} // namespace detail - -template -struct is_same { - enum { value = detail::is_same_part_1::template part_2::value }; -}; - -#else // BOOST_MSVC - -namespace detail{ - template - ::boost::type_traits::yes_type BOOST_TT_DECL is_same_helper(T*, T*); - ::boost::type_traits::no_type BOOST_TT_DECL is_same_helper(...); -} - -template -struct is_same -{ -private: - static T t; - static U u; -public: - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - (sizeof(type_traits::yes_type) == sizeof(detail::is_same_helper(&t,&u))), - (::boost::is_reference::value == ::boost::is_reference::value), - (sizeof(T) == sizeof(U)) - >::value)); -}; - -#endif // BOOST_MSVC - -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - -} // namespace boost - -#endif // BOOST_SAME_TRAITS_HPP - +#ifndef BOOST_TT_SAME_TRAITS_HPP_INCLUDED +#define BOOST_TT_SAME_TRAITS_HPP_INCLUDED +#include "boost/type_traits/is_same.hpp" +#endif // BOOST_TT_SAME_TRAITS_HPP_INCLUDED diff --git a/include/boost/type_traits/transform_traits.hpp b/include/boost/type_traits/transform_traits.hpp index 6cc0536..f11679d 100644 --- a/include/boost/type_traits/transform_traits.hpp +++ b/include/boost/type_traits/transform_traits.hpp @@ -9,191 +9,14 @@ // defines traits classes for transforming one type to another: // remove_reference, add_reference, remove_bounds, remove_pointer. // -// Revision History: -// 21st March 2001 -// Added void specialisations to add_reference. - -#ifndef BOOST_TRANSFORM_TRAITS_HPP -#define BOOST_TRANSFORM_TRAITS_HPP - -#ifndef BOOST_ICE_TYPE_TRAITS_HPP -#include -#endif -#ifndef BOOST_FWD_TYPE_TRAITS_HPP -#include -#endif -#if !defined(BOOST_COMPOSITE_TYPE_TRAITS_HPP) && defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) -#include -#endif - -namespace boost{ - -/********************************************** - * - * remove_reference - * - **********************************************/ -template -struct remove_reference -{ typedef T type; }; -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -template -struct remove_reference -{ typedef T type; }; -#endif -#if defined(__BORLANDC__) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) -// 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... -template -struct remove_reference -{ typedef T type; }; -template -struct remove_reference -{ typedef T type; }; -template -struct remove_reference -{ typedef T type; }; -#endif - -/********************************************** - * - * add_reference - * - **********************************************/ -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -template -struct add_reference -{ typedef T& type; }; -template -struct add_reference -{ typedef T& type; }; -#elif defined(BOOST_MSVC6_MEMBER_TEMPLATES) -namespace detail{ - -template -struct reference_adder -{ - template - struct rebind - { - typedef T& type; - }; -}; - -template <> -struct reference_adder -{ - template - struct rebind - { - typedef T type; - }; -}; - -} // namespace detail - -template -struct add_reference -{ -private: - typedef typename detail::reference_adder< ::boost::is_reference::value>::template rebind binder; -public: - typedef typename binder::type type; -}; - -#else -template -struct add_reference -{ typedef T& type; }; -#endif - -// -// these full specialisations are always required: -template <> struct add_reference{ typedef void type; }; -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -template <> struct add_reference{ typedef const volatile void type; }; -template <> struct add_reference{ typedef const void type; }; -template <> struct add_reference{ typedef volatile void type; }; -#endif - - -/********************************************** - * - * remove_bounds - * - **********************************************/ -template -struct remove_bounds -{ typedef T type; }; -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -template -struct remove_bounds -{ typedef T type; }; -template -struct remove_bounds -{ typedef const T type; }; -template -struct remove_bounds -{ typedef volatile T type; }; -template -struct remove_bounds -{ typedef const volatile T type; }; -#endif - -/********************************************** - * - * remove_pointer - * - **********************************************/ -template -struct remove_pointer -{ typedef T type; }; -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -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 - -/********************************************** - * - * add_pointer - * - **********************************************/ -template -struct add_pointer -{ -private: - typedef typename remove_reference::type no_ref_type; -public: - typedef no_ref_type* type; -}; - -} // namespace boost - -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -// -// if there is no partial specialisation support -// include a bunch of full specialisations as a workaround: -// -#include -#else -#define BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(x) -#endif - -#endif // BOOST_TRANSFORM_TRAITS_HPP - - +#ifndef BOOST_TT_TRANSFORM_TRAITS_HPP_INCLUDED +#define BOOST_TT_TRANSFORM_TRAITS_HPP_INCLUDED +#include "boost/type_traits/add_pointer.hpp" +#include "boost/type_traits/add_reference.hpp" +#include "boost/type_traits/remove_bounds.hpp" +#include "boost/type_traits/remove_pointer.hpp" +#include "boost/type_traits/remove_reference.hpp" +#endif // BOOST_TT_TRANSFORM_TRAITS_HPP_INCLUDED diff --git a/include/boost/type_traits/transform_traits_spec.hpp b/include/boost/type_traits/transform_traits_spec.hpp index e9fd0cb..b3855d6 100644 --- a/include/boost/type_traits/transform_traits_spec.hpp +++ b/include/boost/type_traits/transform_traits_spec.hpp @@ -5,74 +5,9 @@ // This software is provided "as is" without express or implied warranty, // and with no claim as to its suitability for any purpose. -#ifndef BOOST_TT_TRANSFORM_TRAITS_SPEC_HPP -#define BOOST_TT_TRANSFORM_TRAITS_SPEC_HPP +#ifndef BOOST_TT_TRANSFORM_TRAITS_SPEC_HPP_INCLUDED +#define BOOST_TT_TRANSFORM_TRAITS_SPEC_HPP_INCLUDED -#ifndef TRANSFORM_TRAITS_HPP -#include -#endif - -#define BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_CONST_VOLATILE_RANK1(T) \ -template<> struct remove_const { typedef T type; }; \ -template<> struct remove_const { typedef T volatile type; }; \ -template<> struct remove_volatile { typedef T type; }; \ -template<> struct remove_volatile { typedef T const type; }; \ -template<> struct remove_cv { typedef T type; }; \ -template<> struct remove_cv { typedef T type; }; \ -template<> struct remove_cv { typedef T type; }; \ -/**/ - -#define BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_PTR_REF_RANK_1(T) \ -template<> struct remove_pointer { typedef T type; }; \ -template<> struct remove_reference { typedef T type; }; \ -/**/ - -#define BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_PTR_REF_RANK_2(T) \ -BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_PTR_REF_RANK_1(T) \ -BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_PTR_REF_RANK_1(T const) \ -BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_PTR_REF_RANK_1(T volatile) \ -BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_PTR_REF_RANK_1(T const volatile) \ -/**/ - -#define BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_1(T) \ -BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_PTR_REF_RANK_2(T) \ -BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_CONST_VOLATILE_RANK1(T) \ -/**/ - -#define BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_2(T) \ -BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_1(T*) \ -BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_1(T const*) \ -BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_1(T volatile*) \ -BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_1(T const volatile*) \ -/**/ - -#define BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(T) \ -namespace boost { \ -BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_1(T) \ -BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_2(T) \ -BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_2(T*) \ -BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_2(T const*) \ -BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_2(T volatile*) \ -BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_2(T const volatile*) \ -} \ -/**/ - -BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(bool) -BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(char) -#ifndef BOOST_NO_INTRINSIC_WCHAR_T -BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(wchar_t) -#endif -BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(signed char) -BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(unsigned char) -BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(signed short) -BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(unsigned short) -BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(signed int) -BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(unsigned int) -BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(signed long) -BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(unsigned long) -BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(float) -BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(double) -BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(long double) - -#endif // BOOST_TT_TRANSFORM_TRAITS_SPEC_HPP +#include "boost/type_traits/broken_compiler_spec.hpp" +#endif // BOOST_TT_TRANSFORM_TRAITS_SPEC_HPP_INCLUDED diff --git a/include/boost/type_traits/type_traits_test.hpp b/include/boost/type_traits/type_traits_test.hpp index b87d278..030ecd9 100644 --- a/include/boost/type_traits/type_traits_test.hpp +++ b/include/boost/type_traits/type_traits_test.hpp @@ -9,11 +9,16 @@ #ifndef BOOST_TYPE_TRAITS_TEST_HPP #define BOOST_TYPE_TRAITS_TEST_HPP + +#include "boost/config.hpp" +#include "boost/utility.hpp" +#include "boost/type_traits/alignment_of.hpp" +#include "boost/type_traits/type_with_alignment.hpp" +#include "boost/type_traits/ice.hpp" + #include #include -#include -#include -#include + // // define tests here unsigned failures = 0; @@ -156,6 +161,7 @@ struct test_align char c; T t; }; + static void do_it() { padded p; @@ -169,9 +175,12 @@ struct test_align std::cout << "\tfound: " << boost::alignment_of::value << " expected " << a << std::endl; } // suppress warnings about unused variables: - (void)p; - (void)a; + not_unused(p); + not_unused(a); } + + template + static void not_unused(U const&) {} }; #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template @@ -422,13 +431,3 @@ struct incomplete_type; #endif // BOOST_TYPE_TRAITS_TEST_HPP - - - - - - - - - - diff --git a/include/boost/type_traits/type_with_alignment.hpp b/include/boost/type_traits/type_with_alignment.hpp new file mode 100644 index 0000000..03b6b1b --- /dev/null +++ b/include/boost/type_traits/type_with_alignment.hpp @@ -0,0 +1,106 @@ + +// (C) Copyright John Maddock 2000. +// Permission to copy, use, modify, sell and distribute this software is +// granted provided this copyright notice appears in all copies. This +// software is provided "as is" without express or implied warranty, +// and with no claim as to its suitability for any purpose. + +#ifndef BOOST_TT_TYPE_WITH_ALIGNMENT_INCLUDED +#define BOOST_TT_TYPE_WITH_ALIGNMENT_INCLUDED + +#include "boost/mpl/if.hpp" +#include "boost/preprocessor/list/for_each_i.hpp" +#include "boost/preprocessor/tuple/to_list.hpp" +#include "boost/preprocessor/cat.hpp" +#include "boost/type_traits/alignment_of.hpp" +#include "boost/static_assert.hpp" +#include "boost/config.hpp" + +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4121) // alignment is sensitive to packing +#endif + +namespace boost { + +namespace detail { + +class alignment_dummy; +typedef void (*function_ptr)(); +typedef int (alignment_dummy::*member_ptr); +typedef int (alignment_dummy::*member_function_ptr)(); + +#define BOOST_TT_ALIGNMENT_TYPES BOOST_PP_TUPLE_TO_LIST( \ + 11, ( \ + char, short, int, long, float, double, long double \ + , void*, function_ptr, member_ptr, member_function_ptr)) + +#define BOOST_TT_CHOOSE_MIN_ALIGNMENT(R,P,I,T) \ + typename mpl::if_c< \ + alignment_of::value <= target, T, char>::type BOOST_PP_CAT(t,I); + +#define BOOST_TT_CHOOSE_T(R,P,I,T) T BOOST_PP_CAT(t,I); + +template +union lower_alignment +{ + 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_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 + +// This alignment method originally due to Brian Parker, implemented by David +// Abrahams, and then ported here by Doug Gregor. +template +class type_with_alignment +{ + typedef detail::lower_alignment t1; + typedef typename mpl::if_c< + ::boost::detail::is_aligned< ::boost::alignment_of::value,Align >::value + , t1 + , 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; +}; + +} // namespace boost + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +#endif // BOOST_TT_TYPE_WITH_ALIGNMENT_INCLUDED diff --git a/include/boost/type_traits/utility.hpp b/include/boost/type_traits/utility.hpp deleted file mode 100644 index a51c2d9..0000000 --- a/include/boost/type_traits/utility.hpp +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright David Abrahams 2002. Permission to copy, use, -// modify, sell and distribute this software is granted provided this -// copyright notice appears in all copies. This software is provided -// "as is" without express or implied warranty, and with no claim as -// to its suitability for any purpose. -#ifndef BOOST_TT_UTILITY_HPP -# define BOOST_TT_UTILITY_HPP - -namespace boost { namespace type_traits -{ - // Utility metafunction class which always returns false - struct false_unary_metafunction - { - template - struct apply - { - BOOST_STATIC_CONSTANT(bool, value = false); - }; - }; - - template struct wrap {}; -}} // namespace boost::type_traits - -#endif // BOOST_TT_UTILITY_HPP