author | William Roberts <williamr@symbian.org> |
Wed, 31 Mar 2010 12:27:01 +0100 | |
branch | Symbian2 |
changeset 3 | e1b950c65cb4 |
permissions | -rw-r--r-- |
williamr@2 | 1 |
|
williamr@2 | 2 |
#ifndef BOOST_MPL_AUX_LARGEST_INT_HPP_INCLUDED |
williamr@2 | 3 |
#define BOOST_MPL_AUX_LARGEST_INT_HPP_INCLUDED |
williamr@2 | 4 |
|
williamr@2 | 5 |
// Copyright Aleksey Gurtovoy 2000-2004 |
williamr@2 | 6 |
// |
williamr@2 | 7 |
// Distributed under the Boost Software License, Version 1.0. |
williamr@2 | 8 |
// (See accompanying file LICENSE_1_0.txt or copy at |
williamr@2 | 9 |
// http://www.boost.org/LICENSE_1_0.txt) |
williamr@2 | 10 |
// |
williamr@2 | 11 |
// See http://www.boost.org/libs/mpl for documentation. |
williamr@2 | 12 |
|
williamr@2 | 13 |
// $Source: /cvsroot/boost/boost/boost/mpl/aux_/largest_int.hpp,v $ |
williamr@2 | 14 |
// $Date: 2004/09/19 03:08:53 $ |
williamr@2 | 15 |
// $Revision: 1.5 $ |
williamr@2 | 16 |
|
williamr@2 | 17 |
#include <boost/mpl/if.hpp> |
williamr@2 | 18 |
#include <boost/mpl/int.hpp> |
williamr@2 | 19 |
#include <boost/mpl/aux_/config/integral.hpp> |
williamr@2 | 20 |
#include <boost/config.hpp> |
williamr@2 | 21 |
|
williamr@2 | 22 |
namespace boost { namespace mpl { namespace aux { |
williamr@2 | 23 |
|
williamr@2 | 24 |
template< typename T > struct integral_rank; |
williamr@2 | 25 |
|
williamr@2 | 26 |
template<> struct integral_rank<bool> : int_<1> {}; |
williamr@2 | 27 |
template<> struct integral_rank<signed char> : int_<2> {}; |
williamr@2 | 28 |
template<> struct integral_rank<char> : int_<3> {}; |
williamr@2 | 29 |
template<> struct integral_rank<unsigned char> : int_<4> {}; |
williamr@2 | 30 |
#if !defined(BOOST_NO_INTRINSIC_WCHAR_T) |
williamr@2 | 31 |
template<> struct integral_rank<wchar_t> : int_<5> {}; |
williamr@2 | 32 |
#endif |
williamr@2 | 33 |
template<> struct integral_rank<short> : int_<6> {}; |
williamr@2 | 34 |
template<> struct integral_rank<unsigned short> : int_<7> {}; |
williamr@2 | 35 |
template<> struct integral_rank<int> : int_<8> {}; |
williamr@2 | 36 |
template<> struct integral_rank<unsigned int> : int_<9> {}; |
williamr@2 | 37 |
template<> struct integral_rank<long> : int_<10> {}; |
williamr@2 | 38 |
template<> struct integral_rank<unsigned long> : int_<11> {}; |
williamr@2 | 39 |
|
williamr@2 | 40 |
#if defined(BOOST_HAS_LONG_LONG) |
williamr@2 | 41 |
template<> struct integral_rank<long_long_type> : int_<12> {}; |
williamr@2 | 42 |
template<> struct integral_rank<ulong_long_type>: int_<13> {}; |
williamr@2 | 43 |
#endif |
williamr@2 | 44 |
|
williamr@2 | 45 |
template< typename T1, typename T2 > struct largest_int |
williamr@2 | 46 |
#if !defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC) |
williamr@2 | 47 |
: if_c< |
williamr@2 | 48 |
( integral_rank<T1>::value >= integral_rank<T2>::value ) |
williamr@2 | 49 |
, T1 |
williamr@2 | 50 |
, T2 |
williamr@2 | 51 |
> |
williamr@2 | 52 |
{ |
williamr@2 | 53 |
#else |
williamr@2 | 54 |
{ |
williamr@2 | 55 |
enum { rank1 = integral_rank<T1>::value }; |
williamr@2 | 56 |
enum { rank2 = integral_rank<T2>::value }; |
williamr@2 | 57 |
typedef typename if_c< (rank1 >= rank2),T1,T2 >::type type; |
williamr@2 | 58 |
#endif |
williamr@2 | 59 |
}; |
williamr@2 | 60 |
|
williamr@2 | 61 |
}}} |
williamr@2 | 62 |
|
williamr@2 | 63 |
#endif // BOOST_MPL_AUX_LARGEST_INT_HPP_INCLUDED |