is_signed and is_unsigned need to inherit from integral_constant.

This commit is contained in:
jzmaddock
2015-01-29 11:46:31 +00:00
parent d584c75252
commit 18f8c75289
2 changed files with 11 additions and 7 deletions

View File

@@ -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{};

View File

@@ -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{};