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;
247#if __cplusplus >= 201703L
248 template<
typename _Tp>
249 inline constexpr bool __is_duration_v =
false;
250 template<
typename _Rep,
typename _Period>
251 inline constexpr bool __is_duration_v<duration<_Rep, _Period>> =
true;
252 template<
typename _Tp>
253 inline constexpr bool __is_time_point_v =
false;
254 template<
typename _Clock,
typename _Dur>
255 inline constexpr bool __is_time_point_v<time_point<_Clock, _Dur>> =
true;
270 template<
typename _ToDur,
typename _Rep,
typename _Period>
272 constexpr __enable_if_is_duration<_ToDur>
275#if __cpp_inline_variables && __cpp_if_constexpr
276 if constexpr (is_same_v<_ToDur, duration<_Rep, _Period>>)
281 using __to_period =
typename _ToDur::period;
282 using __to_rep =
typename _ToDur::rep;
285 using __dc = __duration_cast_impl<_ToDur, __cf, __cr,
286 __cf::num == 1, __cf::den == 1>;
287 return __dc::__cast(__d);
302 template<
typename _Rep>
307#if __cplusplus > 201402L
308 template <
typename _Rep>
309 inline constexpr bool treat_as_floating_point_v =
313 inline constexpr bool treat_as_floating_point_v<int> =
false;
315 inline constexpr bool treat_as_floating_point_v<long> =
false;
317 inline constexpr bool treat_as_floating_point_v<long long> =
false;
319 inline constexpr bool treat_as_floating_point_v<float> =
true;
321 inline constexpr bool treat_as_floating_point_v<double> =
true;
323 inline constexpr bool treat_as_floating_point_v<long double> =
true;
326#if __cplusplus > 201703L
327#if __cpp_lib_concepts
328 template<
typename _Tp>
329 inline constexpr bool is_clock_v =
false;
331 template<
typename _Tp>
334 typename _Tp::period;
335 typename _Tp::duration;
336 typename _Tp::time_point::clock;
337 typename _Tp::time_point::duration;
339 { _Tp::now() } -> same_as<typename _Tp::time_point>;
340 requires same_as<
typename _Tp::duration,
341 duration<typename _Tp::rep, typename _Tp::period>>;
342 requires same_as<
typename _Tp::time_point::duration,
343 typename _Tp::duration>;
345 inline constexpr bool is_clock_v<_Tp> =
true;
347 template<
typename _Tp,
typename =
void>
348 inline constexpr bool is_clock_v =
false;
350 template<
typename _Tp>
351 inline constexpr bool
352 is_clock_v<_Tp,
void_t<
typename _Tp::rep,
typename _Tp::period,
353 typename _Tp::duration,
354 typename _Tp::time_point::duration,
355 decltype(_Tp::is_steady),
356 decltype(_Tp::now())>>
357 = __and_v<is_same<
typename _Tp::duration,
358 duration<typename _Tp::rep, typename _Tp::period>>,
359 is_same<
typename _Tp::time_point::duration,
360 typename _Tp::duration>,
361 is_same<
decltype(&_Tp::is_steady),
const bool*>,
362 is_same<
decltype(_Tp::now()),
typename _Tp::time_point>>;
365 template<
typename _Tp>
371#if __cplusplus >= 201703L
372# define __cpp_lib_chrono 201611L
384 template<
typename _ToDur,
typename _Rep,
typename _Period>
385 [[nodiscard]]
constexpr __enable_if_is_duration<_ToDur>
388 auto __to = chrono::duration_cast<_ToDur>(__d);
390 return __to - _ToDur{1};
404 template<
typename _ToDur,
typename _Rep,
typename _Period>
405 [[nodiscard]]
constexpr __enable_if_is_duration<_ToDur>
408 auto __to = chrono::duration_cast<_ToDur>(__d);
410 return __to + _ToDur{1};
425 template <
typename _ToDur,
typename _Rep,
typename _Period>
426 [[nodiscard]]
constexpr
428 __and_<__is_duration<_ToDur>,
429 __not_<treat_as_floating_point<typename _ToDur::rep>>>::value,
433 _ToDur __t0 = chrono::floor<_ToDur>(__d);
434 _ToDur __t1 = __t0 + _ToDur{1};
435 auto __diff0 = __d - __t0;
436 auto __diff1 = __t1 - __d;
437 if (__diff0 == __diff1)
439 if (__t0.count() & 1)
443 else if (__diff0 < __diff1)
454 template<
typename _Rep,
typename _Period>
455 [[nodiscard]]
constexpr
459 if (__d >= __d.zero())
474 template<
typename _Tp,
typename _Up>
476 __ceil_impl(
const _Tp& __t,
const _Up& __u)
478 return (__t < __u) ? (__t + _Tp{1}) : __t;
482 template<
typename _ToDur,
typename _Rep,
typename _Period>
484 ceil(
const duration<_Rep, _Period>& __d)
486 return __detail::__ceil_impl(chrono::duration_cast<_ToDur>(__d), __d);
492 template<
typename _Rep>
495 static constexpr _Rep
499 static constexpr _Rep
503 static constexpr _Rep
508 template<
typename _Rep,
typename _Period>
511 static_assert(!__is_duration<_Rep>::value,
512 "rep cannot be a std::chrono::duration");
513 static_assert(__is_ratio<_Period>::value,
514 "period must be a specialization of std::ratio");
515 static_assert(_Period::num > 0,
"period must be positive");
517 template<
typename _Rep2>
520 static constexpr intmax_t
521 _S_gcd(intmax_t __m, intmax_t __n)
noexcept
525#if __cplusplus >= 201402L
528 intmax_t __rem = __m % __n;
537 return (__n == 0) ? __m : _S_gcd(__n, __m % __n);
545 template<
typename _R1,
typename _R2,
546 intmax_t __gcd1 = _S_gcd(_R1::num, _R2::num),
547 intmax_t __gcd2 = _S_gcd(_R1::den, _R2::den)>
548 using __divide =
ratio<(_R1::num / __gcd1) * (_R2::den / __gcd2),
549 (_R1::den / __gcd2) * (_R2::num / __gcd1)>;
552 template<
typename _Period2>
554 = __bool_constant<__divide<_Period2, _Period>::den == 1>;
559 using period =
typename _Period::type;
568 template<
typename _Rep2,
typename = _Require<
569 is_convertible<const _Rep2&, rep>,
570 __or_<__is_float<rep>, __not_<__is_float<_Rep2>>>>>
571 constexpr explicit duration(
const _Rep2& __rep)
572 : __r(
static_cast<rep
>(__rep)) { }
574 template<
typename _Rep2,
typename _Period2,
typename = _Require<
575 is_convertible<const _Rep2&, rep>,
576 __or_<__is_float<rep>,
577 __and_<__is_harmonic<_Period2>,
578 __not_<__is_float<_Rep2>>>>>>
580 : __r(duration_cast<duration>(__d).count()) { }
637 operator*=(
const rep& __rhs)
644 operator/=(
const rep& __rhs)
651 template<
typename _Rep2 = rep>
653 __enable_if_t<!treat_as_floating_point<_Rep2>::value,
duration&>
654 operator%=(
const rep& __rhs)
660 template<
typename _Rep2 = rep>
662 __enable_if_t<!treat_as_floating_point<_Rep2>::value,
duration&>
690 template<
typename _Rep1,
typename _Period1,
691 typename _Rep2,
typename _Period2>
700 return __cd(__cd(__lhs).count() + __cd(__rhs).count());
704 template<
typename _Rep1,
typename _Period1,
705 typename _Rep2,
typename _Period2>
714 return __cd(__cd(__lhs).count() - __cd(__rhs).count());
725 template<
typename _Rep1,
typename _Rep2,
727 using __common_rep_t =
typename
737 template<
typename _Rep1,
typename _Period,
typename _Rep2>
738 constexpr duration<__common_rep_t<_Rep1, _Rep2>, _Period>
743 return __cd(__cd(__d).count() * __s);
746 template<
typename _Rep1,
typename _Rep2,
typename _Period>
749 {
return __d * __s; }
751 template<
typename _Rep1,
typename _Period,
typename _Rep2>
753 duration<__common_rep_t<_Rep1, __disable_if_is_duration<_Rep2>>, _Period>
758 return __cd(__cd(__d).count() / __s);
761 template<
typename _Rep1,
typename _Period1,
762 typename _Rep2,
typename _Period2>
770 return __cd(__lhs).count() / __cd(__rhs).count();
774 template<
typename _Rep1,
typename _Period,
typename _Rep2>
776 duration<__common_rep_t<_Rep1, __disable_if_is_duration<_Rep2>>, _Period>
781 return __cd(__cd(__d).count() % __s);
784 template<
typename _Rep1,
typename _Period1,
785 typename _Rep2,
typename _Period2>
787 duration<_Rep2, _Period2>>::type
794 return __cd(__cd(__lhs).count() % __cd(__rhs).count());
805 template<
typename _Rep1,
typename _Period1,
806 typename _Rep2,
typename _Period2>
814 return __ct(__lhs).count() == __ct(__rhs).count();
817 template<
typename _Rep1,
typename _Period1,
818 typename _Rep2,
typename _Period2>
826 return __ct(__lhs).count() < __ct(__rhs).count();
829#if __cpp_lib_three_way_comparison
830 template<
typename _Rep1,
typename _Period1,
831 typename _Rep2,
typename _Period2>
832 requires three_way_comparable<common_type_t<_Rep1, _Rep2>>
834 operator<=>(
const duration<_Rep1, _Period1>& __lhs,
835 const duration<_Rep2, _Period2>& __rhs)
838 duration<_Rep2, _Period2>>;
839 return __ct(__lhs).count() <=> __ct(__rhs).count();
842 template<
typename _Rep1,
typename _Period1,
843 typename _Rep2,
typename _Period2>
847 {
return !(__lhs == __rhs); }
850 template<
typename _Rep1,
typename _Period1,
851 typename _Rep2,
typename _Period2>
855 {
return !(__rhs < __lhs); }
857 template<
typename _Rep1,
typename _Period1,
858 typename _Rep2,
typename _Period2>
862 {
return __rhs < __lhs; }
864 template<
typename _Rep1,
typename _Period1,
865 typename _Rep2,
typename _Period2>
869 {
return !(__lhs < __rhs); }
874#ifdef _GLIBCXX_USE_C99_STDINT_TR1
875# define _GLIBCXX_CHRONO_INT64_T int64_t
876#elif defined __INT64_TYPE__
877# define _GLIBCXX_CHRONO_INT64_T __INT64_TYPE__
880 "Representation type for nanoseconds must have at least 64 bits");
881# define _GLIBCXX_CHRONO_INT64_T long long
903#if __cplusplus > 201703L
917#undef _GLIBCXX_CHRONO_INT64_T
919 template<
typename _Clock,
typename _Dur>
922 static_assert(__is_duration<_Dur>::value,
923 "duration must be a specialization of std::chrono::duration");
926 typedef _Clock clock;
927 typedef _Dur duration;
928 typedef typename duration::rep rep;
929 typedef typename duration::period period;
931 constexpr time_point() : __d(duration::zero())
934 constexpr explicit time_point(
const duration& __dur)
939 template<
typename _Dur2,
940 typename = _Require<is_convertible<_Dur2, _Dur>>>
942 : __d(__t.time_since_epoch())
947 time_since_epoch()
const
950#if __cplusplus > 201703L
976 operator+=(
const duration& __dur)
983 operator-=(
const duration& __dur)
1014 template<
typename _ToDur,
typename _Clock,
typename _Dur>
1015 _GLIBCXX_NODISCARD
constexpr
1020 return __time_point(duration_cast<_ToDur>(__t.time_since_epoch()));
1023#if __cplusplus > 201402L
1036 template<
typename _ToDur,
typename _Clock,
typename _Dur>
1037 [[nodiscard]]
constexpr
1042 chrono::floor<_ToDur>(__tp.time_since_epoch())};
1057 template<
typename _ToDur,
typename _Clock,
typename _Dur>
1058 [[nodiscard]]
constexpr
1063 chrono::ceil<_ToDur>(__tp.time_since_epoch())};
1079 template<
typename _ToDur,
typename _Clock,
typename _Dur>
1080 [[nodiscard]]
constexpr
1082 && !treat_as_floating_point_v<typename _ToDur::rep>,
1083 time_point<_Clock, _ToDur>>
1087 chrono::round<_ToDur>(__tp.time_since_epoch())};
1095 template<
typename _Clock,
typename _Dur1,
1096 typename _Rep2,
typename _Period2>
1097 constexpr time_point<_Clock,
1100 const duration<_Rep2, _Period2>& __rhs)
1102 typedef duration<_Rep2, _Period2> __dur2;
1105 return __time_point(__lhs.time_since_epoch() + __rhs);
1109 template<
typename _Rep1,
typename _Period1,
1110 typename _Clock,
typename _Dur2>
1119 return __time_point(__rhs.time_since_epoch() + __lhs);
1123 template<
typename _Clock,
typename _Dur1,
1124 typename _Rep2,
typename _Period2>
1125 constexpr time_point<_Clock,
1133 return __time_point(__lhs.time_since_epoch() -__rhs);
1137 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1141 {
return __lhs.time_since_epoch() - __rhs.time_since_epoch(); }
1149 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1151 operator==(
const time_point<_Clock, _Dur1>& __lhs,
1152 const time_point<_Clock, _Dur2>& __rhs)
1153 {
return __lhs.time_since_epoch() == __rhs.time_since_epoch(); }
1155#if __cpp_lib_three_way_comparison
1156 template<
typename _Clock,
typename _Dur1,
1157 three_way_comparable_with<_Dur1> _Dur2>
1159 operator<=>(
const time_point<_Clock, _Dur1>& __lhs,
1160 const time_point<_Clock, _Dur2>& __rhs)
1161 {
return __lhs.time_since_epoch() <=> __rhs.time_since_epoch(); }
1163 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1165 operator!=(
const time_point<_Clock, _Dur1>& __lhs,
1166 const time_point<_Clock, _Dur2>& __rhs)
1167 {
return !(__lhs == __rhs); }
1170 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1172 operator<(
const time_point<_Clock, _Dur1>& __lhs,
1173 const time_point<_Clock, _Dur2>& __rhs)
1174 {
return __lhs.time_since_epoch() < __rhs.time_since_epoch(); }
1176 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1178 operator<=(
const time_point<_Clock, _Dur1>& __lhs,
1179 const time_point<_Clock, _Dur2>& __rhs)
1180 {
return !(__rhs < __lhs); }
1182 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1184 operator>(
const time_point<_Clock, _Dur1>& __lhs,
1185 const time_point<_Clock, _Dur2>& __rhs)
1186 {
return __rhs < __lhs; }
1188 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1190 operator>=(
const time_point<_Clock, _Dur1>& __lhs,
1191 const time_point<_Clock, _Dur2>& __rhs)
1192 {
return !(__lhs < __rhs); }
1215_GLIBCXX_BEGIN_INLINE_ABI_NAMESPACE(_V2)
1226 typedef duration::rep rep;
1227 typedef duration::period period;
1230 static_assert(system_clock::duration::min()
1231 < system_clock::duration::zero(),
1232 "a clock's minimum duration cannot be less than its epoch");
1234 static constexpr bool is_steady =
false;
1243 return std::time_t(duration_cast<chrono::seconds>
1244 (__t.time_since_epoch()).count());
1248 from_time_t(std::time_t __t)
noexcept
1251 return time_point_cast<system_clock::duration>
1266 typedef duration::rep rep;
1267 typedef duration::period period;
1270 static constexpr bool is_steady =
true;
1287_GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2)
1289#if __cplusplus >= 202002L
1292 template<
typename _Duration>
1297 using file_clock = ::std::filesystem::__file_clock;
1299 template<
typename _Duration>
1303 template<>
struct is_clock<steady_clock> :
true_type { };
1304 template<>
struct is_clock<file_clock> :
true_type { };
1306 template<>
inline constexpr bool is_clock_v<system_clock> =
true;
1307 template<>
inline constexpr bool is_clock_v<steady_clock> =
true;
1308 template<>
inline constexpr bool is_clock_v<file_clock> =
true;
1313#if __cplusplus >= 201402L
1314#define __cpp_lib_chrono_udls 201304L
1316 inline namespace literals
1342 inline namespace chrono_literals
1347#pragma GCC diagnostic push
1348#pragma GCC diagnostic ignored "-Wliteral-suffix"
1350 template<
typename _Dur,
char... _Digits>
1351 constexpr _Dur __check_overflow()
1353 using _Val = __parse_int::_Parse_int<_Digits...>;
1354 constexpr typename _Dur::rep __repval = _Val::value;
1355 static_assert(__repval >= 0 && __repval == _Val::value,
1356 "literal value cannot be represented by duration type");
1357 return _Dur(__repval);
1362 constexpr chrono::duration<long double, ratio<3600,1>>
1363 operator""h(
long double __hours)
1367 template <
char... _Digits>
1374 operator""min(
long double __mins)
1378 template <
char... _Digits>
1385 operator""s(
long double __secs)
1389 template <
char... _Digits>
1396 operator""ms(
long double __msecs)
1400 template <
char... _Digits>
1407 operator""us(
long double __usecs)
1411 template <
char... _Digits>
1418 operator""ns(
long double __nsecs)
1422 template <
char... _Digits>
1427#pragma GCC diagnostic pop
1434 using namespace literals::chrono_literals;
1438#if __cplusplus >= 201703L
1439 namespace filesystem
1444 using rep = duration::rep;
1445 using period = duration::period;
1446 using time_point = chrono::time_point<__file_clock>;
1447 static constexpr bool is_steady =
false;
1451 {
return _S_from_sys(chrono::system_clock::now()); }
1453#if __cplusplus > 201703L
1454 template<
typename _Dur>
1456 chrono::file_time<_Dur>
1457 from_sys(
const chrono::sys_time<_Dur>& __t)
noexcept
1458 {
return _S_from_sys(__t); }
1461 template<
typename _Dur>
1463 chrono::sys_time<_Dur>
1464 to_sys(
const chrono::file_time<_Dur>& __t)
noexcept
1465 {
return _S_to_sys(__t); }
1469 using __sys_clock = chrono::system_clock;
1478 template<
typename _Dur>
1480 chrono::time_point<__file_clock, _Dur>
1481 _S_from_sys(
const chrono::time_point<__sys_clock, _Dur>& __t)
noexcept
1483 using __file_time = chrono::time_point<__file_clock, _Dur>;
1484 return __file_time{__t.time_since_epoch()} - _S_epoch_diff;
1488 template<
typename _Dur>
1490 chrono::time_point<__sys_clock, _Dur>
1491 _S_to_sys(
const chrono::time_point<__file_clock, _Dur>& __t)
noexcept
1493 using __sys_time = chrono::time_point<__sys_clock, _Dur>;
1494 return __sys_time{__t.time_since_epoch()} + _S_epoch_diff;
1500_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