numeric_cast.hpp 748 B

12345678910111213141516171819202122232425262728293031
  1. // numeric_cast.hpp
  2. //
  3. // (C) Copyright 2011 Vicente J. Botet Escriba
  4. // Use, modification and distribution are subject to the Boost Software License,
  5. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt).
  7. //
  8. #ifndef BOOST_RATIO_MPL_NUMERIC_CAST_HPP
  9. #define BOOST_RATIO_MPL_NUMERIC_CAST_HPP
  10. #include <boost/ratio/ratio.hpp>
  11. #include <boost/mpl/integral_c.hpp>
  12. #include <boost/ratio/mpl/rational_c_tag.hpp>
  13. #include <boost/mpl/numeric_cast.hpp>
  14. namespace boost {
  15. namespace mpl {
  16. template<> struct numeric_cast< integral_c_tag,rational_c_tag >
  17. {
  18. template< typename N > struct apply
  19. : ratio< N::value, 1 >
  20. {
  21. };
  22. };
  23. }
  24. }
  25. #endif // BOOST_RATIO_MPL_NUMERIC_CAST_HPP