epoc32/include/stdapis/boost/numeric/conversion/detail/int_float_mixture.hpp
branchSymbian2
changeset 2 2fe1408b6811
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/stdapis/boost/numeric/conversion/detail/int_float_mixture.hpp	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,72 @@
     1.4 +//  © Copyright Fernando Luis Cacciola Carballal 2000-2004
     1.5 +//  Use, modification, and distribution is subject to the Boost Software
     1.6 +//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
     1.7 +//  http://www.boost.org/LICENSE_1_0.txt)
     1.8 +
     1.9 +//  See library home page at http://www.boost.org/libs/numeric/conversion
    1.10 +//
    1.11 +// Contact the author at: fernando_cacciola@hotmail.com
    1.12 +// 
    1.13 +#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_INT_FLOAT_MIXTURE_FLC_12NOV2002_HPP
    1.14 +#define BOOST_NUMERIC_CONVERSION_DETAIL_INT_FLOAT_MIXTURE_FLC_12NOV2002_HPP
    1.15 +
    1.16 +#include "boost/config.hpp"
    1.17 +#include "boost/limits.hpp"
    1.18 +
    1.19 +#include "boost/numeric/conversion/int_float_mixture_enum.hpp"
    1.20 +#include "boost/numeric/conversion/detail/meta.hpp"
    1.21 +
    1.22 +#include "boost/mpl/integral_c.hpp"
    1.23 +
    1.24 +namespace boost { namespace numeric { namespace convdetail
    1.25 +{
    1.26 +  // Integral Constants for 'IntFloatMixture'
    1.27 +  typedef mpl::integral_c<int_float_mixture_enum, integral_to_integral> int2int_c ;
    1.28 +  typedef mpl::integral_c<int_float_mixture_enum, integral_to_float>    int2float_c ;
    1.29 +  typedef mpl::integral_c<int_float_mixture_enum, float_to_integral>    float2int_c ;
    1.30 +  typedef mpl::integral_c<int_float_mixture_enum, float_to_float>       float2float_c ;
    1.31 +
    1.32 +  // Metafunction:
    1.33 +  //
    1.34 +  //   get_int_float_mixture<T,S>::type
    1.35 +  //
    1.36 +  // Selects the appropriate Int-Float Mixture Integral Constant for the combination T,S.
    1.37 +  //
    1.38 +  template<class T,class S>
    1.39 +  struct get_int_float_mixture
    1.40 +  {
    1.41 +    typedef mpl::bool_< ::std::numeric_limits<S>::is_integer > S_int ;
    1.42 +    typedef mpl::bool_< ::std::numeric_limits<T>::is_integer > T_int ;
    1.43 +
    1.44 +    typedef typename
    1.45 +      for_both<S_int, T_int, int2int_c, int2float_c, float2int_c, float2float_c>::type
    1.46 +        type ;
    1.47 +  } ;
    1.48 +
    1.49 +  // Metafunction:
    1.50 +  //
    1.51 +  //   for_int_float_mixture<Mixture,int_int,int_float,float_int,float_float>::type
    1.52 +  //
    1.53 +  // {Mixture} is one of the Integral Constants for Mixture, declared above.
    1.54 +  // {int_int,int_float,float_int,float_float} are aribtrary types. (not metafunctions)
    1.55 +  //
    1.56 +  // According to the value of 'IntFloatMixture', selects the corresponding type.
    1.57 +  //
    1.58 +  template<class IntFloatMixture, class Int2Int, class Int2Float, class Float2Int, class Float2Float>
    1.59 +  struct for_int_float_mixture
    1.60 +  {
    1.61 +    typedef typename
    1.62 +      ct_switch4<IntFloatMixture
    1.63 +                 ,int2int_c, int2float_c, float2int_c  // default
    1.64 +                 ,Int2Int  , Int2Float  , Float2Int  , Float2Float
    1.65 +                >::type
    1.66 +        type ;
    1.67 +  } ;
    1.68 +
    1.69 +} } } // namespace boost::numeric::convdetail
    1.70 +
    1.71 +#endif
    1.72 +//
    1.73 +///////////////////////////////////////////////////////////////////////////////////////////////
    1.74 +
    1.75 +