dimensionless_type.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #ifndef BOOST_UNITS_DIMENSIONLESS_TYPE_HPP
  11. #define BOOST_UNITS_DIMENSIONLESS_TYPE_HPP
  12. ///
  13. /// \file
  14. /// \brief Dimension lists in which all exponents resolve to zero reduce to @c dimensionless_type.
  15. ///
  16. #include <boost/mpl/long.hpp>
  17. #include <boost/mpl/deref.hpp>
  18. #include <boost/mpl/arithmetic.hpp>
  19. #include <boost/units/config.hpp>
  20. namespace boost {
  21. namespace units {
  22. namespace detail {
  23. struct dimension_list_tag;
  24. }
  25. /// Dimension lists in which all exponents resolve to zero reduce to @c dimensionless_type.
  26. struct dimensionless_type
  27. {
  28. typedef dimensionless_type type;
  29. typedef detail::dimension_list_tag tag;
  30. typedef mpl::long_<0> size;
  31. };
  32. } // namespace units
  33. } // namespace boost
  34. #if BOOST_UNITS_HAS_BOOST_TYPEOF
  35. #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
  36. BOOST_TYPEOF_REGISTER_TYPE(boost::units::dimensionless_type)
  37. #endif
  38. #endif // BOOST_UNITS_DIMENSIONLESS_TYPE_HPP