Upgrade <ratio> to use template aliases when available.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132342 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant 2011-05-31 16:55:36 +00:00
parent c983454d30
commit 20eda8b563

View File

@ -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>