forked from boostorg/type_traits
Remove BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
Process #elif...#else...#endif blocks. [SVN r86247]
This commit is contained in:
@ -26,7 +26,7 @@ namespace boost {
|
||||
|
||||
#if defined( __CODEGEARC__ )
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_array,T,__is_array(T))
|
||||
#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
#else
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_array,T,false)
|
||||
#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T[N],true)
|
||||
@ -41,45 +41,8 @@ BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T const volatile[],t
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#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<T>) )(wrap<T>);
|
||||
char BOOST_TT_DECL is_array_tester1(...);
|
||||
|
||||
template< typename T> no_type is_array_tester2(T(*)(wrap<T>));
|
||||
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<T>()
|
||||
)
|
||||
)) == 1
|
||||
);
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_array,void,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_array,void const,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_array,void volatile,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_array,void const volatile,false)
|
||||
#endif
|
||||
|
||||
} // namespace detail
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_array,T,::boost::detail::is_array_impl<T>::value)
|
||||
|
||||
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/type_traits/detail/bool_trait_undef.hpp>
|
||||
|
@ -41,7 +41,7 @@ namespace boost {
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_const,T,__is_const(T))
|
||||
|
||||
#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
#else
|
||||
|
||||
namespace detail{
|
||||
//
|
||||
@ -80,69 +80,8 @@ 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 <bool is_ref, bool array>
|
||||
struct is_const_helper
|
||||
: public ::boost::type_traits::false_result
|
||||
{
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_const_helper<false,false>
|
||||
{
|
||||
template <typename T> struct result_
|
||||
{
|
||||
static T* t;
|
||||
BOOST_STATIC_CONSTANT(bool, value = (
|
||||
sizeof(boost::detail::yes_type) == sizeof(boost::detail::is_const_tester(t))
|
||||
));
|
||||
};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_const_helper<false,true>
|
||||
{
|
||||
template <typename T> struct result_
|
||||
{
|
||||
static T t;
|
||||
BOOST_STATIC_CONSTANT(bool, value = (
|
||||
sizeof(boost::detail::yes_type) == sizeof(boost::detail::is_const_tester(&t))
|
||||
));
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct is_const_impl
|
||||
: public is_const_helper<
|
||||
is_reference<T>::value
|
||||
, is_array<T>::value
|
||||
>::template result_<T>
|
||||
{
|
||||
};
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_const,void,false)
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_const,void const,true)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_const,void volatile,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_const,void const volatile,true)
|
||||
#endif
|
||||
|
||||
} // namespace detail
|
||||
|
||||
//* is a type T declared const - is_const<T>
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_const,T,::boost::detail::is_const_impl<T>::value)
|
||||
|
||||
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/type_traits/detail/bool_trait_undef.hpp>
|
||||
|
@ -31,7 +31,7 @@ namespace boost {
|
||||
|
||||
#if defined( __CODEGEARC__ )
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_lvalue_reference,T,__is_reference(T))
|
||||
#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
#else
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_lvalue_reference,T,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T&,true)
|
||||
@ -46,52 +46,8 @@ BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T& volati
|
||||
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T& const volatile,true)
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4181 4097)
|
||||
#endif
|
||||
|
||||
namespace detail {
|
||||
|
||||
using ::boost::type_traits::yes_type;
|
||||
using ::boost::type_traits::no_type;
|
||||
using ::boost::type_traits::wrap;
|
||||
|
||||
template <class T> T&(* is_lvalue_reference_helper1(wrap<T>) )(wrap<T>);
|
||||
char is_lvalue_reference_helper1(...);
|
||||
|
||||
template <class T> no_type is_lvalue_reference_helper2(T&(*)(wrap<T>));
|
||||
yes_type is_lvalue_reference_helper2(...);
|
||||
|
||||
template <typename T>
|
||||
struct is_lvalue_reference_impl
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value = sizeof(
|
||||
::boost::detail::is_lvalue_reference_helper2(
|
||||
::boost::detail::is_lvalue_reference_helper1(::boost::type_traits::wrap<T>()))) == 1
|
||||
);
|
||||
};
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_lvalue_reference,void,false)
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_lvalue_reference,void const,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_lvalue_reference,void volatile,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_lvalue_reference,void const volatile,false)
|
||||
#endif
|
||||
|
||||
} // namespace detail
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_lvalue_reference,T,::boost::detail::is_lvalue_reference_impl<T>::value)
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/type_traits/detail/bool_trait_undef.hpp>
|
||||
|
@ -46,7 +46,7 @@ BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,__is_member_pointer(T))
|
||||
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)
|
||||
#else
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,::boost::is_member_function_pointer<T>::value)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*,true)
|
||||
|
||||
@ -56,59 +56,8 @@ BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,
|
||||
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*const volatile,true)
|
||||
#endif
|
||||
|
||||
#else // no partial template specialization
|
||||
|
||||
namespace detail {
|
||||
|
||||
template <typename R, typename T>
|
||||
::boost::type_traits::yes_type BOOST_TT_DECL is_member_pointer_tester(R T::*const volatile*);
|
||||
::boost::type_traits::no_type BOOST_TT_DECL is_member_pointer_tester(...);
|
||||
|
||||
template <bool>
|
||||
struct is_member_pointer_select
|
||||
: public ::boost::type_traits::false_result
|
||||
{
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_member_pointer_select<false>
|
||||
{
|
||||
template <typename T> 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 <typename T>
|
||||
struct is_member_pointer_impl
|
||||
: public is_member_pointer_select<
|
||||
::boost::type_traits::ice_or<
|
||||
::boost::is_reference<T>::value
|
||||
, ::boost::is_array<T>::value
|
||||
>::value
|
||||
>::template result_<T>
|
||||
{
|
||||
};
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_pointer,void,false)
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_pointer,void const,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_pointer,void volatile,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_pointer,void const volatile,false)
|
||||
#endif
|
||||
|
||||
} // namespace detail
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,::boost::detail::is_member_pointer_impl<T>::value)
|
||||
|
||||
#endif // __BORLANDC__
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/type_traits/detail/bool_trait_undef.hpp>
|
||||
|
@ -35,7 +35,7 @@ namespace boost {
|
||||
|
||||
#if defined( __CODEGEARC__ )
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pointer,T,__is_pointer(T))
|
||||
#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
#else
|
||||
|
||||
namespace detail {
|
||||
|
||||
@ -79,62 +79,8 @@ BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T& volatile,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T& const volatile,false)
|
||||
#endif
|
||||
|
||||
#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 <bool>
|
||||
struct is_pointer_select
|
||||
: public ::boost::type_traits::false_result
|
||||
{
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_pointer_select<false>
|
||||
{
|
||||
template <typename T> 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 <typename T>
|
||||
struct is_pointer_impl
|
||||
: public is_pointer_select<
|
||||
::boost::type_traits::ice_or<
|
||||
::boost::is_reference<T>::value
|
||||
, ::boost::is_array<T>::value
|
||||
>::value
|
||||
>::template result_<T>
|
||||
{
|
||||
};
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pointer,void,false)
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pointer,void const,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pointer,void volatile,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pointer,void const volatile,false)
|
||||
#endif
|
||||
|
||||
} // namespace detail
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pointer,T,::boost::detail::is_pointer_impl<T>::value)
|
||||
|
||||
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/type_traits/detail/bool_trait_undef.hpp>
|
||||
|
@ -59,7 +59,7 @@ struct is_volatile_rval_filter<T&&>
|
||||
|
||||
#if defined( __CODEGEARC__ )
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,__is_volatile(T))
|
||||
#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
#else
|
||||
|
||||
//* is a type T declared volatile - is_volatile<T>
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,::boost::detail::is_volatile_rval_filter<T>::value)
|
||||
@ -75,69 +75,8 @@ 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 <bool is_ref, bool array>
|
||||
struct is_volatile_helper
|
||||
: public ::boost::type_traits::false_result
|
||||
{
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_volatile_helper<false,false>
|
||||
{
|
||||
template <typename T> struct result_
|
||||
{
|
||||
static T* t;
|
||||
BOOST_STATIC_CONSTANT(bool, value = (
|
||||
sizeof(boost::detail::yes_type) == sizeof(boost::detail::is_volatile_tester(t))
|
||||
));
|
||||
};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_volatile_helper<false,true>
|
||||
{
|
||||
template <typename T> struct result_
|
||||
{
|
||||
static T t;
|
||||
BOOST_STATIC_CONSTANT(bool, value = (
|
||||
sizeof(boost::detail::yes_type) == sizeof(boost::detail::is_volatile_tester(&t))
|
||||
));
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct is_volatile_impl
|
||||
: public is_volatile_helper<
|
||||
is_reference<T>::value
|
||||
, is_array<T>::value
|
||||
>::template result_<T>
|
||||
{
|
||||
};
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_volatile,void,false)
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_volatile,void const,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_volatile,void volatile,true)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_volatile,void const volatile,true)
|
||||
#endif
|
||||
|
||||
} // namespace detail
|
||||
|
||||
//* is a type T declared volatile - is_volatile<T>
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,::boost::detail::is_volatile_impl<T>::value)
|
||||
|
||||
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/type_traits/detail/bool_trait_undef.hpp>
|
||||
|
@ -66,7 +66,7 @@ namespace detail{
|
||||
|
||||
BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_pointer,T,typename boost::detail::remove_pointer_imp2<T>::type)
|
||||
|
||||
#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
#else
|
||||
|
||||
BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_pointer,T,T)
|
||||
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_pointer,T*,T)
|
||||
@ -74,10 +74,6 @@ BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_pointer,T* const,T)
|
||||
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_pointer,T* volatile,T)
|
||||
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_pointer,T* const volatile,T)
|
||||
|
||||
#else
|
||||
|
||||
BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_pointer,T,typename boost::detail::remove_pointer_impl<T>::type)
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
Reference in New Issue
Block a user