Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/units/get_dimension.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) 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_GET_DIMENSION_HPP
0012 #define BOOST_UNITS_GET_DIMENSION_HPP
0013 
0014 ///
0015 /// \file
0016 /// \brief Get the dimension of a unit, absolute unit and quantity.
0017 /// \details
0018 ///
0019 
0020 #include <boost/units/units_fwd.hpp>
0021 
0022 namespace boost {
0023 
0024 namespace units {
0025 
0026 template<class T>
0027 struct get_dimension {};
0028 
0029 /// Get the dimension of a unit.
0030 template<class Dim,class System>
0031 struct get_dimension< unit<Dim,System> >
0032 {
0033     typedef Dim type;
0034 };
0035 
0036 /// Get the dimension of an absolute unit.
0037 template<class Unit>
0038 struct get_dimension< absolute<Unit> >
0039 {
0040     typedef typename get_dimension<Unit>::type  type;
0041 };
0042 
0043 /// Get the dimension of a quantity.
0044 template<class Unit,class Y>
0045 struct get_dimension< quantity<Unit,Y> >
0046 {
0047     typedef typename get_dimension<Unit>::type  type;
0048 };
0049 
0050 } // namespace units
0051 
0052 } // namespace boost
0053 
0054 #endif // BOOST_UNITS_GET_DIMENSION_HPP