// (C) Copyright John Maddock 2005. // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt). // // See http://www.boost.org/libs/type_traits for most recent version including documentation. #ifndef BOOST_TT_IS_UNSIGNED_HPP_INCLUDED #define BOOST_TT_IS_UNSIGNED_HPP_INCLUDED #include #include #include #include namespace boost { #if !defined( __CODEGEARC__ ) #if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1310) &&\ !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) &&\ !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION) namespace detail{ template struct is_unsigned_values { // // Note that we cannot use BOOST_STATIC_CONSTANT here, using enum's // rather than "real" static constants simply doesn't work or give // the correct answer. // typedef typename remove_cv::type no_cv_t; static const no_cv_t minus_one = (static_cast(-1)); static const no_cv_t zero = (static_cast(0)); }; template struct is_ununsigned_helper { BOOST_STATIC_CONSTANT(bool, value = (::boost::detail::is_unsigned_values::minus_one > ::boost::detail::is_unsigned_values::zero)); }; template struct is_unsigned_select_helper { template struct rebind { typedef is_ununsigned_helper type; }; }; template <> struct is_unsigned_select_helper { template struct rebind { typedef false_type type; }; }; template struct is_unsigned { typedef ::boost::detail::is_unsigned_select_helper< ::boost::is_integral::value || ::boost::is_enum::value > selector; typedef typename selector::template rebind binder; typedef typename binder::type type; BOOST_STATIC_CONSTANT(bool, value = type::value); }; } // namespace detail template struct is_unsigned : public integral_constant::value> {}; #else template struct is_unsigned : public false_type{}; #endif #else // defined( __CODEGEARC__ ) template struct is_unsigned : public integral_constant {}; #endif template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public false_type{}; template <> struct is_unsigned : public false_type{}; template <> struct is_unsigned : public false_type{}; template <> struct is_unsigned : public false_type{}; template <> struct is_unsigned< short> : public false_type{}; template <> struct is_unsigned : public false_type{}; template <> struct is_unsigned : public false_type{}; template <> struct is_unsigned : public false_type{}; template <> struct is_unsigned< int> : public false_type{}; template <> struct is_unsigned : public false_type{}; template <> struct is_unsigned : public false_type{}; template <> struct is_unsigned : public false_type{}; template <> struct is_unsigned< long> : public false_type{}; template <> struct is_unsigned : public false_type{}; template <> struct is_unsigned : public false_type{}; template <> struct is_unsigned : public false_type{}; #ifdef BOOST_HAS_LONG_LONG template <> struct is_unsigned< ::boost::ulong_long_type> : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned< ::boost::long_long_type> : public false_type{}; template <> struct is_unsigned : public false_type{}; template <> struct is_unsigned : public false_type{}; template <> struct is_unsigned : public false_type{}; #endif #if defined(CHAR_MIN) #if CHAR_MIN == 0 template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; #else template <> struct is_unsigned : public false_type{}; template <> struct is_unsigned : public false_type{}; template <> struct is_unsigned : public false_type{}; template <> struct is_unsigned : public false_type{}; #endif #endif #if !defined(BOOST_NO_INTRINSIC_WCHAR_T) && defined(WCHAR_MIN) #if WCHAR_MIN == 0 template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; template <> struct is_unsigned : public true_type{}; #else template <> struct is_unsigned : public false_type{}; template <> struct is_unsigned : public false_type{}; template <> struct is_unsigned : public false_type{}; template <> struct is_unsigned : public false_type{}; #endif #endif } // namespace boost #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED