From 20eda8b5633dc72b0ea4f3ae7a2956b50dbcdb7b Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Tue, 31 May 2011 16:55:36 +0000 Subject: [PATCH] Upgrade to use template aliases when available. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132342 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/ratio | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/include/ratio b/include/ratio index 7369ccf5d..9764014a1 100644 --- a/include/ratio +++ b/include/ratio @@ -274,10 +274,19 @@ public: >::type type; }; +#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES + +template using ratio_multiply + = typename __ratio_multiply<_R1, _R2>::type; + +#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES + template struct _LIBCPP_VISIBLE ratio_multiply : public __ratio_multiply<_R1, _R2>::type {}; +#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES + template struct __ratio_divide { @@ -292,10 +301,19 @@ public: >::type type; }; +#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES + +template using ratio_divide + = typename __ratio_divide<_R1, _R2>::type; + +#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES + template struct _LIBCPP_VISIBLE ratio_divide : public __ratio_divide<_R1, _R2>::type {}; +#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES + template struct __ratio_add { @@ -318,10 +336,19 @@ public: >::type type; }; +#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES + +template using ratio_add + = typename __ratio_add<_R1, _R2>::type; + +#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES + template struct _LIBCPP_VISIBLE ratio_add : public __ratio_add<_R1, _R2>::type {}; +#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES + template struct __ratio_subtract { @@ -344,10 +371,19 @@ public: >::type type; }; +#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES + +template using ratio_subtract + = typename __ratio_subtract<_R1, _R2>::type; + +#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES + template struct _LIBCPP_VISIBLE ratio_subtract : public __ratio_subtract<_R1, _R2>::type {}; +#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES + // ratio_equal template