forked from boostorg/type_traits
more type traits updates:
Header includes get BOOST_ prefix, BOOST_DECL_MC dropped in favour of new BOOST_STATIC_CONSTANT (from config.hpp), operator ! dropped in favour of boost::type_traits::ice_not template. [SVN r9270]
This commit is contained in:
@ -32,7 +32,7 @@ struct alignment_of_hack
|
||||
template <unsigned A, unsigned S>
|
||||
struct alignment_logic
|
||||
{
|
||||
BOOST_DECL_MC(std::size_t, value, A < S ? A : S);
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = A < S ? A : S);
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
@ -40,7 +40,7 @@ struct alignment_logic
|
||||
template <class T>
|
||||
struct alignment_of
|
||||
{
|
||||
BOOST_DECL_MC(std::size_t, value,
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value =
|
||||
(::boost::detail::alignment_logic<
|
||||
sizeof(detail::alignment_of_hack<T>) - sizeof(T),
|
||||
sizeof(T)
|
||||
@ -55,24 +55,24 @@ template <class T>
|
||||
struct alignment_of<T&>
|
||||
{
|
||||
public:
|
||||
BOOST_DECL_MC(std::size_t, value, alignment_of<T*>::value);
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = alignment_of<T*>::value);
|
||||
};
|
||||
#endif
|
||||
//
|
||||
// void has to be treated specially:
|
||||
template <>
|
||||
struct alignment_of<void>
|
||||
{ BOOST_DECL_MC(std::size_t, value, 0); };
|
||||
{ BOOST_STATIC_CONSTANT(std::size_t, value = 0); };
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
template <>
|
||||
struct alignment_of<const void>
|
||||
{ BOOST_DECL_MC(std::size_t, value, 0); };
|
||||
{ BOOST_STATIC_CONSTANT(std::size_t, value = 0); };
|
||||
template <>
|
||||
struct alignment_of<volatile void>
|
||||
{ BOOST_DECL_MC(std::size_t, value, 0); };
|
||||
{ BOOST_STATIC_CONSTANT(std::size_t, value = 0); };
|
||||
template <>
|
||||
struct alignment_of<const volatile void>
|
||||
{ BOOST_DECL_MC(std::size_t, value, 0); };
|
||||
{ BOOST_STATIC_CONSTANT(std::size_t, value = 0); };
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
@ -11,8 +11,8 @@
|
||||
//
|
||||
|
||||
|
||||
#ifndef ARITHMETIC_TYPE_TRAITS_HPP
|
||||
#define ARITHMETIC_TYPE_TRAITS_HPP
|
||||
#ifndef BOOST_ARITHMETIC_TYPE_TRAITS_HPP
|
||||
#define BOOST_ARITHMETIC_TYPE_TRAITS_HPP
|
||||
|
||||
#ifndef BOOST_ICE_TYPE_TRAITS_HPP
|
||||
#include <boost/type_traits/ice.hpp>
|
||||
@ -24,209 +24,209 @@
|
||||
namespace boost{
|
||||
|
||||
//* is a type T void - is_void<T>
|
||||
template <typename T> struct is_void{ BOOST_DECL_MC(bool, value, false); };
|
||||
template <> struct is_void<void>{ BOOST_DECL_MC(bool, value, true); };
|
||||
template <typename T> struct is_void{ BOOST_STATIC_CONSTANT(bool, value = false); };
|
||||
template <> struct is_void<void>{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
|
||||
//* is a type T an integral type described in the standard (3.9.1p3)
|
||||
template <typename T> struct is_integral
|
||||
{ BOOST_DECL_MC(bool, value, false); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = false); };
|
||||
template <> struct is_integral<unsigned char>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<unsigned short>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<unsigned int>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<unsigned long>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<signed char>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<signed short>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<signed int>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<signed long>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<char>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
#ifndef BOOST_MSVC
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template <> struct is_integral<wchar_t>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#endif
|
||||
template <> struct is_integral<bool>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
|
||||
#if defined(ULLONG_MAX) || defined(ULONG_LONG_MAX)
|
||||
# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX))
|
||||
template <> struct is_integral<unsigned long long>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<long long>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#endif
|
||||
#if defined(__BORLANDC__) || defined(_MSC_VER) && !defined(__MWERKS__)
|
||||
template <> struct is_integral<unsigned __int64>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<__int64>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#endif
|
||||
|
||||
//* is a type T a floating-point type described in the standard (3.9.1p8)
|
||||
template <typename T> struct is_float
|
||||
{ BOOST_DECL_MC(bool, value, false); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = false); };
|
||||
template <> struct is_float<float>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_float<double>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_float<long double>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ 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<const void>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_void<volatile void>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_void<const volatile void>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#endif
|
||||
#ifndef BOOST_NO_CV_SPECIALIZATIONS
|
||||
// const-variations:
|
||||
template <> struct is_integral<const unsigned char>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<const unsigned short>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<const unsigned int>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<const unsigned long>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<const signed char>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<const signed short>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<const signed int>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<const signed long>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<const char>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
#ifndef BOOST_MSVC
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template <> struct is_integral<const wchar_t>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#endif
|
||||
template <> struct is_integral<const bool>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
|
||||
#if defined(ULLONG_MAX) || defined(ULONG_LONG_MAX)
|
||||
# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX))
|
||||
template <> struct is_integral<const unsigned long long>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<const long long>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#endif // ULLONG_MAX
|
||||
#if defined(__BORLANDC__) || defined(_MSC_VER) && !defined(__MWERKS__)
|
||||
template <> struct is_integral<const unsigned __int64>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<const __int64>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#endif //__int64
|
||||
|
||||
template <> struct is_float<const float>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_float<const double>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_float<const long double>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
|
||||
// volatile-variations:
|
||||
template <> struct is_integral<volatile unsigned char>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<volatile unsigned short>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<volatile unsigned int>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<volatile unsigned long>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<volatile signed char>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<volatile signed short>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<volatile signed int>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<volatile signed long>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<volatile char>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
#ifndef BOOST_MSVC
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template <> struct is_integral<volatile wchar_t>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#endif
|
||||
template <> struct is_integral<volatile bool>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
|
||||
#ifdef ULLONG_MAX
|
||||
# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX))
|
||||
template <> struct is_integral<volatile unsigned long long>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<volatile long long>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#endif // ULLONG_MAX
|
||||
#if defined(__BORLANDC__) || defined(_MSC_VER) && !defined(__MWERKS__)
|
||||
template <> struct is_integral<volatile unsigned __int64>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<volatile __int64>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#endif //__int64
|
||||
|
||||
template <> struct is_float<volatile float>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_float<volatile double>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_float<volatile long double>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
|
||||
// const-volatile-variations:
|
||||
template <> struct is_integral<const volatile unsigned char>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<const volatile unsigned short>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<const volatile unsigned int>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<const volatile unsigned long>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<const volatile signed char>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<const volatile signed short>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<const volatile signed int>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<const volatile signed long>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<const volatile char>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
#ifndef BOOST_MSVC
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template <> struct is_integral<const volatile wchar_t>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#endif
|
||||
template <> struct is_integral<const volatile bool>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
|
||||
#ifdef ULLONG_MAX
|
||||
# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX))
|
||||
template <> struct is_integral<const volatile unsigned long long>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<const volatile long long>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#endif // ULLONG_MAX
|
||||
#if defined(__BORLANDC__) || defined(_MSC_VER) && !defined(__MWERKS__)
|
||||
template <> struct is_integral<const volatile unsigned __int64>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_integral<const volatile __int64>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#endif //__int64
|
||||
|
||||
template <> struct is_float<const volatile float>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_float<const volatile double>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <> struct is_float<const volatile long double>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
|
||||
#endif // BOOST_NO_CV_SPECIALIZATIONS
|
||||
|
||||
@ -234,9 +234,9 @@ template <> struct is_float<const volatile long double>
|
||||
template <typename T>
|
||||
struct is_arithmetic
|
||||
{
|
||||
BOOST_DECL_MC(bool, value,
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_or<
|
||||
::boost::is_integral<T>::value,
|
||||
::boost::is_integral<T>::value,
|
||||
::boost::is_float<T>::value
|
||||
>::value));
|
||||
};
|
||||
@ -245,7 +245,7 @@ struct is_arithmetic
|
||||
template <typename T>
|
||||
struct is_fundamental
|
||||
{
|
||||
BOOST_DECL_MC(bool, value,
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_or<
|
||||
::boost::is_arithmetic<T>::value,
|
||||
::boost::is_void<T>::value
|
||||
|
@ -17,8 +17,8 @@
|
||||
// All rights reserved.).
|
||||
// Fixes for is_array are based on a newgroup posting by Jonathan Lundquist.
|
||||
|
||||
#ifndef COMPOSITE_TYPE_TRAITS_HPP
|
||||
#define COMPOSITE_TYPE_TRAITS_HPP
|
||||
#ifndef BOOST_COMPOSITE_TYPE_TRAITS_HPP
|
||||
#define BOOST_COMPOSITE_TYPE_TRAITS_HPP
|
||||
|
||||
#ifndef BOOST_ICE_TYPE_TRAITS_HPP
|
||||
#include <boost/type_traits/ice.hpp>
|
||||
@ -29,10 +29,10 @@
|
||||
#ifndef BOOST_CONVERSION_TYPE_TRAITS_HPP
|
||||
#include <boost/type_traits/conversion_traits.hpp>
|
||||
#endif
|
||||
#ifndef CV_TYPE_TRAITS_HPP
|
||||
#ifndef BOOST_CV_TYPE_TRAITS_HPP
|
||||
#include <boost/type_traits/cv_traits.hpp>
|
||||
#endif
|
||||
#ifndef ARITHMETIC_TYPE_TRAITS_HPP
|
||||
#ifndef BOOST_ARITHMETIC_TYPE_TRAITS_HPP
|
||||
#include <boost/type_traits/arithmetic_traits.hpp>
|
||||
#endif
|
||||
|
||||
@ -45,15 +45,15 @@ namespace boost{
|
||||
**********************************************/
|
||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
template <typename T> struct is_array
|
||||
{ BOOST_DECL_MC(bool, value, false); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = false); };
|
||||
template <typename T, std::size_t N> struct is_array<T[N]>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <typename T, std::size_t N> struct is_array<const T[N]>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <typename T, std::size_t N> struct is_array<volatile T[N]>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <typename T, std::size_t N> struct is_array<const volatile T[N]>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
namespace detail{
|
||||
struct pointer_helper
|
||||
@ -83,30 +83,35 @@ struct is_array
|
||||
private:
|
||||
static T t;
|
||||
public:
|
||||
BOOST_DECL_MC(bool, value, (1 == sizeof(detail::is_array_helper(&t, t)))
|
||||
& !is_reference<T>::value
|
||||
& !(1 == sizeof(detail::is_pointer_helper3(t))) );
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_and<
|
||||
(1 == sizeof(detail::is_array_helper(&t, t))),
|
||||
::boost::type_traits::ice_not<
|
||||
::boost::is_reference<T>::value>::value,
|
||||
::boost::type_traits::ice_not<
|
||||
(1 == sizeof(detail::is_pointer_helper3(t)))>::value
|
||||
>::value));
|
||||
};
|
||||
template <>
|
||||
struct is_array<void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
template <>
|
||||
struct is_array<const void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
template <>
|
||||
struct is_array<volatile void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
template <>
|
||||
struct is_array<const volatile void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
#endif
|
||||
|
||||
@ -120,18 +125,18 @@ struct is_array<const volatile void>
|
||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
namespace detail{
|
||||
template <typename T> struct is_pointer_helper
|
||||
{ BOOST_DECL_MC(bool, value, false); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = false); };
|
||||
template <typename T> struct is_pointer_helper<T*>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <typename T> struct is_pointer_helper<T*const>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <typename T> struct is_pointer_helper<T*volatile>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <typename T> struct is_pointer_helper<T*const volatile>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
} // namespace detail
|
||||
template <typename T> struct is_pointer
|
||||
{ BOOST_DECL_MC(bool, value, (::boost::type_traits::ice_and< ::boost::detail::is_pointer_helper<T>::value, ::boost::type_traits::ice_not< ::boost::is_member_pointer<T>::value >::value >::value)); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = (::boost::type_traits::ice_and< ::boost::detail::is_pointer_helper<T>::value, ::boost::type_traits::ice_not< ::boost::is_member_pointer<T>::value >::value >::value)); };
|
||||
#else
|
||||
template <typename T>
|
||||
struct is_pointer
|
||||
@ -139,36 +144,40 @@ struct is_pointer
|
||||
private:
|
||||
static T t;
|
||||
public:
|
||||
BOOST_DECL_MC(bool, value,
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_and<
|
||||
!::boost::is_reference<T>::value,
|
||||
!::boost::is_array<T>::value,
|
||||
(::boost::type_traits::ice_or<
|
||||
::boost::type_traits::ice_not<
|
||||
::boost::is_reference<T>::value
|
||||
>::value,
|
||||
::boost::type_traits::ice_not<
|
||||
::boost::is_array<T>::value
|
||||
>::value,
|
||||
(::boost::type_traits::ice_or<
|
||||
(1 == sizeof(detail::is_pointer_helper(t))),
|
||||
(1 == sizeof(detail::is_pointer_helper3(t)))
|
||||
>::value)
|
||||
>::value)
|
||||
>::value ) );
|
||||
};
|
||||
template <>
|
||||
struct is_pointer <void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
template <>
|
||||
struct is_pointer <const void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
template <>
|
||||
struct is_pointer <volatile void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
template <>
|
||||
struct is_pointer <const volatile void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
@ -180,20 +189,20 @@ struct is_pointer <const volatile void>
|
||||
**********************************************/
|
||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
template <typename T> struct is_reference
|
||||
{ BOOST_DECL_MC(bool, value, false); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = false); };
|
||||
template <typename T> struct is_reference<T&>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ 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 <typename T> struct is_reference<T&const>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <typename T> struct is_reference<T&volatile>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <typename T> struct is_reference<T&const volatile>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#endif
|
||||
#else
|
||||
# ifdef BOOST_MSVC
|
||||
@ -205,19 +214,26 @@ template <typename T> struct is_reference
|
||||
private:
|
||||
typedef T const volatile cv_t;
|
||||
public:
|
||||
BOOST_DECL_MC(bool, value, (::boost::type_traits::ice_or<!::boost::is_const<cv_t>::value, !::boost::is_volatile<cv_t>::value>::value));
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_or<
|
||||
::boost::type_traits::ice_not<
|
||||
::boost::is_const<cv_t>::value
|
||||
>::value,
|
||||
::boost::type_traits::ice_not<
|
||||
::boost::is_volatile<cv_t>::value>::value
|
||||
>::value));
|
||||
};
|
||||
template <> struct is_reference<void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
template <> struct is_reference<const void>
|
||||
{ BOOST_DECL_MC(bool, value, false); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = false); };
|
||||
template <> struct is_reference<volatile void>
|
||||
{ BOOST_DECL_MC(bool, value, false); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = false); };
|
||||
template <> struct is_reference<const volatile void>
|
||||
{ BOOST_DECL_MC(bool, value, false); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = false); };
|
||||
#endif
|
||||
|
||||
# ifdef BOOST_MSVC
|
||||
@ -235,7 +251,7 @@ template <typename T> struct is_union
|
||||
private:
|
||||
typedef typename remove_cv<T>::type cvt;
|
||||
public:
|
||||
BOOST_DECL_MC(bool, value, BOOST_IS_UNION(cvt));
|
||||
BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(cvt));
|
||||
};
|
||||
|
||||
/**********************************************
|
||||
@ -252,7 +268,7 @@ struct int_convertible
|
||||
#ifndef __BORLANDC__
|
||||
template <typename T> struct is_enum
|
||||
{
|
||||
BOOST_DECL_MC(bool, value,
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_and<
|
||||
::boost::type_traits::ice_not< ::boost::is_arithmetic<T>::value>::value,
|
||||
::boost::type_traits::ice_not< ::boost::is_reference<T>::value>::value,
|
||||
@ -266,7 +282,7 @@ template <typename T> struct is_enum
|
||||
template <typename T> struct is_enum
|
||||
{
|
||||
public:
|
||||
BOOST_DECL_MC(bool, value, BOOST_IS_ENUM(T));
|
||||
BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_ENUM(T));
|
||||
};
|
||||
#endif
|
||||
|
||||
@ -277,23 +293,23 @@ public:
|
||||
**********************************************/
|
||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
template <typename T> struct is_member_pointer
|
||||
{ BOOST_DECL_MC(bool, value, false); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = false); };
|
||||
template <typename T, typename U> struct is_member_pointer<U T::*>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#ifdef __GNUC__
|
||||
// gcc workaround (JM 02 Oct 2000)
|
||||
template <typename T, typename U> struct is_member_pointer<U (T::*)(void)>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <typename T, typename U, typename A1> struct is_member_pointer<U (T::*)(A1)>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <typename T, typename U, typename A1, typename A2> struct is_member_pointer<U (T::*)(A1, A2)>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <typename T, typename U, typename A1, typename A2, typename A3> struct is_member_pointer<U (T::*)(A1, A2, A3)>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <typename T, typename U, typename A1, typename A2, typename A3, typename A4> struct is_member_pointer<U (T::*)(A1, A2, A3, A4)>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <typename T, typename U, typename A1, typename A2, typename A3, typename A4, typename A5> struct is_member_pointer<U (T::*)(A1, A2, A3, A4, A5)>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
#endif
|
||||
#else
|
||||
namespace detail{
|
||||
@ -319,28 +335,28 @@ struct is_member_pointer
|
||||
private:
|
||||
static T t;
|
||||
public:
|
||||
BOOST_DECL_MC(bool, value, (1 == sizeof(detail::is_member_pointer_helper(t))) );
|
||||
BOOST_STATIC_CONSTANT(bool, value = (1 == sizeof(detail::is_member_pointer_helper(t))) );
|
||||
};
|
||||
template <>
|
||||
struct is_member_pointer<void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
template <>
|
||||
struct is_member_pointer<const void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
template <>
|
||||
struct is_member_pointer<volatile void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
template <>
|
||||
struct is_member_pointer<const volatile void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
#endif
|
||||
|
||||
@ -349,7 +365,7 @@ struct is_member_pointer<const volatile void>
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // COMPOSITE_TYPE_TRAITS_HPP
|
||||
#endif // BOOST_COMPOSITE_TYPE_TRAITS_HPP
|
||||
|
||||
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
#ifndef BOOST_FWD_TYPE_TRAITS_HPP
|
||||
#include <boost/type_traits/fwd.hpp>
|
||||
#endif
|
||||
#ifndef ARITHMETIC_TYPE_TRAITS_HPP
|
||||
#ifndef BOOST_ARITHMETIC_TYPE_TRAITS_HPP
|
||||
#include <boost/type_traits/arithmetic_traits.hpp>
|
||||
#endif
|
||||
//
|
||||
@ -193,7 +193,7 @@ private:
|
||||
static type_traits::yes_type check(To);
|
||||
static From from;
|
||||
public:
|
||||
BOOST_DECL_MC(bool, value, sizeof( check(from) ) == sizeof(type_traits::yes_type));
|
||||
BOOST_STATIC_CONSTANT(bool, value = sizeof( check(from) ) == sizeof(type_traits::yes_type));
|
||||
void foo(); // avoid warning about all members being private
|
||||
};
|
||||
|
||||
@ -201,19 +201,19 @@ public:
|
||||
template <class From>
|
||||
struct is_convertible<From, void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
|
||||
template <class To>
|
||||
struct is_convertible<void, To>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_convertible<void, void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, true);
|
||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
||||
};
|
||||
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
|
||||
|
@ -10,8 +10,8 @@
|
||||
// is_const, is_volatile, remove_const, remove_volatile, remove_cv.
|
||||
//
|
||||
|
||||
#ifndef CV_TYPE_TRAITS_HPP
|
||||
#define CV_TYPE_TRAITS_HPP
|
||||
#ifndef BOOST_CV_TYPE_TRAITS_HPP
|
||||
#define BOOST_CV_TYPE_TRAITS_HPP
|
||||
|
||||
#ifndef BOOST_ICE_TYPE_TRAITS_HPP
|
||||
#include <boost/type_traits/ice.hpp>
|
||||
@ -33,32 +33,32 @@ struct cv_traits_imp{};
|
||||
template <class T>
|
||||
struct cv_traits_imp<T*>
|
||||
{
|
||||
BOOST_DECL_MC(bool, is_const, false);
|
||||
BOOST_DECL_MC(bool, is_volatile, false);
|
||||
BOOST_STATIC_CONSTANT(bool, is_const = false);
|
||||
BOOST_STATIC_CONSTANT(bool, is_volatile = false);
|
||||
typedef T unqualified_type;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct cv_traits_imp<const T*>
|
||||
{
|
||||
BOOST_DECL_MC(bool, is_const, true);
|
||||
BOOST_DECL_MC(bool, is_volatile, false);
|
||||
BOOST_STATIC_CONSTANT(bool, is_const = true);
|
||||
BOOST_STATIC_CONSTANT(bool, is_volatile = false);
|
||||
typedef T unqualified_type;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct cv_traits_imp<volatile T*>
|
||||
{
|
||||
BOOST_DECL_MC(bool, is_const, false);
|
||||
BOOST_DECL_MC(bool, is_volatile, true);
|
||||
BOOST_STATIC_CONSTANT(bool, is_const = false);
|
||||
BOOST_STATIC_CONSTANT(bool, is_volatile = true);
|
||||
typedef T unqualified_type;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct cv_traits_imp<const volatile T*>
|
||||
{
|
||||
BOOST_DECL_MC(bool, is_const, true);
|
||||
BOOST_DECL_MC(bool, is_volatile, true);
|
||||
BOOST_STATIC_CONSTANT(bool, is_const = true);
|
||||
BOOST_STATIC_CONSTANT(bool, is_volatile = true);
|
||||
typedef T unqualified_type;
|
||||
};
|
||||
|
||||
@ -116,14 +116,14 @@ template <typename T> struct remove_cv<T&>{ typedef T& type; };
|
||||
template <typename T>
|
||||
struct is_const
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, detail::cv_traits_imp<T*>::is_const);
|
||||
BOOST_STATIC_CONSTANT(bool, value = detail::cv_traits_imp<T*>::is_const);
|
||||
};
|
||||
|
||||
//* is a type T declared volatile - is_volatile<T>
|
||||
template <typename T>
|
||||
struct is_volatile
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, detail::cv_traits_imp<T*>::is_volatile);
|
||||
BOOST_STATIC_CONSTANT(bool, value = detail::cv_traits_imp<T*>::is_volatile);
|
||||
};
|
||||
|
||||
#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
@ -147,29 +147,29 @@ struct is_const
|
||||
private:
|
||||
static T t;
|
||||
public:
|
||||
BOOST_DECL_MC(bool, value, (sizeof(detail::yes_type) == sizeof(detail::is_const_helper(&t))));
|
||||
BOOST_STATIC_CONSTANT(bool, value = (sizeof(detail::yes_type) == sizeof(detail::is_const_helper(&t))));
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_const<void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
template <>
|
||||
struct is_const<const void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, true);
|
||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
||||
};
|
||||
template <>
|
||||
struct is_const<volatile void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
template <>
|
||||
struct is_const<const volatile void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, true);
|
||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
||||
};
|
||||
#endif
|
||||
|
||||
@ -179,29 +179,29 @@ struct is_volatile
|
||||
private:
|
||||
static T t;
|
||||
public:
|
||||
BOOST_DECL_MC(bool, value, (sizeof(detail::yes_type) == sizeof(detail::is_volatile_helper(&t))));
|
||||
BOOST_STATIC_CONSTANT(bool, value = (sizeof(detail::yes_type) == sizeof(detail::is_volatile_helper(&t))));
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_volatile<void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
template <>
|
||||
struct is_volatile<const void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
template <>
|
||||
struct is_volatile<volatile void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, true);
|
||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
||||
};
|
||||
template <>
|
||||
struct is_volatile<const volatile void>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, true);
|
||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
||||
};
|
||||
#endif
|
||||
|
||||
@ -209,6 +209,6 @@ struct is_volatile<const volatile void>
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // CV_TYPE_TRAITS_HPP
|
||||
#endif // BOOST_CV_TYPE_TRAITS_HPP
|
||||
|
||||
|
||||
|
@ -16,14 +16,6 @@
|
||||
#include <boost/config.hpp>
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
||||
#define BOOST_DECL_MC(type, name, value) enum{name = value }
|
||||
#define BOOST_DECL_MC2(type, name, v1, v2) enum{name = v1,v2 }
|
||||
#else
|
||||
#define BOOST_DECL_MC(type, name, value) static const type name = value
|
||||
#define BOOST_DECL_MC2(type, name, v1, v2) static const type name = v1,v2
|
||||
#endif
|
||||
|
||||
|
||||
namespace boost{
|
||||
namespace type_traits{
|
||||
@ -33,22 +25,22 @@ typedef double no_type;
|
||||
|
||||
template <bool b>
|
||||
struct ice_not
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
template <>
|
||||
struct ice_not<true>
|
||||
{ BOOST_DECL_MC(bool, value, false); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = false); };
|
||||
|
||||
template <bool b1, bool b2, bool b3 = false, bool b4 = false, bool b5 = false, bool b6 = false, bool b7 = false>
|
||||
struct ice_or;
|
||||
template <bool b1, bool b2, bool b3, bool b4, bool b5, bool b6, bool b7>
|
||||
struct ice_or
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, true);
|
||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
||||
};
|
||||
template <>
|
||||
struct ice_or<false, false, false, false, false, false, false>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
|
||||
template <bool b1, bool b2, bool b3 = true, bool b4 = true, bool b5 = true, bool b6 = true, bool b7 = true>
|
||||
@ -56,12 +48,12 @@ struct ice_and;
|
||||
template <bool b1, bool b2, bool b3, bool b4, bool b5, bool b6, bool b7>
|
||||
struct ice_and
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
template <>
|
||||
struct ice_and<true, true, true, true, true, true, true>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, true);
|
||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
||||
};
|
||||
|
||||
|
||||
|
@ -12,8 +12,8 @@
|
||||
// has_trivial_destructor, is_empty.
|
||||
//
|
||||
|
||||
#ifndef OBJECT_TYPE_TRAITS_HPP
|
||||
#define OBJECT_TYPE_TRAITS_HPP
|
||||
#ifndef BOOST_OBJECT_TYPE_TRAITS_HPP
|
||||
#define BOOST_OBJECT_TYPE_TRAITS_HPP
|
||||
|
||||
#ifndef BOOST_ICE_TYPE_TRAITS_HPP
|
||||
#include <boost/type_traits/ice.hpp>
|
||||
@ -21,10 +21,10 @@
|
||||
#ifndef BOOST_FWD_TYPE_TRAITS_HPP
|
||||
#include <boost/type_traits/fwd.hpp>
|
||||
#endif
|
||||
#ifndef COMPOSITE_TYPE_TRAITS_HPP
|
||||
#ifndef BOOST_COMPOSITE_TYPE_TRAITS_HPP
|
||||
#include <boost/type_traits/composite_traits.hpp>
|
||||
#endif
|
||||
#ifndef ARITHMETIC_TYPE_TRAITS_HPP
|
||||
#ifndef BOOST_ARITHMETIC_TYPE_TRAITS_HPP
|
||||
#include <boost/type_traits/arithmetic_traits.hpp>
|
||||
#endif
|
||||
|
||||
@ -38,7 +38,7 @@ namespace boost{
|
||||
template <typename T>
|
||||
struct is_object
|
||||
{
|
||||
BOOST_DECL_MC(bool, value,
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_and<
|
||||
::boost::type_traits::ice_not< ::boost::is_reference<T>::value>::value,
|
||||
::boost::type_traits::ice_not< ::boost::is_void<T>::value>::value
|
||||
@ -53,7 +53,7 @@ struct is_object
|
||||
template <typename T>
|
||||
struct is_scalar
|
||||
{
|
||||
BOOST_DECL_MC(bool, value,
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_or<
|
||||
::boost::is_arithmetic<T>::value,
|
||||
::boost::is_enum<T>::value,
|
||||
@ -70,7 +70,7 @@ struct is_scalar
|
||||
template <typename T>
|
||||
struct is_class
|
||||
{
|
||||
BOOST_DECL_MC(bool, value,
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_and<
|
||||
::boost::type_traits::ice_not< ::boost::is_union<T>::value >::value,
|
||||
::boost::type_traits::ice_not< ::boost::is_scalar<T>::value >::value,
|
||||
@ -87,7 +87,7 @@ struct is_class
|
||||
**********************************************/
|
||||
template <typename T> struct is_compound
|
||||
{
|
||||
BOOST_DECL_MC(bool, value,
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_or<
|
||||
::boost::is_array<T>::value,
|
||||
::boost::is_pointer<T>::value,
|
||||
@ -106,7 +106,7 @@ template <typename T> struct is_compound
|
||||
**********************************************/
|
||||
template <typename T> struct is_POD
|
||||
{
|
||||
BOOST_DECL_MC(bool, value,
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_or<
|
||||
::boost::is_scalar<T>::value,
|
||||
::boost::is_void<T>::value,
|
||||
@ -117,7 +117,7 @@ template <typename T> struct is_POD
|
||||
template <typename T, std::size_t sz>
|
||||
struct is_POD<T[sz]>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value, ::boost::is_POD<T>::value);
|
||||
BOOST_STATIC_CONSTANT(bool, value = ::boost::is_POD<T>::value);
|
||||
};
|
||||
#endif
|
||||
|
||||
@ -129,7 +129,7 @@ struct is_POD<T[sz]>
|
||||
template <typename T>
|
||||
struct has_trivial_constructor
|
||||
{
|
||||
BOOST_DECL_MC(bool, value,
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_or<
|
||||
::boost::is_POD<T>::value,
|
||||
BOOST_HAS_TRIVIAL_CONSTRUCTOR(T)
|
||||
@ -144,7 +144,7 @@ struct has_trivial_constructor
|
||||
template <typename T>
|
||||
struct has_trivial_copy
|
||||
{
|
||||
BOOST_DECL_MC(bool, value,
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_and<
|
||||
::boost::type_traits::ice_or<
|
||||
::boost::is_POD<T>::value,
|
||||
@ -162,7 +162,7 @@ struct has_trivial_copy
|
||||
template <typename T>
|
||||
struct has_trivial_assign
|
||||
{
|
||||
BOOST_DECL_MC(bool, value,
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_and<
|
||||
::boost::type_traits::ice_or<
|
||||
::boost::is_POD<T>::value,
|
||||
@ -181,7 +181,7 @@ struct has_trivial_assign
|
||||
template <typename T>
|
||||
struct has_trivial_destructor
|
||||
{
|
||||
BOOST_DECL_MC(bool, value,
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_or<
|
||||
::boost::is_POD<T>::value,
|
||||
BOOST_HAS_TRIVIAL_DESTRUCTOR(T)
|
||||
@ -207,12 +207,12 @@ struct empty_helper_t1 : public T
|
||||
struct empty_helper_t2 { int i[256]; };
|
||||
|
||||
template <typename T, bool b, bool b2>
|
||||
struct empty_helper{ BOOST_DECL_MC(bool, value, false); };
|
||||
struct empty_helper{ BOOST_STATIC_CONSTANT(bool, value = false); };
|
||||
|
||||
template <typename T>
|
||||
struct empty_helper<T, true, false>
|
||||
{
|
||||
BOOST_DECL_MC(bool, value,
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(sizeof(empty_helper_t1<T>) == sizeof(empty_helper_t2)));
|
||||
};
|
||||
}
|
||||
@ -223,7 +223,7 @@ struct is_empty
|
||||
private:
|
||||
typedef typename remove_cv<T>::type cvt;
|
||||
public:
|
||||
BOOST_DECL_MC(bool, value,
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_or<
|
||||
::boost::detail::empty_helper<T,
|
||||
::boost::is_class<T>::value ,
|
||||
@ -285,18 +285,25 @@ struct is_empty
|
||||
private:
|
||||
typedef ::boost::detail::empty_helper_chooser<
|
||||
::boost::type_traits::ice_and<
|
||||
!::boost::is_convertible<T,int>::value,
|
||||
!::boost::is_convertible<T,double>::value,
|
||||
!::boost::is_pointer<T>::value,
|
||||
!::boost::is_member_pointer<T>::value,
|
||||
!::boost::is_array<T>::value,
|
||||
!::boost::is_void<T>::value,
|
||||
!::boost::is_convertible<T, const volatile void*>::value
|
||||
::boost::type_traits::ice_not<
|
||||
::boost::is_convertible<T,int>::value>::value,
|
||||
::boost::type_traits::ice_not<
|
||||
::boost::is_convertible<T,double>::value>::value,
|
||||
::boost::type_traits::ice_not<
|
||||
::boost::is_pointer<T>::value>::value,
|
||||
::boost::type_traits::ice_not<
|
||||
::boost::is_member_pointer<T>::value>::value,
|
||||
::boost::type_traits::ice_not<
|
||||
::boost::is_array<T>::value>::value,
|
||||
::boost::type_traits::ice_not<
|
||||
::boost::is_void<T>::value>::value,
|
||||
::boost::type_traits::ice_not<
|
||||
::boost::is_convertible<T, const volatile void*>::value>::value
|
||||
>::value> chooser;
|
||||
typedef typename chooser::template rebind<T> bound_type;
|
||||
typedef typename bound_type::type eh_type;
|
||||
public:
|
||||
BOOST_DECL_MC(bool, value,
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_or<eh_type::value, BOOST_IS_EMPTY(T)>::value));
|
||||
};
|
||||
|
||||
@ -309,7 +316,7 @@ template <typename T> struct is_empty
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // OBJECT_TYPE_TRAITS_HPP
|
||||
#endif // BOOST_OBJECT_TYPE_TRAITS_HPP
|
||||
|
||||
|
||||
|
||||
|
@ -8,8 +8,8 @@
|
||||
//
|
||||
// defines is_same:
|
||||
|
||||
#ifndef SAME_TRAITS_HPP
|
||||
#define SAME_TRAITS_HPP
|
||||
#ifndef BOOST_SAME_TRAITS_HPP
|
||||
#define BOOST_SAME_TRAITS_HPP
|
||||
|
||||
#ifndef BOOST_ICE_TYPE_TRAITS_HPP
|
||||
#include <boost/type_traits/ice.hpp>
|
||||
@ -17,7 +17,7 @@
|
||||
#ifndef BOOST_FWD_TYPE_TRAITS_HPP
|
||||
#include <boost/type_traits/fwd.hpp>
|
||||
#endif
|
||||
#if !defined(COMPOSITE_TYPE_TRAITS_HPP) && defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC)
|
||||
#if !defined(BOOST_COMPOSITE_TYPE_TRAITS_HPP) && defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC)
|
||||
#include <boost/type_traits/composite_traits.hpp>
|
||||
#endif
|
||||
|
||||
@ -32,11 +32,11 @@ namespace boost{
|
||||
|
||||
template <typename T, typename U>
|
||||
struct is_same
|
||||
{ BOOST_DECL_MC(bool, value, false); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = false); };
|
||||
|
||||
template <typename T>
|
||||
struct is_same<T, T>
|
||||
{ BOOST_DECL_MC(bool, value, true); };
|
||||
{ BOOST_STATIC_CONSTANT(bool, value = true); };
|
||||
|
||||
#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
|
||||
@ -70,7 +70,7 @@ private:
|
||||
static T t;
|
||||
static U u;
|
||||
public:
|
||||
BOOST_DECL_MC(bool, value,
|
||||
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<T>::value == ::boost::is_reference<U>::value),
|
||||
@ -84,7 +84,7 @@ public:
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // SAME_TRAITS_HPP
|
||||
#endif // BOOST_SAME_TRAITS_HPP
|
||||
|
||||
|
||||
|
||||
|
@ -10,8 +10,8 @@
|
||||
// remove_reference, add_reference, remove_bounds, remove_pointer.
|
||||
//
|
||||
|
||||
#ifndef TRANSFORM_TRAITS_HPP
|
||||
#define TRANSFORM_TRAITS_HPP
|
||||
#ifndef BOOST_TRANSFORM_TRAITS_HPP
|
||||
#define BOOST_TRANSFORM_TRAITS_HPP
|
||||
|
||||
#ifndef BOOST_ICE_TYPE_TRAITS_HPP
|
||||
#include <boost/type_traits/ice.hpp>
|
||||
@ -19,7 +19,7 @@
|
||||
#ifndef BOOST_FWD_TYPE_TRAITS_HPP
|
||||
#include <boost/type_traits/fwd.hpp>
|
||||
#endif
|
||||
#if !defined(COMPOSITE_TYPE_TRAITS_HPP) && defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
#if !defined(BOOST_COMPOSITE_TYPE_TRAITS_HPP) && defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
#include <boost/type_traits/composite_traits.hpp>
|
||||
#endif
|
||||
|
||||
@ -179,7 +179,7 @@ public:
|
||||
#define BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(x)
|
||||
#endif
|
||||
|
||||
#endif // TRANSFORM_TRAITS_HPP
|
||||
#endif // BOOST_TRANSFORM_TRAITS_HPP
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user