30 #ifndef _GLIBCXX_CHRONO_H
31 #define _GLIBCXX_CHRONO_H 1
33 #pragma GCC system_header
35 #if __cplusplus >= 201103L
42 #if __cplusplus >= 202002L
47 namespace std _GLIBCXX_VISIBILITY(default)
49 _GLIBCXX_BEGIN_NAMESPACE_VERSION
51 #if __cplusplus >= 201703L
52 namespace filesystem {
struct __file_clock; };
61 template<
typename _Rep,
typename _Period = ratio<1>>
65 template<
typename _Clock,
typename _Dur =
typename _Clock::duration>
77 template<
typename _CT,
typename _Period1,
typename _Period2,
typename =
void>
78 struct __duration_common_type
81 template<
typename _CT,
typename _Period1,
typename _Period2>
82 struct __duration_common_type<_CT, _Period1, _Period2,
83 __void_t<typename _CT::type>>
86 using __gcd_num = __static_gcd<_Period1::num, _Period2::num>;
87 using __gcd_den = __static_gcd<_Period1::den, _Period2::den>;
88 using __cr =
typename _CT::type;
89 using __r = ratio<__gcd_num::value,
90 (_Period1::den / __gcd_den::value) * _Period2::den>;
93 using type = chrono::duration<__cr, typename __r::type>;
102 template<
typename _Rep1,
typename _Period1,
typename _Rep2,
typename _Period2>
105 : __duration_common_type<common_type<_Rep1, _Rep2>,
106 typename _Period1::type,
107 typename _Period2::type>
111 template<
typename _Rep,
typename _Period>
116 typename _Period::type>;
120 template<
typename _Rep,
typename _Period>
124 typename _Period::type>;
132 template<
typename _CT,
typename _Clock,
typename =
void>
133 struct __timepoint_common_type
136 template<
typename _CT,
typename _Clock>
137 struct __timepoint_common_type<_CT, _Clock, __void_t<typename _CT::type>>
139 using type = chrono::time_point<_Clock, typename _CT::type>;
148 template<
typename _Clock,
typename _Duration1,
typename _Duration2>
151 : __timepoint_common_type<common_type<_Duration1, _Duration2>, _Clock>
155 template<
typename _Clock,
typename _Duration>
161 template<
typename _Clock,
typename _Duration>
176 template<
typename _ToDur,
typename _CF,
typename _CR,
177 bool _NumIsOne =
false,
bool _DenIsOne =
false>
178 struct __duration_cast_impl
180 template<
typename _Rep,
typename _Period>
181 static constexpr _ToDur
182 __cast(
const duration<_Rep, _Period>& __d)
184 typedef typename _ToDur::rep __to_rep;
185 return _ToDur(
static_cast<__to_rep
>(
static_cast<_CR
>(__d.count())
186 *
static_cast<_CR
>(_CF::num)
187 /
static_cast<_CR
>(_CF::den)));
191 template<
typename _ToDur,
typename _CF,
typename _CR>
192 struct __duration_cast_impl<_ToDur, _CF, _CR, true, true>
194 template<
typename _Rep,
typename _Period>
195 static constexpr _ToDur
196 __cast(
const duration<_Rep, _Period>& __d)
198 typedef typename _ToDur::rep __to_rep;
199 return _ToDur(
static_cast<__to_rep
>(__d.count()));
203 template<
typename _ToDur,
typename _CF,
typename _CR>
204 struct __duration_cast_impl<_ToDur, _CF, _CR, true, false>
206 template<
typename _Rep,
typename _Period>
207 static constexpr _ToDur
208 __cast(
const duration<_Rep, _Period>& __d)
210 typedef typename _ToDur::rep __to_rep;
211 return _ToDur(
static_cast<__to_rep
>(
212 static_cast<_CR
>(__d.count()) /
static_cast<_CR
>(_CF::den)));
216 template<
typename _ToDur,
typename _CF,
typename _CR>
217 struct __duration_cast_impl<_ToDur, _CF, _CR, false, true>
219 template<
typename _Rep,
typename _Period>
220 static constexpr _ToDur
221 __cast(
const duration<_Rep, _Period>& __d)
223 typedef typename _ToDur::rep __to_rep;
224 return _ToDur(
static_cast<__to_rep
>(
225 static_cast<_CR
>(__d.count()) *
static_cast<_CR
>(_CF::num)));
229 template<
typename _Tp>
234 template<
typename _Rep,
typename _Period>
235 struct __is_duration<duration<_Rep, _Period>>
239 template<
typename _Tp>
240 using __enable_if_is_duration
241 =
typename enable_if<__is_duration<_Tp>::value, _Tp>::type;
243 template<
typename _Tp>
244 using __disable_if_is_duration
245 =
typename enable_if<!__is_duration<_Tp>::value, _Tp>::type;
250 template<
typename _ToDur,
typename _Rep,
typename _Period>
251 constexpr __enable_if_is_duration<_ToDur>
254 typedef typename _ToDur::period __to_period;
255 typedef typename _ToDur::rep __to_rep;
258 typedef __duration_cast_impl<_ToDur, __cf, __cr,
259 __cf::num == 1, __cf::den == 1> __dc;
260 return __dc::__cast(__d);
264 template<
typename _Rep>
269 #if __cplusplus > 201402L
270 template <
typename _Rep>
271 inline constexpr
bool treat_as_floating_point_v =
275 #if __cplusplus > 201703L
276 template<
typename _Tp>
279 template<
typename _Tp>
280 inline constexpr
bool is_clock_v = is_clock<_Tp>::value;
282 #if __cpp_lib_concepts
283 template<
typename _Tp>
287 template<
typename _Tp>
290 typename _Tp::period;
291 typename _Tp::duration;
292 typename _Tp::time_point::clock;
293 typename _Tp::time_point::duration;
294 { &_Tp::is_steady } -> same_as<const bool*>;
295 { _Tp::now() } -> same_as<typename _Tp::time_point>;
296 requires
same_as<
typename _Tp::duration,
297 duration<typename _Tp::rep, typename _Tp::period>>;
298 requires
same_as<
typename _Tp::time_point::duration,
299 typename _Tp::duration>;
304 template<
typename _Tp,
typename =
void>
308 template<
typename _Tp>
309 struct __is_clock_impl<_Tp,
310 void_t<typename _Tp::rep, typename _Tp::period,
311 typename _Tp::duration,
312 typename _Tp::time_point::duration,
313 decltype(_Tp::is_steady),
314 decltype(_Tp::now())>>
315 : __and_<is_same<typename _Tp::duration,
316 duration<typename _Tp::rep, typename _Tp::period>>,
317 is_same<typename _Tp::time_point::duration,
318 typename _Tp::duration>,
319 is_same<decltype(&_Tp::is_steady), const bool*>,
320 is_same<decltype(_Tp::now()), typename _Tp::time_point>>::type
323 template<
typename _Tp>
324 struct is_clock : __is_clock_impl<_Tp>::type
329 #if __cplusplus >= 201703L
330 # define __cpp_lib_chrono 201611L
332 template<
typename _ToDur,
typename _Rep,
typename _Period>
333 constexpr __enable_if_is_duration<_ToDur>
334 floor(
const duration<_Rep, _Period>& __d)
336 auto __to = chrono::duration_cast<_ToDur>(__d);
338 return __to - _ToDur{1};
342 template<
typename _ToDur,
typename _Rep,
typename _Period>
343 constexpr __enable_if_is_duration<_ToDur>
344 ceil(
const duration<_Rep, _Period>& __d)
346 auto __to = chrono::duration_cast<_ToDur>(__d);
348 return __to + _ToDur{1};
352 template <
typename _ToDur,
typename _Rep,
typename _Period>
354 __and_<__is_duration<_ToDur>,
355 __not_<treat_as_floating_point<typename _ToDur::rep>>>::value,
357 round(
const duration<_Rep, _Period>& __d)
359 _ToDur __t0 = chrono::floor<_ToDur>(__d);
360 _ToDur __t1 = __t0 + _ToDur{1};
361 auto __diff0 = __d - __t0;
362 auto __diff1 = __t1 - __d;
363 if (__diff0 == __diff1)
365 if (__t0.count() & 1)
369 else if (__diff0 < __diff1)
374 template<
typename _Rep,
typename _Period>
376 enable_if_t<numeric_limits<_Rep>::is_signed, duration<_Rep, _Period>>
377 abs(duration<_Rep, _Period> __d)
379 if (__d >= __d.zero())
385 namespace __detail {
using chrono::ceil; }
394 template<
typename _Tp,
typename _Up>
396 __ceil_impl(
const _Tp& __t,
const _Up& __u)
398 return (__t < __u) ? (__t + _Tp{1}) : __t;
402 template<
typename _ToDur,
typename _Rep,
typename _Period>
404 ceil(
const duration<_Rep, _Period>& __d)
406 return __detail::__ceil_impl(chrono::duration_cast<_ToDur>(__d), __d);
412 template<
typename _Rep>
415 static constexpr _Rep
419 static constexpr _Rep
423 static constexpr _Rep
430 template<
typename _Tp>
435 template<
intmax_t _Num,
intmax_t _Den>
436 struct __is_ratio<
ratio<_Num, _Den>>
442 template<
typename _Rep,
typename _Period>
446 template<
typename _Rep2>
449 static constexpr intmax_t
450 _S_gcd(intmax_t __m, intmax_t __n) noexcept
454 #if __cplusplus >= 201402L
457 intmax_t __rem = __m % __n;
466 return (__n == 0) ? __m : _S_gcd(__n, __m % __n);
474 template<
typename _R1,
typename _R2,
475 intmax_t __gcd1 = _S_gcd(_R1::num, _R2::num),
476 intmax_t __gcd2 = _S_gcd(_R1::den, _R2::den)>
477 using __divide =
ratio<(_R1::num / __gcd1) * (_R2::den / __gcd2),
478 (_R1::den / __gcd2) * (_R2::num / __gcd1)>;
481 template<
typename _Period2>
483 = __bool_constant<__divide<_Period2, _Period>::den == 1>;
488 using period =
typename _Period::type;
490 static_assert(!__is_duration<_Rep>::value,
"rep cannot be a duration");
491 static_assert(__is_ratio<_Period>::value,
492 "period must be a specialization of ratio");
493 static_assert(_Period::num > 0,
"period must be positive");
502 template<
typename _Rep2,
typename = _Require<
504 __or_<__is_float<rep>, __not_<__is_float<_Rep2>>>>>
505 constexpr
explicit duration(
const _Rep2& __rep)
506 : __r(
static_cast<rep
>(__rep)) { }
508 template<
typename _Rep2,
typename _Period2,
typename = _Require<
510 __or_<__is_float<rep>,
511 __and_<__is_harmonic<_Period2>,
512 __not_<__is_float<_Rep2>>>>>>
514 : __r(duration_cast<duration>(__d).count()) { }
571 operator*=(
const rep& __rhs)
578 operator/=(
const rep& __rhs)
585 template<
typename _Rep2 = rep>
589 operator%=(
const rep& __rhs)
595 template<
typename _Rep2 = rep>
626 template<
typename _Rep1,
typename _Period1,
627 typename _Rep2,
typename _Period2>
636 return __cd(__cd(__lhs).count() + __cd(__rhs).count());
640 template<
typename _Rep1,
typename _Period1,
641 typename _Rep2,
typename _Period2>
650 return __cd(__cd(__lhs).count() - __cd(__rhs).count());
661 template<
typename _Rep1,
typename _Rep2,
663 using __common_rep_t =
typename
673 template<
typename _Rep1,
typename _Period,
typename _Rep2>
674 constexpr duration<__common_rep_t<_Rep1, _Rep2>, _Period>
679 return __cd(__cd(__d).count() * __s);
682 template<
typename _Rep1,
typename _Rep2,
typename _Period>
685 {
return __d * __s; }
687 template<
typename _Rep1,
typename _Period,
typename _Rep2>
689 duration<__common_rep_t<_Rep1, __disable_if_is_duration<_Rep2>>, _Period>
694 return __cd(__cd(__d).count() / __s);
697 template<
typename _Rep1,
typename _Period1,
698 typename _Rep2,
typename _Period2>
706 return __cd(__lhs).count() / __cd(__rhs).count();
710 template<
typename _Rep1,
typename _Period,
typename _Rep2>
712 duration<__common_rep_t<_Rep1, __disable_if_is_duration<_Rep2>>, _Period>
717 return __cd(__cd(__d).count() % __s);
720 template<
typename _Rep1,
typename _Period1,
721 typename _Rep2,
typename _Period2>
723 duration<_Rep2, _Period2>>::type
730 return __cd(__cd(__lhs).count() % __cd(__rhs).count());
741 template<
typename _Rep1,
typename _Period1,
742 typename _Rep2,
typename _Period2>
750 return __ct(__lhs).count() == __ct(__rhs).count();
753 template<
typename _Rep1,
typename _Period1,
754 typename _Rep2,
typename _Period2>
762 return __ct(__lhs).count() < __ct(__rhs).count();
765 #if __cpp_lib_three_way_comparison
766 template<
typename _Rep1,
typename _Period1,
767 typename _Rep2,
typename _Period2>
768 requires three_way_comparable<common_type_t<_Rep1, _Rep2>>
770 operator<=>(
const duration<_Rep1, _Period1>& __lhs,
771 const duration<_Rep2, _Period2>& __rhs)
774 duration<_Rep2, _Period2>>;
775 return __ct(__lhs).count() <=> __ct(__rhs).count();
778 template<
typename _Rep1,
typename _Period1,
779 typename _Rep2,
typename _Period2>
783 {
return !(__lhs == __rhs); }
786 template<
typename _Rep1,
typename _Period1,
787 typename _Rep2,
typename _Period2>
791 {
return !(__rhs < __lhs); }
793 template<
typename _Rep1,
typename _Period1,
794 typename _Rep2,
typename _Period2>
798 {
return __rhs < __lhs; }
800 template<
typename _Rep1,
typename _Period1,
801 typename _Rep2,
typename _Period2>
805 {
return !(__lhs < __rhs); }
810 #ifdef _GLIBCXX_USE_C99_STDINT_TR1
811 # define _GLIBCXX_CHRONO_INT64_T int64_t
812 #elif defined __INT64_TYPE__
813 # define _GLIBCXX_CHRONO_INT64_T __INT64_TYPE__
816 "Representation type for nanoseconds must have at least 64 bits");
817 # define _GLIBCXX_CHRONO_INT64_T long long
839 #if __cplusplus > 201703L
853 #undef _GLIBCXX_CHRONO_INT64_T
855 template<
typename _Clock,
typename _Dur>
858 static_assert(__is_duration<_Dur>::value,
859 "duration must be a specialization of std::chrono::duration");
861 typedef _Clock clock;
862 typedef _Dur duration;
863 typedef typename duration::rep rep;
864 typedef typename duration::period period;
866 constexpr
time_point() : __d(duration::zero())
869 constexpr
explicit time_point(
const duration& __dur)
874 template<
typename _Dur2,
875 typename = _Require<is_convertible<_Dur2, _Dur>>>
877 : __d(__t.time_since_epoch())
882 time_since_epoch()
const
885 #if __cplusplus > 201703L
911 operator+=(
const duration& __dur)
918 operator-=(
const duration& __dur)
938 template<
typename _ToDur,
typename _Clock,
typename _Dur>
944 return __time_point(duration_cast<_ToDur>(__t.time_since_epoch()));
947 #if __cplusplus > 201402L
948 template<
typename _ToDur,
typename _Clock,
typename _Dur>
951 floor(
const time_point<_Clock, _Dur>& __tp)
953 return time_point<_Clock, _ToDur>{
954 chrono::floor<_ToDur>(__tp.time_since_epoch())};
957 template<
typename _ToDur,
typename _Clock,
typename _Dur>
959 enable_if_t<__is_duration<_ToDur>::value, time_point<_Clock, _ToDur>>
960 ceil(
const time_point<_Clock, _Dur>& __tp)
962 return time_point<_Clock, _ToDur>{
963 chrono::ceil<_ToDur>(__tp.time_since_epoch())};
966 template<
typename _ToDur,
typename _Clock,
typename _Dur>
968 __and_<__is_duration<_ToDur>,
969 __not_<treat_as_floating_point<typename _ToDur::rep>>>::value,
970 time_point<_Clock, _ToDur>>
971 round(
const time_point<_Clock, _Dur>& __tp)
973 return time_point<_Clock, _ToDur>{
974 chrono::round<_ToDur>(__tp.time_since_epoch())};
982 template<
typename _Clock,
typename _Dur1,
983 typename _Rep2,
typename _Period2>
984 constexpr time_point<_Clock,
985 typename common_type<_Dur1, duration<_Rep2, _Period2>>::type>
987 const duration<_Rep2, _Period2>& __rhs)
989 typedef duration<_Rep2, _Period2> __dur2;
992 return __time_point(__lhs.time_since_epoch() + __rhs);
996 template<
typename _Rep1,
typename _Period1,
997 typename _Clock,
typename _Dur2>
1006 return __time_point(__rhs.time_since_epoch() + __lhs);
1010 template<
typename _Clock,
typename _Dur1,
1011 typename _Rep2,
typename _Period2>
1012 constexpr time_point<_Clock,
1020 return __time_point(__lhs.time_since_epoch() -__rhs);
1024 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1028 {
return __lhs.time_since_epoch() - __rhs.time_since_epoch(); }
1036 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1038 operator==(
const time_point<_Clock, _Dur1>& __lhs,
1039 const time_point<_Clock, _Dur2>& __rhs)
1040 {
return __lhs.time_since_epoch() == __rhs.time_since_epoch(); }
1042 #if __cpp_lib_three_way_comparison
1043 template<
typename _Clock,
typename _Dur1,
1044 three_way_comparable_with<_Dur1> _Dur2>
1046 operator<=>(
const time_point<_Clock, _Dur1>& __lhs,
1047 const time_point<_Clock, _Dur2>& __rhs)
1048 {
return __lhs.time_since_epoch() <=> __rhs.time_since_epoch(); }
1050 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1052 operator!=(
const time_point<_Clock, _Dur1>& __lhs,
1053 const time_point<_Clock, _Dur2>& __rhs)
1054 {
return !(__lhs == __rhs); }
1057 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1059 operator<(
const time_point<_Clock, _Dur1>& __lhs,
1060 const time_point<_Clock, _Dur2>& __rhs)
1061 {
return __lhs.time_since_epoch() < __rhs.time_since_epoch(); }
1063 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1065 operator<=(
const time_point<_Clock, _Dur1>& __lhs,
1066 const time_point<_Clock, _Dur2>& __rhs)
1067 {
return !(__rhs < __lhs); }
1069 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1071 operator>(
const time_point<_Clock, _Dur1>& __lhs,
1072 const time_point<_Clock, _Dur2>& __rhs)
1073 {
return __rhs < __lhs; }
1075 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1077 operator>=(
const time_point<_Clock, _Dur1>& __lhs,
1078 const time_point<_Clock, _Dur2>& __rhs)
1079 {
return !(__lhs < __rhs); }
1102 inline namespace _V2 {
1113 typedef duration::rep rep;
1114 typedef duration::period period;
1117 static_assert(system_clock::duration::min()
1118 < system_clock::duration::zero(),
1119 "a clock's minimum duration cannot be less than its epoch");
1121 static constexpr
bool is_steady =
false;
1130 return std::time_t(duration_cast<chrono::seconds>
1131 (__t.time_since_epoch()).count());
1135 from_time_t(std::time_t __t) noexcept
1138 return time_point_cast<system_clock::duration>
1153 typedef duration::rep rep;
1154 typedef duration::period period;
1157 static constexpr
bool is_steady =
true;
1176 #if __cplusplus >= 202002L
1179 template<
typename _Duration>
1184 using file_clock = ::std::filesystem::__file_clock;
1186 template<
typename _Duration>
1190 template<>
struct is_clock<steady_clock> :
true_type { };
1191 template<>
struct is_clock<file_clock> :
true_type { };
1193 template<>
inline constexpr
bool is_clock_v<system_clock> =
true;
1194 template<>
inline constexpr
bool is_clock_v<steady_clock> =
true;
1195 template<>
inline constexpr
bool is_clock_v<file_clock> =
true;
1200 #if __cplusplus >= 201402L
1201 #define __cpp_lib_chrono_udls 201304L
1203 inline namespace literals
1229 inline namespace chrono_literals
1234 #pragma GCC diagnostic push
1235 #pragma GCC diagnostic ignored "-Wliteral-suffix"
1237 template<
typename _Dur,
char... _Digits>
1238 constexpr _Dur __check_overflow()
1240 using _Val = __parse_int::_Parse_int<_Digits...>;
1241 constexpr
typename _Dur::rep __repval = _Val::value;
1242 static_assert(__repval >= 0 && __repval == _Val::value,
1243 "literal value cannot be represented by duration type");
1244 return _Dur(__repval);
1249 constexpr chrono::duration<long double, ratio<3600,1>>
1250 operator""h(
long double __hours)
1254 template <
char... _Digits>
1261 operator""min(
long double __mins)
1265 template <
char... _Digits>
1272 operator""s(
long double __secs)
1276 template <
char... _Digits>
1283 operator""ms(
long double __msecs)
1287 template <
char... _Digits>
1294 operator""us(
long double __usecs)
1298 template <
char... _Digits>
1305 operator""ns(
long double __nsecs)
1309 template <
char... _Digits>
1314 #pragma GCC diagnostic pop
1321 using namespace literals::chrono_literals;
1325 #if __cplusplus >= 201703L
1326 namespace filesystem
1331 using rep = duration::rep;
1332 using period = duration::period;
1333 using time_point = chrono::time_point<__file_clock>;
1334 static constexpr
bool is_steady =
false;
1338 {
return _S_from_sys(chrono::system_clock::now()); }
1340 #if __cplusplus > 201703L
1341 template<
typename _Dur>
1343 chrono::file_time<_Dur>
1344 from_sys(
const chrono::sys_time<_Dur>& __t) noexcept
1345 {
return _S_from_sys(__t); }
1348 template<
typename _Dur>
1350 chrono::sys_time<_Dur>
1351 to_sys(
const chrono::file_time<_Dur>& __t) noexcept
1352 {
return _S_to_sys(__t); }
1356 using __sys_clock = chrono::system_clock;
1365 template<
typename _Dur>
1367 chrono::time_point<__file_clock, _Dur>
1368 _S_from_sys(
const chrono::time_point<__sys_clock, _Dur>& __t) noexcept
1370 using __file_time = chrono::time_point<__file_clock, _Dur>;
1371 return __file_time{__t.time_since_epoch()} - _S_epoch_diff;
1375 template<
typename _Dur>
1377 chrono::time_point<__sys_clock, _Dur>
1378 _S_to_sys(
const chrono::time_point<__file_clock, _Dur>& __t) noexcept
1380 using __sys_time = chrono::time_point<__sys_clock, _Dur>;
1381 return __sys_time{__t.time_since_epoch()} + _S_epoch_diff;
1387 _GLIBCXX_END_NAMESPACE_VERSION
constexpr duration< __common_rep_t< _Rep1, __disable_if_is_duration< _Rep2 > >, _Period > operator%(const duration< _Rep1, _Period > &__d, const _Rep2 &__s)
constexpr bool operator==(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
duration< int64_t > seconds
seconds
constexpr enable_if< __is_duration< _ToDur >::value, time_point< _Clock, _ToDur > >::type time_point_cast(const time_point< _Clock, _Dur > &__t)
time_point_cast
constexpr bool operator<=(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
duration< int64_t, ratio< 3600 > > hours
hours
duration< int64_t, milli > milliseconds
milliseconds
constexpr __enable_if_is_duration< _ToDur > duration_cast(const duration< _Rep, _Period > &__d)
duration_cast
duration< int64_t, micro > microseconds
microseconds
constexpr bool operator>=(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr bool operator!=(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
duration< int64_t, nano > nanoseconds
nanoseconds
constexpr time_point< _Clock, typename common_type< duration< _Rep1, _Period1 >, _Dur2 >::type > operator+(const duration< _Rep1, _Period1 > &__lhs, const time_point< _Clock, _Dur2 > &__rhs)
Adjust a time point forwards by the given duration.
constexpr time_point< _Clock, typename common_type< _Dur1, duration< _Rep2, _Period2 > >::type > operator+(const time_point< _Clock, _Dur1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr duration< __common_rep_t< _Rep2, _Rep1 >, _Period > operator*(const _Rep1 &__s, const duration< _Rep2, _Period > &__d)
constexpr common_type< duration< _Rep1, _Period1 >, duration< _Rep2, _Period2 > >::type operator-(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
The difference between two durations.
duration< int64_t, ratio< 60 > > minutes
minutes
constexpr common_type< duration< _Rep1, _Period1 >, duration< _Rep2, _Period2 > >::type operator+(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr bool operator<(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr duration< __common_rep_t< _Rep1, __disable_if_is_duration< _Rep2 > >, _Period > operator/(const duration< _Rep1, _Period > &__d, const _Rep2 &__s)
constexpr bool operator>(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr duration< __common_rep_t< _Rep1, _Rep2 >, _Period > operator*(const duration< _Rep1, _Period > &__d, const _Rep2 &__s)
_Tp abs(const complex< _Tp > &)
Return magnitude of z.
typename __ratio_divide< _R1, _R2 >::type ratio_divide
ratio_divide
void void_t
A metafunction that always yields void, used for detecting valid types.
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
typename common_type< _Tp... >::type common_type_t
Alias template for common_type.
integral_constant< bool, false > false_type
The type used as a compile-time boolean with false value.
typename enable_if< _Cond, _Tp >::type enable_if_t
Alias template for enable_if.
constexpr const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
ISO C++ entities toplevel namespace is std.
concept same_as
[concept.same], concept same_as
Properties of fundamental types.
static constexpr _Tp max() noexcept
static constexpr _Tp lowest() noexcept
Provides compile-time rational arithmetic.
Define a member typedef type only if a boolean constant is true.
chrono::duration represents a distance between two points in time
chrono::time_point represents a point in time as measured by a clock