From c666b13c85e4e4938f2b2da0475e442226cc163e Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Mon, 30 Nov 2015 05:04:48 +0000 Subject: [PATCH] Missing file from last commit git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@254286 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/ratio | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/include/ratio b/include/ratio index f623a062..8f708ce4 100644 --- a/include/ratio +++ b/include/ratio @@ -62,6 +62,19 @@ typedef ratio< 1000000000000000000, 1> exa; typedef ratio< 1000000000000000000000, 1> zetta; // not supported typedef ratio<1000000000000000000000000, 1> yotta; // not supported + // 20.11.5, ratio comparison + template constexpr bool ratio_equal_v + = ratio_equal::value; // C++17 + template constexpr bool ratio_not_equal_v + = ratio_not_equal::value; // C++17 + template constexpr bool ratio_less_v + = ratio_less::value; // C++17 + template constexpr bool ratio_less_equal_v + = ratio_less_equal::value; // C++17 + template constexpr bool ratio_greater_v + = ratio_greater::value; // C++17 + template constexpr bool ratio_greater_equal_v + = ratio_greater_equal::value; // C++17 } */ @@ -485,6 +498,26 @@ struct __ratio_gcd __static_lcm<_R1::den, _R2::den>::value> type; }; +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template _LIBCPP_CONSTEXPR bool ratio_equal_v + = ratio_equal<_R1, _R2>::value; + +template _LIBCPP_CONSTEXPR bool ratio_not_equal_v + = ratio_not_equal<_R1, _R2>::value; + +template _LIBCPP_CONSTEXPR bool ratio_less_v + = ratio_less<_R1, _R2>::value; + +template _LIBCPP_CONSTEXPR bool ratio_less_equal_v + = ratio_less_equal<_R1, _R2>::value; + +template _LIBCPP_CONSTEXPR bool ratio_greater_v + = ratio_greater<_R1, _R2>::value; + +template _LIBCPP_CONSTEXPR bool ratio_greater_equal_v + = ratio_greater_equal<_R1, _R2>::value; +#endif + _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP_RATIO