29 #ifndef _GLIBCXX_CHRONO
30 #define _GLIBCXX_CHRONO 1
32 #pragma GCC system_header
34 #if __cplusplus < 201103L
44 namespace std _GLIBCXX_VISIBILITY(default)
46 _GLIBCXX_BEGIN_NAMESPACE_VERSION
61 template<
typename _Rep,
typename _Period = ratio<1>>
64 template<
typename _Clock,
typename _Dur =
typename _Clock::duration>
70 template<
typename _CT,
typename _Period1,
typename _Period2>
71 struct __duration_common_type_wrapper
74 typedef __static_gcd<_Period1::num, _Period2::num> __gcd_num;
75 typedef __static_gcd<_Period1::den, _Period2::den> __gcd_den;
76 typedef typename _CT::type __cr;
77 typedef ratio<__gcd_num::value,
78 (_Period1::den / __gcd_den::value) * _Period2::den> __r;
80 typedef __success_type<chrono::duration<__cr, __r>> type;
83 template<
typename _Period1,
typename _Period2>
84 struct __duration_common_type_wrapper<__failure_type, _Period1, _Period2>
85 {
typedef __failure_type type; };
87 template<
typename _Rep1,
typename _Period1,
typename _Rep2,
typename _Period2>
88 struct common_type<chrono::duration<_Rep1, _Period1>,
89 chrono::duration<_Rep2, _Period2>>
90 :
public __duration_common_type_wrapper<typename __member_type_wrapper<
91 common_type<_Rep1, _Rep2>>::type, _Period1, _Period2>::type
96 template<
typename _CT,
typename _Clock>
97 struct __timepoint_common_type_wrapper
99 typedef __success_type<chrono::time_point<_Clock, typename _CT::type>>
103 template<
typename _Clock>
104 struct __timepoint_common_type_wrapper<__failure_type, _Clock>
105 {
typedef __failure_type type; };
107 template<
typename _Clock,
typename _Duration1,
typename _Duration2>
108 struct common_type<chrono::time_point<_Clock, _Duration1>,
109 chrono::time_point<_Clock, _Duration2>>
110 :
public __timepoint_common_type_wrapper<typename __member_type_wrapper<
111 common_type<_Duration1, _Duration2>>::type, _Clock>::type
117 template<
typename _ToDur,
typename _CF,
typename _CR,
118 bool _NumIsOne =
false,
bool _DenIsOne =
false>
119 struct __duration_cast_impl
121 template<
typename _Rep,
typename _Period>
122 static constexpr _ToDur
123 __cast(
const duration<_Rep, _Period>& __d)
125 typedef typename _ToDur::rep __to_rep;
126 return _ToDur(static_cast<__to_rep>(static_cast<_CR>(__d.count())
127 * static_cast<_CR>(_CF::num)
128 /
static_cast<_CR
>(_CF::den)));
132 template<
typename _ToDur,
typename _CF,
typename _CR>
133 struct __duration_cast_impl<_ToDur, _CF, _CR, true, true>
135 template<
typename _Rep,
typename _Period>
136 static constexpr _ToDur
137 __cast(
const duration<_Rep, _Period>& __d)
139 typedef typename _ToDur::rep __to_rep;
140 return _ToDur(static_cast<__to_rep>(__d.count()));
144 template<
typename _ToDur,
typename _CF,
typename _CR>
145 struct __duration_cast_impl<_ToDur, _CF, _CR, true, false>
147 template<
typename _Rep,
typename _Period>
148 static constexpr _ToDur
149 __cast(
const duration<_Rep, _Period>& __d)
151 typedef typename _ToDur::rep __to_rep;
152 return _ToDur(static_cast<__to_rep>(
153 static_cast<_CR>(__d.count()) / static_cast<_CR>(_CF::den)));
157 template<
typename _ToDur,
typename _CF,
typename _CR>
158 struct __duration_cast_impl<_ToDur, _CF, _CR, false, true>
160 template<
typename _Rep,
typename _Period>
161 static constexpr _ToDur
162 __cast(
const duration<_Rep, _Period>& __d)
164 typedef typename _ToDur::rep __to_rep;
165 return _ToDur(static_cast<__to_rep>(
166 static_cast<_CR>(__d.count()) * static_cast<_CR>(_CF::num)));
170 template<
typename _Tp>
175 template<
typename _Rep,
typename _Period>
176 struct __is_duration<duration<_Rep, _Period>>
180 template<
typename _Tp>
181 using __enable_if_is_duration
182 =
typename enable_if<__is_duration<_Tp>::value, _Tp>::type;
184 template<
typename _Tp>
185 using __disable_if_is_duration
186 =
typename enable_if<!__is_duration<_Tp>::value, _Tp>::type;
189 template<
typename _ToDur,
typename _Rep,
typename _Period>
190 constexpr __enable_if_is_duration<_ToDur>
193 typedef typename _ToDur::period __to_period;
194 typedef typename _ToDur::rep __to_rep;
198 typedef __duration_cast_impl<_ToDur, __cf, __cr,
199 __cf::num == 1, __cf::den == 1> __dc;
200 return __dc::__cast(__d);
204 template<
typename _Rep>
209 #if __cplusplus > 201402L
210 template <
typename _Rep>
211 inline constexpr
bool treat_as_floating_point_v =
215 #if __cplusplus >= 201703L
216 # define __cpp_lib_chrono 201611
218 template<
typename _ToDur,
typename _Rep,
typename _Period>
219 constexpr __enable_if_is_duration<_ToDur>
224 return __to - _ToDur{1};
228 template<
typename _ToDur,
typename _Rep,
typename _Period>
229 constexpr __enable_if_is_duration<_ToDur>
230 ceil(
const duration<_Rep, _Period>& __d)
234 return __to + _ToDur{1};
238 template <
typename _ToDur,
typename _Rep,
typename _Period>
240 __and_<__is_duration<_ToDur>,
241 __not_<treat_as_floating_point<typename _ToDur::rep>>>::value,
243 round(
const duration<_Rep, _Period>& __d)
245 _ToDur __t0 = chrono::floor<_ToDur>(__d);
246 _ToDur __t1 = __t0 + _ToDur{1};
247 auto __diff0 = __d - __t0;
248 auto __diff1 = __t1 - __d;
249 if (__diff0 == __diff1)
251 if (__t0.count() & 1)
255 else if (__diff0 < __diff1)
260 template<
typename _Rep,
typename _Period>
262 enable_if_t<numeric_limits<_Rep>::is_signed, duration<_Rep, _Period>>
263 abs(duration<_Rep, _Period> __d)
265 if (__d >= __d.zero())
272 template<
typename _Rep>
275 static constexpr _Rep
279 static constexpr _Rep
283 static constexpr _Rep
288 template<
typename _Tp>
293 template<
intmax_t _Num,
intmax_t _Den>
294 struct __is_ratio<
ratio<_Num, _Den>>
299 template<
typename _Rep,
typename _Period>
303 template<
typename _Rep2>
304 using __is_float = treat_as_floating_point<_Rep2>;
307 template<
typename _Period2>
309 = __bool_constant<ratio_divide<_Period2, _Period>::den == 1>;
314 typedef _Period period;
316 static_assert(!__is_duration<_Rep>::value,
"rep cannot be a duration");
317 static_assert(__is_ratio<_Period>::value,
318 "period must be a specialization of ratio");
319 static_assert(_Period::num > 0,
"period must be positive");
322 constexpr duration() =
default;
324 duration(
const duration&) =
default;
328 template<
typename _Rep2,
typename = _Require<
329 is_convertible<const _Rep2&, rep>,
330 __or_<__is_float<rep>, __not_<__is_float<_Rep2>>>>>
331 constexpr
explicit duration(
const _Rep2& __rep)
332 : __r(static_cast<rep>(__rep)) { }
334 template<
typename _Rep2,
typename _Period2,
typename = _Require<
335 __or_<__is_float<rep>,
336 __and_<__is_harmonic<_Period2>,
337 __not_<__is_float<_Rep2>>>>>>
338 constexpr duration(
const duration<_Rep2, _Period2>& __d)
341 ~duration() =
default;
342 duration& operator=(
const duration&) =
default;
356 {
return duration(-__r); }
358 _GLIBCXX17_CONSTEXPR duration&
365 _GLIBCXX17_CONSTEXPR duration
367 {
return duration(__r++); }
369 _GLIBCXX17_CONSTEXPR duration&
376 _GLIBCXX17_CONSTEXPR duration
378 {
return duration(__r--); }
380 _GLIBCXX17_CONSTEXPR duration&
381 operator+=(
const duration& __d)
387 _GLIBCXX17_CONSTEXPR duration&
388 operator-=(
const duration& __d)
394 _GLIBCXX17_CONSTEXPR duration&
395 operator*=(
const rep& __rhs)
401 _GLIBCXX17_CONSTEXPR duration&
402 operator/=(
const rep& __rhs)
409 template<
typename _Rep2 = rep>
411 typename enable_if<!treat_as_floating_point<_Rep2>::value,
413 operator%=(
const rep& __rhs)
419 template<
typename _Rep2 = rep>
421 typename enable_if<!treat_as_floating_point<_Rep2>::value,
423 operator%=(
const duration& __d)
430 static constexpr duration
432 {
return duration(duration_values<rep>::zero()); }
434 static constexpr duration
438 static constexpr duration
446 template<
typename _Rep1,
typename _Period1,
447 typename _Rep2,
typename _Period2>
448 constexpr
typename common_type<duration<_Rep1, _Period1>,
449 duration<_Rep2, _Period2>>::type
450 operator+(
const duration<_Rep1, _Period1>& __lhs,
451 const duration<_Rep2, _Period2>& __rhs)
453 typedef duration<_Rep1, _Period1> __dur1;
454 typedef duration<_Rep2, _Period2> __dur2;
455 typedef typename common_type<__dur1,__dur2>::type __cd;
456 return __cd(__cd(__lhs).count() + __cd(__rhs).count());
459 template<
typename _Rep1,
typename _Period1,
460 typename _Rep2,
typename _Period2>
461 constexpr
typename common_type<duration<_Rep1, _Period1>,
462 duration<_Rep2, _Period2>>::type
463 operator-(
const duration<_Rep1, _Period1>& __lhs,
464 const duration<_Rep2, _Period2>& __rhs)
466 typedef duration<_Rep1, _Period1> __dur1;
467 typedef duration<_Rep2, _Period2> __dur2;
468 typedef typename common_type<__dur1,__dur2>::type __cd;
469 return __cd(__cd(__lhs).count() - __cd(__rhs).count());
476 template<
typename _Rep1,
typename _Rep2,
477 typename _CRep =
typename common_type<_Rep1, _Rep2>::type>
478 using __common_rep_t =
typename
479 enable_if<is_convertible<const _Rep2&, _CRep>::value, _CRep>::type;
481 template<
typename _Rep1,
typename _Period,
typename _Rep2>
482 constexpr duration<__common_rep_t<_Rep1, _Rep2>, _Period>
483 operator*(
const duration<_Rep1, _Period>& __d,
const _Rep2& __s)
485 typedef duration<typename common_type<_Rep1, _Rep2>::type, _Period>
487 return __cd(__cd(__d).count() * __s);
490 template<
typename _Rep1,
typename _Rep2,
typename _Period>
491 constexpr duration<__common_rep_t<_Rep2, _Rep1>, _Period>
492 operator*(
const _Rep1& __s,
const duration<_Rep2, _Period>& __d)
493 {
return __d * __s; }
495 template<
typename _Rep1,
typename _Period,
typename _Rep2>
497 duration<__common_rep_t<_Rep1, __disable_if_is_duration<_Rep2>>, _Period>
498 operator/(
const duration<_Rep1, _Period>& __d,
const _Rep2& __s)
500 typedef duration<typename common_type<_Rep1, _Rep2>::type, _Period>
502 return __cd(__cd(__d).count() / __s);
505 template<
typename _Rep1,
typename _Period1,
506 typename _Rep2,
typename _Period2>
507 constexpr
typename common_type<_Rep1, _Rep2>::type
508 operator/(
const duration<_Rep1, _Period1>& __lhs,
509 const duration<_Rep2, _Period2>& __rhs)
511 typedef duration<_Rep1, _Period1> __dur1;
512 typedef duration<_Rep2, _Period2> __dur2;
513 typedef typename common_type<__dur1,__dur2>::type __cd;
514 return __cd(__lhs).count() / __cd(__rhs).count();
518 template<
typename _Rep1,
typename _Period,
typename _Rep2>
520 duration<__common_rep_t<_Rep1, __disable_if_is_duration<_Rep2>>, _Period>
521 operator%(
const duration<_Rep1, _Period>& __d,
const _Rep2& __s)
523 typedef duration<typename common_type<_Rep1, _Rep2>::type, _Period>
525 return __cd(__cd(__d).count() % __s);
528 template<
typename _Rep1,
typename _Period1,
529 typename _Rep2,
typename _Period2>
530 constexpr
typename common_type<duration<_Rep1, _Period1>,
531 duration<_Rep2, _Period2>>::type
532 operator%(
const duration<_Rep1, _Period1>& __lhs,
533 const duration<_Rep2, _Period2>& __rhs)
535 typedef duration<_Rep1, _Period1> __dur1;
536 typedef duration<_Rep2, _Period2> __dur2;
537 typedef typename common_type<__dur1,__dur2>::type __cd;
538 return __cd(__cd(__lhs).count() % __cd(__rhs).count());
542 template<
typename _Rep1,
typename _Period1,
543 typename _Rep2,
typename _Period2>
545 operator==(
const duration<_Rep1, _Period1>& __lhs,
546 const duration<_Rep2, _Period2>& __rhs)
548 typedef duration<_Rep1, _Period1> __dur1;
549 typedef duration<_Rep2, _Period2> __dur2;
550 typedef typename common_type<__dur1,__dur2>::type __ct;
551 return __ct(__lhs).count() == __ct(__rhs).count();
554 template<
typename _Rep1,
typename _Period1,
555 typename _Rep2,
typename _Period2>
557 operator<(const duration<_Rep1, _Period1>& __lhs,
558 const duration<_Rep2, _Period2>& __rhs)
560 typedef duration<_Rep1, _Period1> __dur1;
561 typedef duration<_Rep2, _Period2> __dur2;
562 typedef typename common_type<__dur1,__dur2>::type __ct;
563 return __ct(__lhs).count() < __ct(__rhs).count();
566 template<
typename _Rep1,
typename _Period1,
567 typename _Rep2,
typename _Period2>
569 operator!=(
const duration<_Rep1, _Period1>& __lhs,
570 const duration<_Rep2, _Period2>& __rhs)
571 {
return !(__lhs == __rhs); }
573 template<
typename _Rep1,
typename _Period1,
574 typename _Rep2,
typename _Period2>
576 operator<=(const duration<_Rep1, _Period1>& __lhs,
577 const duration<_Rep2, _Period2>& __rhs)
578 {
return !(__rhs < __lhs); }
580 template<
typename _Rep1,
typename _Period1,
581 typename _Rep2,
typename _Period2>
583 operator>(
const duration<_Rep1, _Period1>& __lhs,
584 const duration<_Rep2, _Period2>& __rhs)
585 {
return __rhs < __lhs; }
587 template<
typename _Rep1,
typename _Period1,
588 typename _Rep2,
typename _Period2>
590 operator>=(
const duration<_Rep1, _Period1>& __lhs,
591 const duration<_Rep2, _Period2>& __rhs)
592 {
return !(__lhs < __rhs); }
594 #ifdef _GLIBCXX_USE_C99_STDINT_TR1
595 # define _GLIBCXX_CHRONO_INT64_T int64_t
596 #elif defined __INT64_TYPE__
597 # define _GLIBCXX_CHRONO_INT64_T __INT64_TYPE__
600 "Representation type for nanoseconds must have at least 64 bits");
601 # define _GLIBCXX_CHRONO_INT64_T long long
622 #undef _GLIBCXX_CHRONO_INT64_T
625 template<
typename _Clock,
typename _Dur>
628 typedef _Clock clock;
630 typedef typename duration::rep rep;
631 typedef typename duration::period period;
633 constexpr
time_point() : __d(duration::zero())
636 constexpr
explicit time_point(
const duration& __dur)
641 template<
typename _Dur2,
642 typename = _Require<is_convertible<_Dur2, _Dur>>>
644 : __d(__t.time_since_epoch())
649 time_since_epoch()
const
653 _GLIBCXX17_CONSTEXPR time_point&
660 _GLIBCXX17_CONSTEXPR time_point&
668 static constexpr time_point
670 {
return time_point(duration::min()); }
672 static constexpr time_point
674 {
return time_point(duration::max()); }
681 template<
typename _ToDur,
typename _Clock,
typename _Dur>
683 time_point<_Clock, _ToDur>>::type
687 return __time_point(duration_cast<_ToDur>(__t.time_since_epoch()));
690 #if __cplusplus > 201402L
691 template<
typename _ToDur,
typename _Clock,
typename _Dur>
694 floor(
const time_point<_Clock, _Dur>& __tp)
696 return time_point<_Clock, _ToDur>{
697 chrono::floor<_ToDur>(__tp.time_since_epoch())};
700 template<
typename _ToDur,
typename _Clock,
typename _Dur>
702 enable_if_t<__is_duration<_ToDur>::value, time_point<_Clock, _ToDur>>
703 ceil(
const time_point<_Clock, _Dur>& __tp)
705 return time_point<_Clock, _ToDur>{
706 chrono::ceil<_ToDur>(__tp.time_since_epoch())};
709 template<
typename _ToDur,
typename _Clock,
typename _Dur>
711 __and_<__is_duration<_ToDur>,
712 __not_<treat_as_floating_point<typename _ToDur::rep>>>::value,
713 time_point<_Clock, _ToDur>>
714 round(
const time_point<_Clock, _Dur>& __tp)
716 return time_point<_Clock, _ToDur>{
717 chrono::round<_ToDur>(__tp.time_since_epoch())};
721 template<
typename _Clock,
typename _Dur1,
722 typename _Rep2,
typename _Period2>
723 constexpr time_point<_Clock,
724 typename common_type<_Dur1, duration<_Rep2, _Period2>>::type>
725 operator+(
const time_point<_Clock, _Dur1>& __lhs,
726 const duration<_Rep2, _Period2>& __rhs)
728 typedef duration<_Rep2, _Period2> __dur2;
729 typedef typename common_type<_Dur1,__dur2>::type __ct;
730 typedef time_point<_Clock, __ct> __time_point;
731 return __time_point(__lhs.time_since_epoch() + __rhs);
734 template<
typename _Rep1,
typename _Period1,
735 typename _Clock,
typename _Dur2>
736 constexpr time_point<_Clock,
737 typename common_type<duration<_Rep1, _Period1>, _Dur2>::type>
738 operator+(
const duration<_Rep1, _Period1>& __lhs,
739 const time_point<_Clock, _Dur2>& __rhs)
741 typedef duration<_Rep1, _Period1> __dur1;
742 typedef typename common_type<__dur1,_Dur2>::type __ct;
743 typedef time_point<_Clock, __ct> __time_point;
744 return __time_point(__rhs.time_since_epoch() + __lhs);
747 template<
typename _Clock,
typename _Dur1,
748 typename _Rep2,
typename _Period2>
749 constexpr time_point<_Clock,
750 typename common_type<_Dur1, duration<_Rep2, _Period2>>::type>
751 operator-(
const time_point<_Clock, _Dur1>& __lhs,
752 const duration<_Rep2, _Period2>& __rhs)
754 typedef duration<_Rep2, _Period2> __dur2;
755 typedef typename common_type<_Dur1,__dur2>::type __ct;
756 typedef time_point<_Clock, __ct> __time_point;
757 return __time_point(__lhs.time_since_epoch() -__rhs);
760 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
761 constexpr
typename common_type<_Dur1, _Dur2>::type
762 operator-(
const time_point<_Clock, _Dur1>& __lhs,
763 const time_point<_Clock, _Dur2>& __rhs)
764 {
return __lhs.time_since_epoch() - __rhs.time_since_epoch(); }
766 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
768 operator==(
const time_point<_Clock, _Dur1>& __lhs,
769 const time_point<_Clock, _Dur2>& __rhs)
770 {
return __lhs.time_since_epoch() == __rhs.time_since_epoch(); }
772 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
774 operator!=(
const time_point<_Clock, _Dur1>& __lhs,
775 const time_point<_Clock, _Dur2>& __rhs)
776 {
return !(__lhs == __rhs); }
778 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
780 operator<(const time_point<_Clock, _Dur1>& __lhs,
781 const time_point<_Clock, _Dur2>& __rhs)
782 {
return __lhs.time_since_epoch() < __rhs.time_since_epoch(); }
784 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
786 operator<=(const time_point<_Clock, _Dur1>& __lhs,
787 const time_point<_Clock, _Dur2>& __rhs)
788 {
return !(__rhs < __lhs); }
790 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
792 operator>(
const time_point<_Clock, _Dur1>& __lhs,
793 const time_point<_Clock, _Dur2>& __rhs)
794 {
return __rhs < __lhs; }
796 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
798 operator>=(
const time_point<_Clock, _Dur1>& __lhs,
799 const time_point<_Clock, _Dur2>& __rhs)
800 {
return !(__lhs < __rhs); }
821 inline namespace _V2 {
831 typedef duration::rep rep;
832 typedef duration::period period;
835 static_assert(system_clock::duration::min()
836 < system_clock::duration::zero(),
837 "a clock's minimum duration cannot be less than its epoch");
839 static constexpr
bool is_steady =
false;
848 return std::time_t(duration_cast<chrono::seconds>
849 (__t.time_since_epoch()).count());
853 from_time_t(std::time_t __t)
noexcept
870 typedef duration::rep rep;
871 typedef duration::period period;
874 static constexpr
bool is_steady =
true;
893 #if __cplusplus > 201103L
895 #define __cpp_lib_chrono_udls 201304
897 inline namespace literals
899 inline namespace chrono_literals
901 #pragma GCC diagnostic push
902 #pragma GCC diagnostic ignored "-Wliteral-suffix"
903 template<
typename _Dur,
char... _Digits>
904 constexpr _Dur __check_overflow()
906 using _Val = __parse_int::_Parse_int<_Digits...>;
907 constexpr
typename _Dur::rep __repval = _Val::value;
908 static_assert(__repval >= 0 && __repval == _Val::value,
909 "literal value cannot be represented by duration type");
910 return _Dur(__repval);
913 constexpr chrono::duration<long double, ratio<3600,1>>
914 operator""h(
long double __hours)
915 {
return chrono::duration<long double, ratio<3600,1>>{__hours}; }
917 template <
char... _Digits>
922 constexpr chrono::duration<long double, ratio<60,1>>
923 operator""min(
long double __mins)
924 {
return chrono::duration<long double, ratio<60,1>>{__mins}; }
926 template <
char... _Digits>
931 constexpr chrono::duration<long double>
932 operator""s(
long double __secs)
933 {
return chrono::duration<long double>{__secs}; }
935 template <
char... _Digits>
940 constexpr chrono::duration<long double, milli>
941 operator""ms(
long double __msecs)
942 {
return chrono::duration<long double, milli>{__msecs}; }
944 template <
char... _Digits>
949 constexpr chrono::duration<long double, micro>
950 operator""us(
long double __usecs)
951 {
return chrono::duration<long double, micro>{__usecs}; }
953 template <
char... _Digits>
958 constexpr chrono::duration<long double, nano>
959 operator""ns(
long double __nsecs)
960 {
return chrono::duration<long double, nano>{__nsecs}; }
962 template <
char... _Digits>
967 #pragma GCC diagnostic pop
973 using namespace literals::chrono_literals;
980 _GLIBCXX_END_NAMESPACE_VERSION
985 #endif //_GLIBCXX_CHRONO
_Tp abs(const complex< _Tp > &)
Return magnitude of z.
Provides compile-time rational arithmetic.
constexpr enable_if< __is_duration< _ToDur >::value, time_point< _Clock, _ToDur > >::type time_point_cast(const time_point< _Clock, _Dur > &__t)
time_point_cast
duration< int64_t, micro > microseconds
microseconds
typename enable_if< _Cond, _Tp >::type enable_if_t
Alias template for enable_if.
enable_if< ::__array_traits< _Tp, _Nm >::_Is_swappable::value >::type noexcept(noexcept(__one.swap(__two)))
swap
Define a member typedef type only if a boolean constant is true.
static constexpr _Tp max() noexcept
_GLIBCXX14_CONSTEXPR const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
duration< int64_t, nano > nanoseconds
nanoseconds
_GLIBCXX14_CONSTEXPR const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
duration< int64_t, ratio< 3600 > > hours
hours
duration< int64_t > seconds
seconds
duration< int64_t, milli > milliseconds
milliseconds
typename __ratio_divide< _R1, _R2 >::type ratio_divide
ratio_divide
constexpr __enable_if_is_duration< _ToDur > duration_cast(const duration< _Rep, _Period > &__d)
duration_cast
duration< int64_t, ratio< 60 > > minutes
minutes
Properties of fundamental types.
static constexpr _Tp lowest() noexcept