Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:51:18

0001 #ifndef BOOST_RATIO_DETAIL_IS_EVENLY_DIVISIBLE_BY_HPP
0002 #define BOOST_RATIO_DETAIL_IS_EVENLY_DIVISIBLE_BY_HPP
0003 
0004 // Copyright 2023 Peter Dimov
0005 // Distributed under the Boost Software License, Version 1.0.
0006 // https://www.boost.org/LICENSE_1_0.txt
0007 
0008 #include <type_traits>
0009 #include <cstdint>
0010 
0011 namespace boost
0012 {
0013 namespace ratio_detail
0014 {
0015 
0016 template<std::intmax_t A, std::intmax_t B> struct is_evenly_divisible_by_: std::integral_constant<bool, A % B == 0>
0017 {
0018 };
0019 
0020 template<std::intmax_t A> struct is_evenly_divisible_by_<A, 0>: std::false_type
0021 {
0022 };
0023 
0024 template<class R1, class R2> struct is_evenly_divisible_by: std::integral_constant<bool,
0025     is_evenly_divisible_by_<R1::num, R2::num>::value && is_evenly_divisible_by_<R2::den, R1::den>::value>
0026 {
0027 };
0028 
0029 } // namespace ratio_detail
0030 } // namespace boost
0031 
0032 #endif // BOOST_RATIO_DETAIL_IS_EVENLY_DIVISIBLE_BY_HPP