forked from boostorg/type_traits
Add some namespace prefixes to avoid ambiguities.
This commit is contained in:
@ -33,7 +33,7 @@ namespace boost
|
||||
private:
|
||||
typedef typename remove_reference<T>::type Ty;
|
||||
public:
|
||||
typedef typename detail::decay_imp<Ty, boost::is_array<Ty>::value, boost::is_function<Ty>::value>::type type;
|
||||
typedef typename boost::detail::decay_imp<Ty, boost::is_array<Ty>::value, boost::is_function<Ty>::value>::type type;
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
@ -55,11 +55,17 @@ namespace boost{
|
||||
typedef T value_type;
|
||||
typedef integral_constant<T, val> type;
|
||||
static const T value = val;
|
||||
//
|
||||
// This helper function is just to disable type-punning
|
||||
// warnings from GCC:
|
||||
//
|
||||
template <class T>
|
||||
static T& dereference(T* p) { return *p; }
|
||||
|
||||
operator const mpl::integral_c<T, val>& ()const
|
||||
{
|
||||
static const char data = 0;
|
||||
return *reinterpret_cast<const mpl::integral_c<T, val>*>(&data);
|
||||
static const char data[sizeof(long)] = { 0 };
|
||||
return dereference(reinterpret_cast<const mpl::integral_c<T, val>*>(&data));
|
||||
}
|
||||
BOOST_CONSTEXPR operator T() { return val; }
|
||||
};
|
||||
@ -73,11 +79,17 @@ namespace boost{
|
||||
typedef mpl::integral_c_tag tag;
|
||||
typedef integral_constant<bool, val> type;
|
||||
static const bool value = val;
|
||||
//
|
||||
// This helper function is just to disable type-punning
|
||||
// warnings from GCC:
|
||||
//
|
||||
template <class T>
|
||||
static T& dereference(T* p) { return *p; }
|
||||
|
||||
operator const mpl::bool_<val>& ()const
|
||||
{
|
||||
static const char data = 0;
|
||||
return *reinterpret_cast<const mpl::bool_<val>*>(&data);
|
||||
return dereference(reinterpret_cast<const mpl::bool_<val>*>(&data));
|
||||
}
|
||||
BOOST_CONSTEXPR operator bool() { return val; }
|
||||
};
|
||||
|
@ -66,7 +66,7 @@ struct is_signed_select_helper<false>
|
||||
template <class T>
|
||||
struct is_signed
|
||||
{
|
||||
typedef detail::is_signed_select_helper< ::boost::is_integral<T>::value || ::boost::is_enum<T>::value> selector;
|
||||
typedef ::boost::detail::is_signed_select_helper< ::boost::is_integral<T>::value || ::boost::is_enum<T>::value> selector;
|
||||
typedef typename selector::template rebind<T> binder;
|
||||
typedef typename binder::type type;
|
||||
BOOST_STATIC_CONSTANT(bool, value = type::value);
|
||||
|
@ -66,7 +66,7 @@ struct is_unsigned_select_helper<false>
|
||||
template <class T>
|
||||
struct is_unsigned
|
||||
{
|
||||
typedef detail::is_unsigned_select_helper< ::boost::is_integral<T>::value || ::boost::is_enum<T>::value > selector;
|
||||
typedef ::boost::detail::is_unsigned_select_helper< ::boost::is_integral<T>::value || ::boost::is_enum<T>::value > selector;
|
||||
typedef typename selector::template rebind<T> binder;
|
||||
typedef typename binder::type type;
|
||||
BOOST_STATIC_CONSTANT(bool, value = type::value);
|
||||
|
@ -50,7 +50,7 @@ namespace boost {
|
||||
};
|
||||
|
||||
template <std::size_t Target, bool check> struct long_double_alignment{ typedef long double type; };
|
||||
template <std::size_t Target> struct long_double_alignment<Target, false>{ typedef detail::max_align type; };
|
||||
template <std::size_t Target> struct long_double_alignment<Target, false>{ typedef boost::detail::max_align type; };
|
||||
|
||||
template <std::size_t Target, bool check> struct double_alignment{ typedef double type; };
|
||||
template <std::size_t Target> struct double_alignment<Target, false>{ typedef typename long_double_alignment<Target, boost::alignment_of<long double>::value >= Target>::type type; };
|
||||
@ -81,7 +81,7 @@ template <std::size_t Target> struct char_alignment<Target, false>{ typedef type
|
||||
template <std::size_t Align>
|
||||
struct type_with_alignment
|
||||
{
|
||||
typedef typename detail::char_alignment<Align, boost::alignment_of<char>::value >= Align>::type type;
|
||||
typedef typename boost::detail::char_alignment<Align, boost::alignment_of<char>::value >= Align>::type type;
|
||||
};
|
||||
|
||||
#if defined(__GNUC__) && !defined(BOOST_TT_DISABLE_INTRINSICS)
|
||||
@ -159,7 +159,7 @@ template<> struct type_with_alignment<8>
|
||||
typedef boost::conditional<
|
||||
::boost::alignment_of<boost::detail::max_align>::value < 8,
|
||||
tt_align_ns::a8,
|
||||
detail::char_alignment<8, false> >::type t1;
|
||||
boost::detail::char_alignment<8, false> >::type t1;
|
||||
public:
|
||||
typedef t1::type type;
|
||||
};
|
||||
@ -168,7 +168,7 @@ template<> struct type_with_alignment<16>
|
||||
typedef boost::conditional<
|
||||
::boost::alignment_of<boost::detail::max_align>::value < 16,
|
||||
tt_align_ns::a16,
|
||||
detail::char_alignment<16, false> >::type t1;
|
||||
boost::detail::char_alignment<16, false> >::type t1;
|
||||
public:
|
||||
typedef t1::type type;
|
||||
};
|
||||
@ -177,7 +177,7 @@ template<> struct type_with_alignment<32>
|
||||
typedef boost::conditional<
|
||||
::boost::alignment_of<boost::detail::max_align>::value < 32,
|
||||
tt_align_ns::a32,
|
||||
detail::char_alignment<32, false> >::type t1;
|
||||
boost::detail::char_alignment<32, false> >::type t1;
|
||||
public:
|
||||
typedef t1::type type;
|
||||
};
|
||||
@ -185,7 +185,7 @@ template<> struct type_with_alignment<64> {
|
||||
typedef boost::conditional<
|
||||
::boost::alignment_of<boost::detail::max_align>::value < 64,
|
||||
tt_align_ns::a64,
|
||||
detail::char_alignment<64, false> >::type t1;
|
||||
boost::detail::char_alignment<64, false> >::type t1;
|
||||
public:
|
||||
typedef t1::type type;
|
||||
};
|
||||
@ -193,7 +193,7 @@ template<> struct type_with_alignment<128> {
|
||||
typedef boost::conditional<
|
||||
::boost::alignment_of<boost::detail::max_align>::value < 128,
|
||||
tt_align_ns::a128,
|
||||
detail::char_alignment<128, false> >::type t1;
|
||||
boost::detail::char_alignment<128, false> >::type t1;
|
||||
public:
|
||||
typedef t1::type type;
|
||||
};
|
||||
|
Reference in New Issue
Block a user