|
@@ -1262,34 +1262,15 @@ operator*(const _Rep1& __s, const duration<_Rep2, _Period>& __d)
|
|
|
|
|
|
// Duration /
|
|
|
|
|
|
-template <class _Duration, class _Rep, bool = __is_duration<_Rep>::value>
|
|
|
-struct __duration_divide_result
|
|
|
-{
|
|
|
-};
|
|
|
-
|
|
|
-template <class _Duration, class _Rep2,
|
|
|
- bool = is_convertible<_Rep2,
|
|
|
- typename common_type<typename _Duration::rep, _Rep2>::type>::value>
|
|
|
-struct __duration_divide_imp
|
|
|
-{
|
|
|
-};
|
|
|
-
|
|
|
-template <class _Rep1, class _Period, class _Rep2>
|
|
|
-struct __duration_divide_imp<duration<_Rep1, _Period>, _Rep2, true>
|
|
|
-{
|
|
|
- typedef duration<typename common_type<_Rep1, _Rep2>::type, _Period> type;
|
|
|
-};
|
|
|
-
|
|
|
-template <class _Rep1, class _Period, class _Rep2>
|
|
|
-struct __duration_divide_result<duration<_Rep1, _Period>, _Rep2, false>
|
|
|
- : __duration_divide_imp<duration<_Rep1, _Period>, _Rep2>
|
|
|
-{
|
|
|
-};
|
|
|
-
|
|
|
template <class _Rep1, class _Period, class _Rep2>
|
|
|
inline _LIBCPP_INLINE_VISIBILITY
|
|
|
_LIBCPP_CONSTEXPR
|
|
|
-typename __duration_divide_result<duration<_Rep1, _Period>, _Rep2>::type
|
|
|
+typename enable_if
|
|
|
+<
|
|
|
+ !__is_duration<_Rep2>::value &&
|
|
|
+ is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value,
|
|
|
+ duration<typename common_type<_Rep1, _Rep2>::type, _Period>
|
|
|
+>::type
|
|
|
operator/(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
|
|
|
{
|
|
|
typedef typename common_type<_Rep1, _Rep2>::type _Cr;
|
|
@@ -1312,7 +1293,12 @@ operator/(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2
|
|
|
template <class _Rep1, class _Period, class _Rep2>
|
|
|
inline _LIBCPP_INLINE_VISIBILITY
|
|
|
_LIBCPP_CONSTEXPR
|
|
|
-typename __duration_divide_result<duration<_Rep1, _Period>, _Rep2>::type
|
|
|
+typename enable_if
|
|
|
+<
|
|
|
+ !__is_duration<_Rep2>::value &&
|
|
|
+ is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value,
|
|
|
+ duration<typename common_type<_Rep1, _Rep2>::type, _Period>
|
|
|
+>::type
|
|
|
operator%(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
|
|
|
{
|
|
|
typedef typename common_type<_Rep1, _Rep2>::type _Cr;
|