ratio_fwd.hpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // ratio_fwd.hpp ---------------------------------------------------------------//
  2. // Copyright 2008 Howard Hinnant
  3. // Copyright 2008 Beman Dawes
  4. // Copyright 2009 Vicente J. Botet Escriba
  5. // Distributed under the Boost Software License, Version 1.0.
  6. // See http://www.boost.org/LICENSE_1_0.txt
  7. /*
  8. This code was derived by Beman Dawes from Howard Hinnant's time2_demo prototype.
  9. Many thanks to Howard for making his code available under the Boost license.
  10. The original code was modified to conform to Boost conventions and to section
  11. 20.4 Compile-time rational arithmetic [ratio], of the C++ committee working
  12. paper N2798.
  13. See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2798.pdf.
  14. time2_demo contained this comment:
  15. Much thanks to Andrei Alexandrescu,
  16. Walter Brown,
  17. Peter Dimov,
  18. Jeff Garland,
  19. Terry Golubiewski,
  20. Daniel Krugler,
  21. Anthony Williams.
  22. */
  23. // The way overflow is managed for ratio_less is taken from llvm/libcxx/include/ratio
  24. #ifndef BOOST_RATIO_RATIO_FWD_HPP
  25. #define BOOST_RATIO_RATIO_FWD_HPP
  26. #include <ratio>
  27. namespace boost
  28. {
  29. //----------------------------------------------------------------------------//
  30. // //
  31. // 20.6 Compile-time rational arithmetic [ratio] //
  32. // //
  33. //----------------------------------------------------------------------------//
  34. // ratio
  35. using std::ratio;
  36. // ratio arithmetic
  37. using std::ratio_add;
  38. using std::ratio_subtract;
  39. using std::ratio_multiply;
  40. using std::ratio_divide;
  41. // ratio comparison
  42. using std::ratio_equal;
  43. using std::ratio_not_equal;
  44. using std::ratio_less;
  45. using std::ratio_less_equal;
  46. using std::ratio_greater;
  47. using std::ratio_greater_equal;
  48. // convenience SI typedefs
  49. using std::atto;
  50. using std::femto;
  51. using std::pico;
  52. using std::nano;
  53. using std::micro;
  54. using std::milli;
  55. using std::centi;
  56. using std::deci;
  57. using std::deca;
  58. using std::hecto;
  59. using std::kilo;
  60. using std::mega;
  61. using std::giga;
  62. using std::tera;
  63. using std::peta;
  64. using std::exa;
  65. } // namespace boost
  66. #endif // BOOST_RATIO_RATIO_FWD_HPP