Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/units/make_scaled_unit.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Boost.Units - A C++ library for zero-overhead dimensional analysis and 
0002 // unit/quantity manipulation and conversion
0003 //
0004 // Copyright (C) 2003-2008 Matthias Christian Schabel
0005 // Copyright (C) 2007-2008 Steven Watanabe
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. (See
0008 // accompanying file LICENSE_1_0.txt or copy at
0009 // http://www.boost.org/LICENSE_1_0.txt)
0010 
0011 #ifndef BOOST_UNITS_MAKE_SCALED_UNIT_HPP_INCLUDED
0012 #define BOOST_UNITS_MAKE_SCALED_UNIT_HPP_INCLUDED
0013 
0014 #include <boost/units/units_fwd.hpp>
0015 #include <boost/units/heterogeneous_system.hpp>
0016 #include <boost/units/unit.hpp>
0017 
0018 namespace boost {
0019 namespace units {
0020 
0021 template<class Unit, class Scale>
0022 struct make_scaled_unit {
0023     typedef typename make_scaled_unit<typename reduce_unit<Unit>::type, Scale>::type type;
0024 };
0025 
0026 template<class Dimension, class UnitList, class OldScale, class Scale>
0027 struct make_scaled_unit<unit<Dimension, heterogeneous_system<heterogeneous_system_impl<UnitList, Dimension, OldScale> > >, Scale> {
0028     typedef unit<
0029         Dimension,
0030         heterogeneous_system<
0031             heterogeneous_system_impl<
0032                 UnitList,
0033                 Dimension,
0034                 typename mpl::times<
0035                     OldScale,
0036                     list<scale_list_dim<Scale>, dimensionless_type>
0037                 >::type
0038             >
0039         >
0040     > type;
0041 };
0042 
0043 template<class Dimension, class UnitList, class OldScale, long Base>
0044 struct make_scaled_unit<unit<Dimension, heterogeneous_system<heterogeneous_system_impl<UnitList, Dimension, OldScale> > >, scale<Base, static_rational<0> > > {
0045     typedef unit<
0046         Dimension,
0047         heterogeneous_system<
0048             heterogeneous_system_impl<
0049                 UnitList,
0050                 Dimension,
0051                 OldScale
0052             >
0053         >
0054     > type;
0055 };
0056 
0057 }
0058 }
0059 
0060 #endif