forked from boostorg/type_traits
is_signed and is_unsigned need to inherit from integral_constant.
This commit is contained in:
@@ -62,8 +62,6 @@ struct is_signed_select_helper<false>
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
template <class T>
|
||||
struct is_signed
|
||||
{
|
||||
@@ -73,6 +71,10 @@ struct is_signed
|
||||
BOOST_STATIC_CONSTANT(bool, value = type::value);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
template <class T> struct is_signed : public integral_constant<bool, boost::detail::is_signed<T>::value> {};
|
||||
|
||||
#else
|
||||
|
||||
template <class T> struct is_signed : public false_type{};
|
||||
|
@@ -42,7 +42,7 @@ struct is_ununsigned_helper
|
||||
};
|
||||
|
||||
template <bool integral_type>
|
||||
struct is_ununsigned_select_helper
|
||||
struct is_unsigned_select_helper
|
||||
{
|
||||
template <class T>
|
||||
struct rebind
|
||||
@@ -52,7 +52,7 @@ struct is_ununsigned_select_helper
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_ununsigned_select_helper<false>
|
||||
struct is_unsigned_select_helper<false>
|
||||
{
|
||||
template <class T>
|
||||
struct rebind
|
||||
@@ -61,17 +61,19 @@ struct is_ununsigned_select_helper<false>
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <class T>
|
||||
struct is_unsigned
|
||||
{
|
||||
typedef detail::is_ununsigned_select_helper< ::boost::is_integral<T>::value || ::boost::is_enum<T>::value > selector;
|
||||
typedef 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);
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <class T> struct is_unsigned : public integral_constant<bool, boost::detail::is_unsigned<T>::value> {};
|
||||
|
||||
#else
|
||||
|
||||
template <class T> struct is_unsigned : public false_type{};
|
||||
|
Reference in New Issue
Block a user