Chris@16: // Boost.Units - A C++ library for zero-overhead dimensional analysis and Chris@16: // unit/quantity manipulation and conversion Chris@16: // Chris@16: // Copyright (C) 2003-2008 Matthias Christian Schabel Chris@16: // Copyright (C) 2008 Steven Watanabe Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. (See Chris@16: // accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_UNITS_DIM_IMPL_HPP Chris@16: #define BOOST_UNITS_DIM_IMPL_HPP Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: #include Chris@16: Chris@16: /// \file Chris@16: /// \brief Class encapsulating a dimension tag/value pair Chris@16: Chris@16: namespace boost { Chris@16: Chris@16: namespace units { Chris@16: Chris@16: namespace detail { Chris@16: Chris@16: struct dim_tag; Chris@16: Chris@16: } Chris@16: Chris@16: } Chris@16: Chris@16: namespace mpl { Chris@16: Chris@16: /// Less than comparison for sorting @c dim. Chris@16: template<> Chris@16: struct less_impl Chris@16: { Chris@16: template Chris@16: struct apply : mpl::less {}; Chris@16: }; Chris@16: Chris@16: } Chris@16: Chris@16: namespace units { Chris@16: Chris@16: template Chris@16: struct dim; Chris@16: Chris@16: template Chris@16: class static_rational; Chris@16: Chris@16: namespace detail { Chris@16: Chris@16: /// Extract @c tag_type from a @c dim. Chris@16: template Chris@16: struct get_tag Chris@16: { Chris@16: typedef typename T::tag_type type; Chris@16: }; Chris@16: Chris@16: /// Extract @c value_type from a @c dim. Chris@16: template Chris@16: struct get_value Chris@16: { Chris@16: typedef typename T::value_type type; Chris@16: }; Chris@16: Chris@16: /// Determine if a @c dim is empty (has a zero exponent). Chris@16: template Chris@16: struct is_empty_dim; Chris@16: Chris@16: template Chris@16: struct is_empty_dim< dim > > : Chris@16: mpl::true_ Chris@16: { }; Chris@16: Chris@16: template Chris@16: struct is_empty_dim< dim > : Chris@16: mpl::false_ Chris@16: { }; Chris@16: Chris@16: } // namespace detail Chris@16: Chris@16: } // namespace units Chris@16: Chris@16: } // namespace boost Chris@16: Chris@16: #endif // BOOST_UNITS_DIM_IMPL_HPP