1 // Boost.Units - A C++ library for zero-overhead dimensional analysis and
2 // unit/quantity manipulation and conversion
4 // Copyright (C) 2003-2008 Matthias Christian Schabel
5 // Copyright (C) 2008 Steven Watanabe
7 // Distributed under the Boost Software License, Version 1.0. (See
8 // accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_UNITS_DIM_IMPL_HPP
12 #define BOOST_UNITS_DIM_IMPL_HPP
14 #include <boost/mpl/bool.hpp>
15 #include <boost/mpl/less.hpp>
17 #include <boost/units/units_fwd.hpp>
20 /// \brief Class encapsulating a dimension tag/value pair
36 /// Less than comparison for sorting @c dim.
38 struct less_impl<boost::units::detail::dim_tag, boost::units::detail::dim_tag>
40 template<class T0, class T1>
41 struct apply : mpl::less<typename T0::tag_type, typename T1::tag_type> {};
48 template<class Tag, class Exponent>
51 template<long N, long D>
52 class static_rational;
56 /// Extract @c tag_type from a @c dim.
60 typedef typename T::tag_type type;
63 /// Extract @c value_type from a @c dim.
67 typedef typename T::value_type type;
70 /// Determine if a @c dim is empty (has a zero exponent).
75 struct is_empty_dim< dim<T, static_rational<0, 1> > > :
79 template<typename T, typename V>
80 struct is_empty_dim< dim<T, V> > :
90 #endif // BOOST_UNITS_DIM_IMPL_HPP