ratio 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // -*- C++ -*-
  2. //===------------------------------ ratio ---------------------------------===//
  3. //
  4. // The LLVM Compiler Infrastructure
  5. //
  6. // This file is distributed under the University of Illinois Open Source
  7. // License. See LICENSE.TXT for details.
  8. //
  9. //===----------------------------------------------------------------------===//
  10. #ifndef _LIBCPP_EXPERIMENTAL_RATIO
  11. #define _LIBCPP_EXPERIMENTAL_RATIO
  12. /**
  13. experimental/ratio synopsis
  14. C++1y
  15. #include <ratio>
  16. namespace std {
  17. namespace experimental {
  18. inline namespace fundamentals_v1 {
  19. // See C++14 20.11.5, ratio comparison
  20. template <class R1, class R2> constexpr bool ratio_equal_v
  21. = ratio_equal<R1, R2>::value;
  22. template <class R1, class R2> constexpr bool ratio_not_equal_v
  23. = ratio_not_equal<R1, R2>::value;
  24. template <class R1, class R2> constexpr bool ratio_less_v
  25. = ratio_less<R1, R2>::value;
  26. template <class R1, class R2> constexpr bool ratio_less_equal_v
  27. = ratio_less_equal<R1, R2>::value;
  28. template <class R1, class R2> constexpr bool ratio_greater_v
  29. = ratio_greater<R1, R2>::value;
  30. template <class R1, class R2> constexpr bool ratio_greater_equal_v
  31. = ratio_greater_equal<R1, R2>::value;
  32. } // namespace fundamentals_v1
  33. } // namespace experimental
  34. } // namespace std
  35. */
  36. #include <experimental/__config>
  37. #if _LIBCPP_STD_VER > 11
  38. #include <ratio>
  39. _LIBCPP_BEGIN_NAMESPACE_LFTS
  40. #ifndef _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
  41. template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_equal_v
  42. = ratio_equal<_R1, _R2>::value;
  43. template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_not_equal_v
  44. = ratio_not_equal<_R1, _R2>::value;
  45. template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_less_v
  46. = ratio_less<_R1, _R2>::value;
  47. template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_less_equal_v
  48. = ratio_less_equal<_R1, _R2>::value;
  49. template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_greater_v
  50. = ratio_greater<_R1, _R2>::value;
  51. template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_greater_equal_v
  52. = ratio_greater_equal<_R1, _R2>::value;
  53. #endif /* _LIBCPP_HAS_NO_VARIABLE_TEMPLATES */
  54. _LIBCPP_END_NAMESPACE_LFTS
  55. #endif /* _LIBCPP_STD_VER > 11 */
  56. #endif // _LIBCPP_EXPERIMENTAL_RATIO