diff options
Diffstat (limited to 'boost/type_traits/integral_promotion.hpp')
-rw-r--r-- | boost/type_traits/integral_promotion.hpp | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/boost/type_traits/integral_promotion.hpp b/boost/type_traits/integral_promotion.hpp index 9c5514b115..0478f56349 100644 --- a/boost/type_traits/integral_promotion.hpp +++ b/boost/type_traits/integral_promotion.hpp @@ -7,18 +7,12 @@ #define FILE_boost_type_traits_integral_promotion_hpp_INCLUDED #include <boost/config.hpp> - -#include <boost/mpl/eval_if.hpp> -#include <boost/mpl/identity.hpp> #include <boost/type_traits/integral_constant.hpp> #include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_enum.hpp> #include <boost/type_traits/is_volatile.hpp> #include <boost/type_traits/remove_cv.hpp> -// Should be the last #include -#include <boost/type_traits/detail/type_trait_def.hpp> - namespace boost { namespace type_traits { namespace detail { @@ -168,27 +162,20 @@ struct integral_promotion_impl >::type type; }; -template<class T> -struct integral_promotion - : public boost::mpl::eval_if< - need_promotion<BOOST_DEDUCED_TYPENAME remove_cv<T>::type> - , integral_promotion_impl<T> - , boost::mpl::identity<T> - > -{ -}; +template<class T, bool b> struct integral_promotion { typedef T type; }; +template<class T> struct integral_promotion<T, true> : public integral_promotion_impl<T>{}; } } -BOOST_TT_AUX_TYPE_TRAIT_DEF1( - integral_promotion - , T - , BOOST_DEDUCED_TYPENAME - boost::type_traits::detail::integral_promotion<T>::type - ) -} +template <class T> struct integral_promotion +{ +private: + typedef boost::type_traits::detail::need_promotion<typename remove_cv<T>::type> tag_type; +public: + typedef typename boost::type_traits::detail::integral_promotion<T, tag_type::value>::type type; +}; -#include <boost/type_traits/detail/type_trait_undef.hpp> +} #endif // #ifndef FILE_boost_type_traits_integral_promotion_hpp_INCLUDED |