epoc32/include/stdapis/boost/numeric/conversion/bounds.hpp
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/stdapis/boost/numeric/conversion/bounds.hpp	Wed Mar 31 12:27:01 2010 +0100
     1.3 @@ -0,0 +1,58 @@
     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_BOUNDS_DETAIL_FLC_12NOV2002_HPP
    1.14 +#define BOOST_NUMERIC_CONVERSION_BOUNDS_DETAIL_FLC_12NOV2002_HPP
    1.15 +
    1.16 +#include "boost/limits.hpp"
    1.17 +#include "boost/config.hpp"
    1.18 +#include "boost/mpl/if.hpp"
    1.19 +
    1.20 +namespace boost { namespace numeric { namespace boundsdetail
    1.21 +{
    1.22 +  template<class N>
    1.23 +  class Integral
    1.24 +  {
    1.25 +      typedef std::numeric_limits<N> limits ;
    1.26 +
    1.27 +    public :
    1.28 +    
    1.29 +      static N lowest  () { return limits::min BOOST_PREVENT_MACRO_SUBSTITUTION (); }
    1.30 +      static N highest () { return limits::max BOOST_PREVENT_MACRO_SUBSTITUTION (); }
    1.31 +      static N smallest() { return static_cast<N>(1); }
    1.32 +  } ;
    1.33 +
    1.34 +  template<class N>
    1.35 +  class Float
    1.36 +  {
    1.37 +      typedef std::numeric_limits<N> limits ;
    1.38 +
    1.39 +    public :
    1.40 +    
    1.41 +      static N lowest  () { return static_cast<N>(-limits::max BOOST_PREVENT_MACRO_SUBSTITUTION ()) ; }
    1.42 +      static N highest () { return limits::max BOOST_PREVENT_MACRO_SUBSTITUTION (); }
    1.43 +      static N smallest() { return limits::min BOOST_PREVENT_MACRO_SUBSTITUTION (); }
    1.44 +  } ;
    1.45 +
    1.46 +  template<class N>
    1.47 +  struct get_impl
    1.48 +  {
    1.49 +    typedef mpl::bool_< ::std::numeric_limits<N>::is_integer > is_int ;
    1.50 +
    1.51 +    typedef Integral<N> impl_int   ;
    1.52 +    typedef Float   <N> impl_float ;
    1.53 +
    1.54 +    typedef typename mpl::if_<is_int,impl_int,impl_float>::type type ;
    1.55 +  } ;
    1.56 +
    1.57 +} } } // namespace boost::numeric::boundsdetail.
    1.58 +
    1.59 +#endif
    1.60 +//
    1.61 +///////////////////////////////////////////////////////////////////////////////////////////////