summaryrefslogtreecommitdiffstats
path: root/libcxx/include/ratio
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2011-05-31 16:55:36 +0000
committerHoward Hinnant <hhinnant@apple.com>2011-05-31 16:55:36 +0000
commite3c6708439a35913936586a34d204580994d9957 (patch)
treed6c92e6b9c0227799aab6d4ae64cdef27dcead43 /libcxx/include/ratio
parent4dae7379eff6a0a101508c4dd5bae12cd2a857fd (diff)
downloadbcm5719-llvm-e3c6708439a35913936586a34d204580994d9957.tar.gz
bcm5719-llvm-e3c6708439a35913936586a34d204580994d9957.zip
Upgrade <ratio> to use template aliases when available.
llvm-svn: 132342
Diffstat (limited to 'libcxx/include/ratio')
-rw-r--r--libcxx/include/ratio36
1 files changed, 36 insertions, 0 deletions
diff --git a/libcxx/include/ratio b/libcxx/include/ratio
index 7369ccf5d05..9764014a1e3 100644
--- a/libcxx/include/ratio
+++ b/libcxx/include/ratio
@@ -274,10 +274,19 @@ public:
>::type type;
};
+#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+
+template <class _R1, class _R2> using ratio_multiply
+ = typename __ratio_multiply<_R1, _R2>::type;
+
+#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+
template <class _R1, class _R2>
struct _LIBCPP_VISIBLE ratio_multiply
: public __ratio_multiply<_R1, _R2>::type {};
+#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+
template <class _R1, class _R2>
struct __ratio_divide
{
@@ -292,10 +301,19 @@ public:
>::type type;
};
+#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+
+template <class _R1, class _R2> using ratio_divide
+ = typename __ratio_divide<_R1, _R2>::type;
+
+#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+
template <class _R1, class _R2>
struct _LIBCPP_VISIBLE ratio_divide
: public __ratio_divide<_R1, _R2>::type {};
+#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+
template <class _R1, class _R2>
struct __ratio_add
{
@@ -318,10 +336,19 @@ public:
>::type type;
};
+#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+
+template <class _R1, class _R2> using ratio_add
+ = typename __ratio_add<_R1, _R2>::type;
+
+#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+
template <class _R1, class _R2>
struct _LIBCPP_VISIBLE ratio_add
: public __ratio_add<_R1, _R2>::type {};
+#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+
template <class _R1, class _R2>
struct __ratio_subtract
{
@@ -344,10 +371,19 @@ public:
>::type type;
};
+#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+
+template <class _R1, class _R2> using ratio_subtract
+ = typename __ratio_subtract<_R1, _R2>::type;
+
+#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+
template <class _R1, class _R2>
struct _LIBCPP_VISIBLE ratio_subtract
: public __ratio_subtract<_R1, _R2>::type {};
+#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+
// ratio_equal
template <class _R1, class _R2>
OpenPOWER on IntegriCloud