30#ifndef _GLIBCXX_CHRONO_H
31#define _GLIBCXX_CHRONO_H 1
33#pragma GCC system_header
35#if __cplusplus >= 201103L
42#if __cplusplus >= 202002L
47namespace 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;
259 template<
typename _ToDur,
typename _Rep,
typename _Period>
261 constexpr __enable_if_is_duration<_ToDur>
264 typedef typename _ToDur::period __to_period;
265 typedef typename _ToDur::rep __to_rep;
268 typedef __duration_cast_impl<_ToDur, __cf, __cr,
269 __cf::num == 1, __cf::den == 1> __dc;
270 return __dc::__cast(__d);
284 template<
typename _Rep>
289#if __cplusplus > 201402L
290 template <
typename _Rep>
291 inline constexpr bool treat_as_floating_point_v =
295#if __cplusplus > 201703L
296#if __cpp_lib_concepts
297 template<
typename _Tp>
298 inline constexpr bool is_clock_v =
false;
300 template<
typename _Tp>
303 typename _Tp::period;
304 typename _Tp::duration;
305 typename _Tp::time_point::clock;
306 typename _Tp::time_point::duration;
308 { _Tp::now() } -> same_as<typename _Tp::time_point>;
309 requires same_as<
typename _Tp::duration,
310 duration<typename _Tp::rep, typename _Tp::period>>;
311 requires same_as<
typename _Tp::time_point::duration,
312 typename _Tp::duration>;
314 inline constexpr bool is_clock_v<_Tp> =
true;
316 template<
typename _Tp,
typename =
void>
317 inline constexpr bool is_clock_v =
false;
319 template<
typename _Tp>
320 inline constexpr bool
321 is_clock_v<_Tp,
void_t<
typename _Tp::rep,
typename _Tp::period,
322 typename _Tp::duration,
323 typename _Tp::time_point::duration,
324 decltype(_Tp::is_steady),
325 decltype(_Tp::now())>>
326 = __and_v<is_same<
typename _Tp::duration,
327 duration<typename _Tp::rep, typename _Tp::period>>,
328 is_same<
typename _Tp::time_point::duration,
329 typename _Tp::duration>,
330 is_same<
decltype(&_Tp::is_steady),
const bool*>,
331 is_same<
decltype(_Tp::now()),
typename _Tp::time_point>>;
334 template<
typename _Tp>
340#if __cplusplus >= 201703L
341# define __cpp_lib_chrono 201611L
353 template<
typename _ToDur,
typename _Rep,
typename _Period>
354 [[nodiscard]]
constexpr __enable_if_is_duration<_ToDur>
357 auto __to = chrono::duration_cast<_ToDur>(__d);
359 return __to - _ToDur{1};
373 template<
typename _ToDur,
typename _Rep,
typename _Period>
374 [[nodiscard]]
constexpr __enable_if_is_duration<_ToDur>
377 auto __to = chrono::duration_cast<_ToDur>(__d);
379 return __to + _ToDur{1};
394 template <
typename _ToDur,
typename _Rep,
typename _Period>
395 [[nodiscard]]
constexpr
397 __and_<__is_duration<_ToDur>,
398 __not_<treat_as_floating_point<typename _ToDur::rep>>>::value,
402 _ToDur __t0 = chrono::floor<_ToDur>(__d);
403 _ToDur __t1 = __t0 + _ToDur{1};
404 auto __diff0 = __d - __t0;
405 auto __diff1 = __t1 - __d;
406 if (__diff0 == __diff1)
408 if (__t0.count() & 1)
412 else if (__diff0 < __diff1)
423 template<
typename _Rep,
typename _Period>
424 [[nodiscard]]
constexpr
428 if (__d >= __d.zero())
443 template<
typename _Tp,
typename _Up>
445 __ceil_impl(
const _Tp& __t,
const _Up& __u)
447 return (__t < __u) ? (__t + _Tp{1}) : __t;
451 template<
typename _ToDur,
typename _Rep,
typename _Period>
453 ceil(
const duration<_Rep, _Period>& __d)
455 return __detail::__ceil_impl(chrono::duration_cast<_ToDur>(__d), __d);
461 template<
typename _Rep>
464 static constexpr _Rep
468 static constexpr _Rep
472 static constexpr _Rep
479 template<
typename _Tp>
484 template<
intmax_t _Num,
intmax_t _Den>
485 struct __is_ratio<
ratio<_Num, _Den>>
491 template<
typename _Rep,
typename _Period>
494 static_assert(!__is_duration<_Rep>::value,
"rep cannot be a duration");
495 static_assert(__is_ratio<_Period>::value,
496 "period must be a specialization of ratio");
497 static_assert(_Period::num > 0,
"period must be positive");
499 template<
typename _Rep2>
502 static constexpr intmax_t
503 _S_gcd(intmax_t __m, intmax_t __n)
noexcept
507#if __cplusplus >= 201402L
510 intmax_t __rem = __m % __n;
519 return (__n == 0) ? __m : _S_gcd(__n, __m % __n);
527 template<
typename _R1,
typename _R2,
528 intmax_t __gcd1 = _S_gcd(_R1::num, _R2::num),
529 intmax_t __gcd2 = _S_gcd(_R1::den, _R2::den)>
530 using __divide =
ratio<(_R1::num / __gcd1) * (_R2::den / __gcd2),
531 (_R1::den / __gcd2) * (_R2::num / __gcd1)>;
534 template<
typename _Period2>
536 = __bool_constant<__divide<_Period2, _Period>::den == 1>;
541 using period =
typename _Period::type;
550 template<
typename _Rep2,
typename = _Require<
551 is_convertible<const _Rep2&, rep>,
552 __or_<__is_float<rep>, __not_<__is_float<_Rep2>>>>>
553 constexpr explicit duration(
const _Rep2& __rep)
554 : __r(
static_cast<rep
>(__rep)) { }
556 template<
typename _Rep2,
typename _Period2,
typename = _Require<
557 is_convertible<const _Rep2&, rep>,
558 __or_<__is_float<rep>,
559 __and_<__is_harmonic<_Period2>,
560 __not_<__is_float<_Rep2>>>>>>
562 : __r(duration_cast<duration>(__d).count()) { }
619 operator*=(
const rep& __rhs)
626 operator/=(
const rep& __rhs)
633 template<
typename _Rep2 = rep>
637 operator%=(
const rep& __rhs)
643 template<
typename _Rep2 = rep>
674 template<
typename _Rep1,
typename _Period1,
675 typename _Rep2,
typename _Period2>
684 return __cd(__cd(__lhs).count() + __cd(__rhs).count());
688 template<
typename _Rep1,
typename _Period1,
689 typename _Rep2,
typename _Period2>
698 return __cd(__cd(__lhs).count() - __cd(__rhs).count());
709 template<
typename _Rep1,
typename _Rep2,
711 using __common_rep_t =
typename
721 template<
typename _Rep1,
typename _Period,
typename _Rep2>
722 constexpr duration<__common_rep_t<_Rep1, _Rep2>, _Period>
727 return __cd(__cd(__d).count() * __s);
730 template<
typename _Rep1,
typename _Rep2,
typename _Period>
733 {
return __d * __s; }
735 template<
typename _Rep1,
typename _Period,
typename _Rep2>
737 duration<__common_rep_t<_Rep1, __disable_if_is_duration<_Rep2>>, _Period>
742 return __cd(__cd(__d).count() / __s);
745 template<
typename _Rep1,
typename _Period1,
746 typename _Rep2,
typename _Period2>
754 return __cd(__lhs).count() / __cd(__rhs).count();
758 template<
typename _Rep1,
typename _Period,
typename _Rep2>
760 duration<__common_rep_t<_Rep1, __disable_if_is_duration<_Rep2>>, _Period>
765 return __cd(__cd(__d).count() % __s);
768 template<
typename _Rep1,
typename _Period1,
769 typename _Rep2,
typename _Period2>
771 duration<_Rep2, _Period2>>::type
778 return __cd(__cd(__lhs).count() % __cd(__rhs).count());
789 template<
typename _Rep1,
typename _Period1,
790 typename _Rep2,
typename _Period2>
798 return __ct(__lhs).count() == __ct(__rhs).count();
801 template<
typename _Rep1,
typename _Period1,
802 typename _Rep2,
typename _Period2>
810 return __ct(__lhs).count() < __ct(__rhs).count();
813#if __cpp_lib_three_way_comparison
814 template<
typename _Rep1,
typename _Period1,
815 typename _Rep2,
typename _Period2>
816 requires three_way_comparable<common_type_t<_Rep1, _Rep2>>
818 operator<=>(
const duration<_Rep1, _Period1>& __lhs,
819 const duration<_Rep2, _Period2>& __rhs)
822 duration<_Rep2, _Period2>>;
823 return __ct(__lhs).count() <=> __ct(__rhs).count();
826 template<
typename _Rep1,
typename _Period1,
827 typename _Rep2,
typename _Period2>
831 {
return !(__lhs == __rhs); }
834 template<
typename _Rep1,
typename _Period1,
835 typename _Rep2,
typename _Period2>
839 {
return !(__rhs < __lhs); }
841 template<
typename _Rep1,
typename _Period1,
842 typename _Rep2,
typename _Period2>
846 {
return __rhs < __lhs; }
848 template<
typename _Rep1,
typename _Period1,
849 typename _Rep2,
typename _Period2>
853 {
return !(__lhs < __rhs); }
858#ifdef _GLIBCXX_USE_C99_STDINT_TR1
859# define _GLIBCXX_CHRONO_INT64_T int64_t
860#elif defined __INT64_TYPE__
861# define _GLIBCXX_CHRONO_INT64_T __INT64_TYPE__
864 "Representation type for nanoseconds must have at least 64 bits");
865# define _GLIBCXX_CHRONO_INT64_T long long
887#if __cplusplus > 201703L
901#undef _GLIBCXX_CHRONO_INT64_T
903 template<
typename _Clock,
typename _Dur>
906 static_assert(__is_duration<_Dur>::value,
907 "duration must be a specialization of std::chrono::duration");
910 typedef _Clock clock;
911 typedef _Dur duration;
912 typedef typename duration::rep rep;
913 typedef typename duration::period period;
915 constexpr time_point() : __d(duration::zero())
918 constexpr explicit time_point(
const duration& __dur)
923 template<
typename _Dur2,
924 typename = _Require<is_convertible<_Dur2, _Dur>>>
926 : __d(__t.time_since_epoch())
931 time_since_epoch()
const
934#if __cplusplus > 201703L
960 operator+=(
const duration& __dur)
967 operator-=(
const duration& __dur)
998 template<
typename _ToDur,
typename _Clock,
typename _Dur>
999 _GLIBCXX_NODISCARD
constexpr
1004 return __time_point(duration_cast<_ToDur>(__t.time_since_epoch()));
1007#if __cplusplus > 201402L
1020 template<
typename _ToDur,
typename _Clock,
typename _Dur>
1021 [[nodiscard]]
constexpr
1026 chrono::floor<_ToDur>(__tp.time_since_epoch())};
1041 template<
typename _ToDur,
typename _Clock,
typename _Dur>
1042 [[nodiscard]]
constexpr
1047 chrono::ceil<_ToDur>(__tp.time_since_epoch())};
1063 template<
typename _ToDur,
typename _Clock,
typename _Dur>
1064 [[nodiscard]]
constexpr
1066 __and_<__is_duration<_ToDur>,
1067 __not_<treat_as_floating_point<typename _ToDur::rep>>>::value,
1068 time_point<_Clock, _ToDur>>
1072 chrono::round<_ToDur>(__tp.time_since_epoch())};
1080 template<
typename _Clock,
typename _Dur1,
1081 typename _Rep2,
typename _Period2>
1082 constexpr time_point<_Clock,
1085 const duration<_Rep2, _Period2>& __rhs)
1087 typedef duration<_Rep2, _Period2> __dur2;
1090 return __time_point(__lhs.time_since_epoch() + __rhs);
1094 template<
typename _Rep1,
typename _Period1,
1095 typename _Clock,
typename _Dur2>
1104 return __time_point(__rhs.time_since_epoch() + __lhs);
1108 template<
typename _Clock,
typename _Dur1,
1109 typename _Rep2,
typename _Period2>
1110 constexpr time_point<_Clock,
1118 return __time_point(__lhs.time_since_epoch() -__rhs);
1122 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1126 {
return __lhs.time_since_epoch() - __rhs.time_since_epoch(); }
1134 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1136 operator==(
const time_point<_Clock, _Dur1>& __lhs,
1137 const time_point<_Clock, _Dur2>& __rhs)
1138 {
return __lhs.time_since_epoch() == __rhs.time_since_epoch(); }
1140#if __cpp_lib_three_way_comparison
1141 template<
typename _Clock,
typename _Dur1,
1142 three_way_comparable_with<_Dur1> _Dur2>
1144 operator<=>(
const time_point<_Clock, _Dur1>& __lhs,
1145 const time_point<_Clock, _Dur2>& __rhs)
1146 {
return __lhs.time_since_epoch() <=> __rhs.time_since_epoch(); }
1148 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1150 operator!=(
const time_point<_Clock, _Dur1>& __lhs,
1151 const time_point<_Clock, _Dur2>& __rhs)
1152 {
return !(__lhs == __rhs); }
1155 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1157 operator<(
const time_point<_Clock, _Dur1>& __lhs,
1158 const time_point<_Clock, _Dur2>& __rhs)
1159 {
return __lhs.time_since_epoch() < __rhs.time_since_epoch(); }
1161 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1163 operator<=(
const time_point<_Clock, _Dur1>& __lhs,
1164 const time_point<_Clock, _Dur2>& __rhs)
1165 {
return !(__rhs < __lhs); }
1167 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1169 operator>(
const time_point<_Clock, _Dur1>& __lhs,
1170 const time_point<_Clock, _Dur2>& __rhs)
1171 {
return __rhs < __lhs; }
1173 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1175 operator>=(
const time_point<_Clock, _Dur1>& __lhs,
1176 const time_point<_Clock, _Dur2>& __rhs)
1177 {
return !(__lhs < __rhs); }
1200_GLIBCXX_BEGIN_INLINE_ABI_NAMESPACE(_V2)
1211 typedef duration::rep rep;
1212 typedef duration::period period;
1215 static_assert(system_clock::duration::min()
1216 < system_clock::duration::zero(),
1217 "a clock's minimum duration cannot be less than its epoch");
1219 static constexpr bool is_steady =
false;
1228 return std::time_t(duration_cast<chrono::seconds>
1229 (__t.time_since_epoch()).count());
1233 from_time_t(std::time_t __t)
noexcept
1236 return time_point_cast<system_clock::duration>
1251 typedef duration::rep rep;
1252 typedef duration::period period;
1255 static constexpr bool is_steady =
true;
1272_GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2)
1274#if __cplusplus >= 202002L
1277 template<
typename _Duration>
1282 using file_clock = ::std::filesystem::__file_clock;
1284 template<
typename _Duration>
1288 template<>
struct is_clock<steady_clock> :
true_type { };
1289 template<>
struct is_clock<file_clock> :
true_type { };
1291 template<>
inline constexpr bool is_clock_v<system_clock> =
true;
1292 template<>
inline constexpr bool is_clock_v<steady_clock> =
true;
1293 template<>
inline constexpr bool is_clock_v<file_clock> =
true;
1298#if __cplusplus >= 201402L
1299#define __cpp_lib_chrono_udls 201304L
1301 inline namespace literals
1327 inline namespace chrono_literals
1332#pragma GCC diagnostic push
1333#pragma GCC diagnostic ignored "-Wliteral-suffix"
1335 template<
typename _Dur,
char... _Digits>
1336 constexpr _Dur __check_overflow()
1338 using _Val = __parse_int::_Parse_int<_Digits...>;
1339 constexpr typename _Dur::rep __repval = _Val::value;
1340 static_assert(__repval >= 0 && __repval == _Val::value,
1341 "literal value cannot be represented by duration type");
1342 return _Dur(__repval);
1347 constexpr chrono::duration<long double, ratio<3600,1>>
1348 operator""h(
long double __hours)
1352 template <
char... _Digits>
1359 operator""min(
long double __mins)
1363 template <
char... _Digits>
1370 operator""s(
long double __secs)
1374 template <
char... _Digits>
1381 operator""ms(
long double __msecs)
1385 template <
char... _Digits>
1392 operator""us(
long double __usecs)
1396 template <
char... _Digits>
1403 operator""ns(
long double __nsecs)
1407 template <
char... _Digits>
1412#pragma GCC diagnostic pop
1419 using namespace literals::chrono_literals;
1423#if __cplusplus >= 201703L
1424 namespace filesystem
1429 using rep = duration::rep;
1430 using period = duration::period;
1431 using time_point = chrono::time_point<__file_clock>;
1432 static constexpr bool is_steady =
false;
1436 {
return _S_from_sys(chrono::system_clock::now()); }
1438#if __cplusplus > 201703L
1439 template<
typename _Dur>
1441 chrono::file_time<_Dur>
1442 from_sys(
const chrono::sys_time<_Dur>& __t)
noexcept
1443 {
return _S_from_sys(__t); }
1446 template<
typename _Dur>
1448 chrono::sys_time<_Dur>
1449 to_sys(
const chrono::file_time<_Dur>& __t)
noexcept
1450 {
return _S_to_sys(__t); }
1454 using __sys_clock = chrono::system_clock;
1463 template<
typename _Dur>
1465 chrono::time_point<__file_clock, _Dur>
1466 _S_from_sys(
const chrono::time_point<__sys_clock, _Dur>& __t)
noexcept
1468 using __file_time = chrono::time_point<__file_clock, _Dur>;
1469 return __file_time{__t.time_since_epoch()} - _S_epoch_diff;
1473 template<
typename _Dur>
1475 chrono::time_point<__sys_clock, _Dur>
1476 _S_to_sys(
const chrono::time_point<__file_clock, _Dur>& __t)
noexcept
1478 using __sys_time = chrono::time_point<__sys_clock, _Dur>;
1479 return __sys_time{__t.time_since_epoch()} + _S_epoch_diff;
1485_GLIBCXX_END_NAMESPACE_VERSION
constexpr bool operator==(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr __enable_if_is_duration< _ToDur > floor(const duration< _Rep, _Period > &__d)
duration< int64_t > seconds
seconds
constexpr enable_if_t< __and_< __is_duration< _ToDur >, __not_< treat_as_floating_point< typename _ToDur::rep > > >::value, _ToDur > round(const duration< _Rep, _Period > &__d)
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
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)
constexpr duration< __common_rep_t< _Rep2, _Rep1 >, _Period > operator*(const _Rep1 &__s, const duration< _Rep2, _Period > &__d)
duration< int64_t, nano > nanoseconds
nanoseconds
constexpr enable_if_t< numeric_limits< _Rep >::is_signed, duration< _Rep, _Period > > abs(duration< _Rep, _Period > __d)
constexpr duration< __common_rep_t< _Rep1, __disable_if_is_duration< _Rep2 > >, _Period > operator%(const duration< _Rep1, _Period > &__d, const _Rep2 &__s)
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 __enable_if_t< __is_duration< _ToDur >::value, time_point< _Clock, _ToDur > > time_point_cast(const time_point< _Clock, _Dur > &__t)
duration< int64_t, ratio< 60 > > minutes
minutes
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 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 bool operator>(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
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.
constexpr duration< __common_rep_t< _Rep1, __disable_if_is_duration< _Rep2 > >, _Period > operator/(const duration< _Rep1, _Period > &__d, const _Rep2 &__s)
constexpr duration< __common_rep_t< _Rep1, _Rep2 >, _Period > operator*(const duration< _Rep1, _Period > &__d, const _Rep2 &__s)
constexpr __enable_if_is_duration< _ToDur > ceil(const duration< _Rep, _Period > &__d)
constexpr __enable_if_is_duration< _ToDur > duration_cast(const duration< _Rep, _Period > &__d)
typename __ratio_divide< _R1, _R2 >::type ratio_divide
ratio_divide
integral_constant< bool, __v > bool_constant
Alias template for compile-time boolean constant types.
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.
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.
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
[concept.same], concept same_as