[libcxx] r254286 - Missing file from last commit
Marshall Clow via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 29 21:04:48 PST 2015
Author: marshall
Date: Sun Nov 29 23:04:48 2015
New Revision: 254286
URL: http://llvm.org/viewvc/llvm-project?rev=254286&view=rev
Log:
Missing file from last commit
Modified:
libcxx/trunk/include/ratio
Modified: libcxx/trunk/include/ratio
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/ratio?rev=254286&r1=254285&r2=254286&view=diff
==============================================================================
--- libcxx/trunk/include/ratio (original)
+++ libcxx/trunk/include/ratio Sun Nov 29 23:04:48 2015
@@ -62,6 +62,19 @@ typedef ratio< 1000000000000000000,
typedef ratio< 1000000000000000000000, 1> zetta; // not supported
typedef ratio<1000000000000000000000000, 1> yotta; // not supported
+ // 20.11.5, ratio comparison
+ template <class R1, class R2> constexpr bool ratio_equal_v
+ = ratio_equal<R1, R2>::value; // C++17
+ template <class R1, class R2> constexpr bool ratio_not_equal_v
+ = ratio_not_equal<R1, R2>::value; // C++17
+ template <class R1, class R2> constexpr bool ratio_less_v
+ = ratio_less<R1, R2>::value; // C++17
+ template <class R1, class R2> constexpr bool ratio_less_equal_v
+ = ratio_less_equal<R1, R2>::value; // C++17
+ template <class R1, class R2> constexpr bool ratio_greater_v
+ = ratio_greater<R1, R2>::value; // C++17
+ template <class R1, class R2> constexpr bool ratio_greater_equal_v
+ = ratio_greater_equal<R1, R2>::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 <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_equal_v
+ = ratio_equal<_R1, _R2>::value;
+
+template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_not_equal_v
+ = ratio_not_equal<_R1, _R2>::value;
+
+template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_less_v
+ = ratio_less<_R1, _R2>::value;
+
+template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_less_equal_v
+ = ratio_less_equal<_R1, _R2>::value;
+
+template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_greater_v
+ = ratio_greater<_R1, _R2>::value;
+
+template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_greater_equal_v
+ = ratio_greater_equal<_R1, _R2>::value;
+#endif
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_RATIO
More information about the cfe-commits
mailing list