Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //  ratio.hpp  ---------------------------------------------------------------//
0002 
0003 //  Copyright 2008 Howard Hinnant
0004 //  Copyright 2008 Beman Dawes
0005 //  Copyright 2009 Vicente J. Botet Escriba
0006 
0007 //  Distributed under the Boost Software License, Version 1.0.
0008 //  See http://www.boost.org/LICENSE_1_0.txt
0009 
0010 /*
0011 
0012 This code was derived by Beman Dawes from Howard Hinnant's time2_demo prototype.
0013 Many thanks to Howard for making his code available under the Boost license.
0014 The original code was modified to conform to Boost conventions and to section
0015 20.4 Compile-time rational arithmetic [ratio], of the C++ committee working
0016 paper N2798.
0017 See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2798.pdf.
0018 
0019 time2_demo contained this comment:
0020 
0021     Much thanks to Andrei Alexandrescu,
0022                    Walter Brown,
0023                    Peter Dimov,
0024                    Jeff Garland,
0025                    Terry Golubiewski,
0026                    Daniel Krugler,
0027                    Anthony Williams.
0028 */
0029 
0030 // The way overflow is managed for ratio_less is taken from llvm/libcxx/include/ratio
0031 
0032 #ifndef BOOST_RATIO_RATIO_HPP
0033 #define BOOST_RATIO_RATIO_HPP
0034 
0035 #include <boost/ratio/ratio_fwd.hpp>
0036 #include <boost/ratio/detail/gcd_lcm.hpp>
0037 
0038 namespace boost
0039 {
0040 
0041 // extension used by Chrono
0042 
0043 template <class R1, class R2> using ratio_gcd = typename ratio<
0044     ratio_detail::gcd<R1::num, R2::num>::value,
0045     ratio_detail::lcm<R1::den, R2::den>::value>::type;
0046 
0047 }  // namespace boost
0048 
0049 #endif  // BOOST_RATIO_RATIO_HPP