is_ratio.hpp 591 B

12345678910111213141516171819202122232425262728
  1. #ifndef BOOST_RATIO_DETAIL_IS_RATIO_HPP
  2. #define BOOST_RATIO_DETAIL_IS_RATIO_HPP
  3. // Copyright 2023 Peter Dimov
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // https://www.boost.org/LICENSE_1_0.txt
  6. #include <boost/ratio/ratio_fwd.hpp>
  7. #include <type_traits>
  8. #include <cstdint>
  9. namespace boost
  10. {
  11. namespace ratio_detail
  12. {
  13. template<class T> struct is_ratio: std::false_type
  14. {
  15. };
  16. template<std::intmax_t A, std::intmax_t B> struct is_ratio< boost::ratio<A, B> >: std::true_type
  17. {
  18. };
  19. } // namespace ratio_detail
  20. } // namespace boost
  21. #endif // BOOST_RATIO_DETAIL_IS_RATIO_HPP