1 // Boost.Units - A C++ library for zero-overhead dimensional analysis and
2 // unit/quantity manipulation and conversion
3 //
4 // Copyright (C) 2003-2008 Matthias Christian Schabel
5 // Copyright (C) 2007-2008 Steven Watanabe
6 //
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)
10 
11 #ifndef BOOST_UNITS_DIMENSIONLESS_TYPE_HPP
12 #define BOOST_UNITS_DIMENSIONLESS_TYPE_HPP
13 
14 ///
15 /// \file
16 /// \brief Dimension lists in which all exponents resolve to zero reduce to @c dimensionless_type.
17 ///
18 
19 #include <boost/mpl/long.hpp>
20 #include <boost/mpl/deref.hpp>
21 #include <boost/mpl/arithmetic.hpp>
22 
23 #include <boost/units/config.hpp>
24 
25 namespace boost {
26 
27 namespace units {
28 
29 namespace detail {
30 
31 struct dimension_list_tag;
32 
33 }
34 
35 /// Dimension lists in which all exponents resolve to zero reduce to @c dimensionless_type.
36 struct dimensionless_type
37 {
38     typedef dimensionless_type          type;
39     typedef detail::dimension_list_tag  tag;
40     typedef mpl::long_<0>               size;
41 };
42 
43 } // namespace units
44 
45 } // namespace boost
46 
47 #if BOOST_UNITS_HAS_BOOST_TYPEOF
48 
49 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
50 
51 BOOST_TYPEOF_REGISTER_TYPE(boost::units::dimensionless_type)
52 
53 #endif
54 
55 #endif // BOOST_UNITS_DIMENSIONLESS_TYPE_HPP
56