is_unit_of_dimension.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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) 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_IS_UNIT_OF_DIMENSION_HPP
  11. #define BOOST_UNITS_IS_UNIT_OF_DIMENSION_HPP
  12. ///
  13. /// \file
  14. /// \brief Check that a type is a unit of the specified dimension.
  15. ///
  16. #include <boost/mpl/bool.hpp>
  17. #include <boost/units/units_fwd.hpp>
  18. namespace boost {
  19. namespace units {
  20. /// Check that a type is a unit of the specified dimension.
  21. template<class T,class Dim>
  22. struct is_unit_of_dimension :
  23. public mpl::false_
  24. { };
  25. template<class Dim,class System>
  26. struct is_unit_of_dimension< unit<Dim,System>,Dim > :
  27. public mpl::true_
  28. { };
  29. template<class Dim,class System>
  30. struct is_unit_of_dimension< absolute<unit<Dim,System> >,Dim > :
  31. public mpl::true_
  32. { };
  33. } // namespace units
  34. } // namespace boost
  35. #endif // BOOST_UNITS_IS_UNIT_OF_DIMENSION_HPP