epoc32/include/stdapis/boost/mpl/aux_/largest_int.hpp
branchSymbian2
changeset 2 2fe1408b6811
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/stdapis/boost/mpl/aux_/largest_int.hpp	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,63 @@
     1.4 +
     1.5 +#ifndef BOOST_MPL_AUX_LARGEST_INT_HPP_INCLUDED
     1.6 +#define BOOST_MPL_AUX_LARGEST_INT_HPP_INCLUDED
     1.7 +
     1.8 +// Copyright Aleksey Gurtovoy 2000-2004
     1.9 +//
    1.10 +// Distributed under the Boost Software License, Version 1.0. 
    1.11 +// (See accompanying file LICENSE_1_0.txt or copy at 
    1.12 +// http://www.boost.org/LICENSE_1_0.txt)
    1.13 +//
    1.14 +// See http://www.boost.org/libs/mpl for documentation.
    1.15 +
    1.16 +// $Source: /cvsroot/boost/boost/boost/mpl/aux_/largest_int.hpp,v $
    1.17 +// $Date: 2004/09/19 03:08:53 $
    1.18 +// $Revision: 1.5 $
    1.19 +
    1.20 +#include <boost/mpl/if.hpp>
    1.21 +#include <boost/mpl/int.hpp>
    1.22 +#include <boost/mpl/aux_/config/integral.hpp>
    1.23 +#include <boost/config.hpp>
    1.24 +
    1.25 +namespace boost { namespace mpl { namespace aux {
    1.26 +
    1.27 +template< typename T > struct integral_rank;
    1.28 +
    1.29 +template<> struct integral_rank<bool>           : int_<1> {};
    1.30 +template<> struct integral_rank<signed char>    : int_<2> {};
    1.31 +template<> struct integral_rank<char>           : int_<3> {};
    1.32 +template<> struct integral_rank<unsigned char>  : int_<4> {};
    1.33 +#if !defined(BOOST_NO_INTRINSIC_WCHAR_T)
    1.34 +template<> struct integral_rank<wchar_t>        : int_<5> {};
    1.35 +#endif
    1.36 +template<> struct integral_rank<short>          : int_<6> {};
    1.37 +template<> struct integral_rank<unsigned short> : int_<7> {};
    1.38 +template<> struct integral_rank<int>            : int_<8> {};
    1.39 +template<> struct integral_rank<unsigned int>   : int_<9> {};
    1.40 +template<> struct integral_rank<long>           : int_<10> {};
    1.41 +template<> struct integral_rank<unsigned long>  : int_<11> {};
    1.42 +
    1.43 +#if defined(BOOST_HAS_LONG_LONG)
    1.44 +template<> struct integral_rank<long_long_type> : int_<12> {};
    1.45 +template<> struct integral_rank<ulong_long_type>: int_<13> {};
    1.46 +#endif
    1.47 +
    1.48 +template< typename T1, typename T2 > struct largest_int
    1.49 +#if !defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC)
    1.50 +    : if_c< 
    1.51 +          ( integral_rank<T1>::value >= integral_rank<T2>::value )
    1.52 +        , T1
    1.53 +        , T2
    1.54 +        >
    1.55 +{
    1.56 +#else
    1.57 +{
    1.58 +    enum { rank1 = integral_rank<T1>::value };
    1.59 +    enum { rank2 = integral_rank<T2>::value };
    1.60 +    typedef typename if_c< (rank1 >= rank2),T1,T2 >::type type;
    1.61 +#endif
    1.62 +};
    1.63 +
    1.64 +}}}
    1.65 +
    1.66 +#endif // BOOST_MPL_AUX_LARGEST_INT_HPP_INCLUDED