summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2015-11-30 05:04:48 +0000
committerMarshall Clow <mclow.lists@gmail.com>2015-11-30 05:04:48 +0000
commit825a9edb2e5aa8cb43d25df68ae7616ddcf4824d (patch)
treee6be3475d002fc09de044ac55af8ebf082e20496
parent4ddfaea7732ea6bee32c615d9bf1dc27d07b4e7a (diff)
downloadbcm5719-llvm-825a9edb2e5aa8cb43d25df68ae7616ddcf4824d.tar.gz
bcm5719-llvm-825a9edb2e5aa8cb43d25df68ae7616ddcf4824d.zip
Missing file from last commit
llvm-svn: 254286
-rw-r--r--libcxx/include/ratio33
1 files changed, 33 insertions, 0 deletions
diff --git a/libcxx/include/ratio b/libcxx/include/ratio
index f623a062f2c..8f708ce478d 100644
--- a/libcxx/include/ratio
+++ b/libcxx/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 <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
OpenPOWER on IntegriCloud