Chris@16: Chris@16: #ifndef BOOST_MPL_AUX_LARGEST_INT_HPP_INCLUDED Chris@16: #define BOOST_MPL_AUX_LARGEST_INT_HPP_INCLUDED Chris@16: Chris@16: // Copyright Aleksey Gurtovoy 2000-2004 Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // See http://www.boost.org/libs/mpl for documentation. Chris@16: Chris@101: // $Id$ Chris@101: // $Date$ Chris@101: // $Revision$ Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost { namespace mpl { namespace aux { Chris@16: Chris@16: template< typename T > struct integral_rank; Chris@16: Chris@16: template<> struct integral_rank : int_<1> {}; Chris@16: template<> struct integral_rank : int_<2> {}; Chris@16: template<> struct integral_rank : int_<3> {}; Chris@16: template<> struct integral_rank : int_<4> {}; Chris@16: #if !defined(BOOST_NO_INTRINSIC_WCHAR_T) Chris@16: template<> struct integral_rank : int_<5> {}; Chris@16: #endif Chris@16: template<> struct integral_rank : int_<6> {}; Chris@16: template<> struct integral_rank : int_<7> {}; Chris@16: template<> struct integral_rank : int_<8> {}; Chris@16: template<> struct integral_rank : int_<9> {}; Chris@16: template<> struct integral_rank : int_<10> {}; Chris@16: template<> struct integral_rank : int_<11> {}; Chris@16: Chris@16: #if defined(BOOST_HAS_LONG_LONG) Chris@16: template<> struct integral_rank : int_<12> {}; Chris@16: template<> struct integral_rank: int_<13> {}; Chris@16: #endif Chris@16: Chris@16: template< typename T1, typename T2 > struct largest_int Chris@16: #if !defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC) Chris@16: : if_c< Chris@16: ( integral_rank::value >= integral_rank::value ) Chris@16: , T1 Chris@16: , T2 Chris@16: > Chris@16: { Chris@16: #else Chris@16: { Chris@16: enum { rank1 = integral_rank::value }; Chris@16: enum { rank2 = integral_rank::value }; Chris@16: typedef typename if_c< (rank1 >= rank2),T1,T2 >::type type; Chris@16: #endif Chris@16: }; Chris@16: Chris@16: }}} Chris@16: Chris@16: #endif // BOOST_MPL_AUX_LARGEST_INT_HPP_INCLUDED