[cfe-commits] [libcxx] r132342 - /libcxx/trunk/include/ratio
Howard Hinnant
hhinnant at apple.com
Tue May 31 09:55:36 PDT 2011
Author: hhinnant
Date: Tue May 31 11:55:36 2011
New Revision: 132342
URL: http://llvm.org/viewvc/llvm-project?rev=132342&view=rev
Log:
Upgrade <ratio> to use template aliases when available.
Modified:
libcxx/trunk/include/ratio
Modified: libcxx/trunk/include/ratio
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/ratio?rev=132342&r1=132341&r2=132342&view=diff
==============================================================================
--- libcxx/trunk/include/ratio (original)
+++ libcxx/trunk/include/ratio Tue May 31 11:55:36 2011
@@ -274,10 +274,19 @@
>::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 @@
>::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 @@
>::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 @@
>::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>
More information about the cfe-commits
mailing list