30 #ifndef _GLIBCXX_CHRONO_H 31 #define _GLIBCXX_CHRONO_H 1 33 #ifdef _GLIBCXX_SYSHDR 34 #pragma GCC system_header 37 #if __cplusplus >= 201103L 46 #if __cplusplus >= 202002L 53 namespace std _GLIBCXX_VISIBILITY(default)
55 _GLIBCXX_BEGIN_NAMESPACE_VERSION
57 #if __cplusplus >= 201703L && _GLIBCXX_HOSTED 58 namespace filesystem {
struct __file_clock; };
67 template<
typename _Rep,
typename _Period = ratio<1>>
71 template<
typename _Clock,
typename _Dur =
typename _Clock::duration>
83 template<
typename _CT,
typename _Period1,
typename _Period2,
typename =
void>
84 struct __duration_common_type
87 template<
typename _CT,
typename _Period1,
typename _Period2>
88 struct __duration_common_type<_CT, _Period1, _Period2,
89 __void_t<typename _CT::type>>
92 using __gcd_num = __static_gcd<_Period1::num, _Period2::num>;
93 using __gcd_den = __static_gcd<_Period1::den, _Period2::den>;
94 using __cr =
typename _CT::type;
95 using __r =
ratio<__gcd_num::value,
96 (_Period1::den / __gcd_den::value) * _Period2::den>;
108 template<
typename _Rep1,
typename _Period1,
typename _Rep2,
typename _Period2>
111 : __duration_common_type<common_type<_Rep1, _Rep2>,
112 typename _Period1::type,
113 typename _Period2::type>
117 template<
typename _Rep,
typename _Period>
122 typename _Period::type>;
126 template<
typename _Rep,
typename _Period>
130 typename _Period::type>;
138 template<
typename _CT,
typename _Clock,
typename =
void>
139 struct __timepoint_common_type
142 template<
typename _CT,
typename _Clock>
143 struct __timepoint_common_type<_CT, _Clock, __void_t<typename _CT::
type>>
154 template<
typename _Clock,
typename _Duration1,
typename _Duration2>
157 : __timepoint_common_type<common_type<_Duration1, _Duration2>, _Clock>
161 template<
typename _Clock,
typename _Duration>
167 template<
typename _Clock,
typename _Duration>
182 template<
typename _ToDur,
typename _CF,
typename _CR,
183 bool _NumIsOne =
false,
bool _DenIsOne =
false>
184 struct __duration_cast_impl
186 template<
typename _Rep,
typename _Period>
187 static constexpr _ToDur
188 __cast(
const duration<_Rep, _Period>& __d)
190 typedef typename _ToDur::rep __to_rep;
191 return _ToDur(static_cast<__to_rep>(static_cast<_CR>(__d.count())
192 * static_cast<_CR>(_CF::num)
193 /
static_cast<_CR
>(_CF::den)));
197 template<
typename _ToDur,
typename _CF,
typename _CR>
198 struct __duration_cast_impl<_ToDur, _CF, _CR, true, true>
200 template<
typename _Rep,
typename _Period>
201 static constexpr _ToDur
202 __cast(
const duration<_Rep, _Period>& __d)
204 typedef typename _ToDur::rep __to_rep;
205 return _ToDur(static_cast<__to_rep>(__d.count()));
209 template<
typename _ToDur,
typename _CF,
typename _CR>
210 struct __duration_cast_impl<_ToDur, _CF, _CR, true, false>
212 template<
typename _Rep,
typename _Period>
213 static constexpr _ToDur
214 __cast(
const duration<_Rep, _Period>& __d)
216 typedef typename _ToDur::rep __to_rep;
217 return _ToDur(static_cast<__to_rep>(
218 static_cast<_CR>(__d.count()) / static_cast<_CR>(_CF::den)));
222 template<
typename _ToDur,
typename _CF,
typename _CR>
223 struct __duration_cast_impl<_ToDur, _CF, _CR, false, true>
225 template<
typename _Rep,
typename _Period>
226 static constexpr _ToDur
227 __cast(
const duration<_Rep, _Period>& __d)
229 typedef typename _ToDur::rep __to_rep;
230 return _ToDur(static_cast<__to_rep>(
231 static_cast<_CR>(__d.count()) * static_cast<_CR>(_CF::num)));
235 template<
typename _Tp>
240 template<
typename _Rep,
typename _Period>
241 struct __is_duration<duration<_Rep, _Period>>
245 template<
typename _Tp>
246 using __enable_if_is_duration
249 template<
typename _Tp>
250 using __disable_if_is_duration
253 #if __cplusplus >= 201703L 254 template<
typename _Tp>
255 inline constexpr
bool __is_duration_v =
false;
256 template<
typename _Rep,
typename _Period>
257 inline constexpr
bool __is_duration_v<duration<_Rep, _Period>> =
true;
258 template<
typename _Tp>
259 inline constexpr
bool __is_time_point_v =
false;
260 template<
typename _Clock,
typename _Dur>
261 inline constexpr
bool __is_time_point_v<time_point<_Clock, _Dur>> =
true;
276 template<
typename _ToDur,
typename _Rep,
typename _Period>
278 constexpr __enable_if_is_duration<_ToDur>
281 #if __cpp_inline_variables && __cpp_if_constexpr 287 using __to_period =
typename _ToDur::period;
288 using __to_rep =
typename _ToDur::rep;
291 using __dc = __duration_cast_impl<_ToDur, __cf, __cr,
292 __cf::num == 1, __cf::den == 1>;
293 return __dc::__cast(__d);
294 #if __cpp_inline_variables && __cpp_if_constexpr 310 template<
typename _Rep>
315 #if __cplusplus > 201402L 316 template <
typename _Rep>
317 inline constexpr
bool treat_as_floating_point_v =
321 inline constexpr
bool treat_as_floating_point_v<int> =
false;
323 inline constexpr
bool treat_as_floating_point_v<long> =
false;
325 inline constexpr
bool treat_as_floating_point_v<long long> =
false;
327 inline constexpr
bool treat_as_floating_point_v<float> =
true;
329 inline constexpr
bool treat_as_floating_point_v<double> =
true;
331 inline constexpr
bool treat_as_floating_point_v<long double> =
true;
334 #if __cplusplus > 201703L 335 #if __cpp_lib_concepts 336 template<
typename _Tp>
337 inline constexpr
bool is_clock_v =
false;
339 template<
typename _Tp>
342 typename _Tp::period;
343 typename _Tp::duration;
344 typename _Tp::time_point::clock;
345 typename _Tp::time_point::duration;
346 { &_Tp::is_steady } -> same_as<const bool*>;
347 { _Tp::now() } -> same_as<typename _Tp::time_point>;
348 requires
same_as<
typename _Tp::duration,
350 requires
same_as<
typename _Tp::time_point::duration,
351 typename _Tp::duration>;
353 inline constexpr
bool is_clock_v<_Tp> =
true;
355 template<
typename _Tp,
typename =
void>
356 inline constexpr
bool is_clock_v =
false;
358 template<
typename _Tp>
359 inline constexpr
bool 360 is_clock_v<_Tp,
void_t<
typename _Tp::rep,
typename _Tp::period,
361 typename _Tp::duration,
362 typename _Tp::time_point::duration,
363 decltype(_Tp::is_steady),
364 decltype(_Tp::now())>>
365 = __and_v<
is_same<
typename _Tp::duration,
367 is_same<
typename _Tp::time_point::duration,
368 typename _Tp::duration>,
373 template<
typename _Tp>
375 : bool_constant<is_clock_v<_Tp>>
379 #if __cplusplus >= 201703L // C++ >= 17 390 template<
typename _ToDur,
typename _Rep,
typename _Period>
391 [[nodiscard]] constexpr __enable_if_is_duration<_ToDur>
396 return __to - _ToDur{1};
410 template<
typename _ToDur,
typename _Rep,
typename _Period>
411 [[nodiscard]] constexpr __enable_if_is_duration<_ToDur>
416 return __to + _ToDur{1};
431 template <
typename _ToDur,
typename _Rep,
typename _Period>
432 [[nodiscard]] constexpr
434 __and_<__is_duration<_ToDur>,
435 __not_<treat_as_floating_point<typename _ToDur::rep>>>::value,
439 _ToDur __t0 = chrono::floor<_ToDur>(__d);
440 _ToDur __t1 = __t0 + _ToDur{1};
441 auto __diff0 = __d - __t0;
442 auto __diff1 = __t1 - __d;
443 if (__diff0 == __diff1)
445 if (__t0.count() & 1)
449 else if (__diff0 < __diff1)
460 template<
typename _Rep,
typename _Period>
461 [[nodiscard]] constexpr
465 if (__d >= __d.zero())
473 #else // ! __glibcxx_chrono 480 template<
typename _Tp,
typename _Up>
482 __ceil_impl(
const _Tp& __t,
const _Up& __u)
484 return (__t < __u) ? (__t + _Tp{1}) : __t;
488 template<
typename _ToDur,
typename _Rep,
typename _Period>
492 return __detail::__ceil_impl(chrono::duration_cast<_ToDur>(__d), __d);
495 #endif // __glibcxx_chrono 498 template<
typename _Rep>
501 static constexpr _Rep
505 static constexpr _Rep
509 static constexpr _Rep
514 template<
typename _Rep,
typename _Period>
517 static_assert(!__is_duration<_Rep>::value,
518 "rep cannot be a std::chrono::duration");
519 static_assert(__is_ratio<_Period>::value,
520 "period must be a specialization of std::ratio");
521 static_assert(_Period::num > 0,
"period must be positive");
523 template<
typename _Rep2>
526 static constexpr intmax_t
527 _S_gcd(intmax_t __m, intmax_t __n) noexcept
531 #if __cplusplus >= 201402L 534 intmax_t __rem = __m % __n;
543 return (__n == 0) ? __m : _S_gcd(__n, __m % __n);
551 template<
typename _R1,
typename _R2,
552 intmax_t __gcd1 = _S_gcd(_R1::num, _R2::num),
553 intmax_t __gcd2 = _S_gcd(_R1::den, _R2::den)>
554 using __divide =
ratio<(_R1::num / __gcd1) * (_R2::den / __gcd2),
555 (_R1::den / __gcd2) * (_R2::num / __gcd1)>;
558 template<
typename _Period2>
560 = __bool_constant<__divide<_Period2, _Period>::den == 1>;
565 using period =
typename _Period::type;
568 constexpr duration() =
default;
570 duration(
const duration&) =
default;
574 template<
typename _Rep2,
typename = _Require<
575 is_convertible<const _Rep2&, rep>,
576 __or_<__is_float<rep>, __not_<__is_float<_Rep2>>>>>
577 constexpr
explicit duration(
const _Rep2& __rep)
578 : __r(static_cast<rep>(__rep)) { }
580 template<
typename _Rep2,
typename _Period2,
typename = _Require<
581 is_convertible<const _Rep2&, rep>,
582 __or_<__is_float<rep>,
583 __and_<__is_harmonic<_Period2>,
584 __not_<__is_float<_Rep2>>>>>>
586 : __r(duration_cast<duration>(__d).count()) { }
588 ~duration() =
default;
589 duration& operator=(
const duration&) =
default;
600 {
return duration<typename common_type<rep>::type, period>(__r); }
602 constexpr duration<typename common_type<rep>::type, period>
604 {
return duration<typename common_type<rep>::type, period>(-__r); }
606 _GLIBCXX17_CONSTEXPR duration&
613 _GLIBCXX17_CONSTEXPR duration
615 {
return duration(__r++); }
617 _GLIBCXX17_CONSTEXPR duration&
624 _GLIBCXX17_CONSTEXPR duration
626 {
return duration(__r--); }
628 _GLIBCXX17_CONSTEXPR duration&
629 operator+=(
const duration& __d)
635 _GLIBCXX17_CONSTEXPR duration&
636 operator-=(
const duration& __d)
642 _GLIBCXX17_CONSTEXPR duration&
643 operator*=(
const rep& __rhs)
649 _GLIBCXX17_CONSTEXPR duration&
650 operator/=(
const rep& __rhs)
657 template<
typename _Rep2 = rep>
659 __enable_if_t<!treat_as_floating_point<_Rep2>::value, duration&>
660 operator%=(
const rep& __rhs)
666 template<
typename _Rep2 = rep>
668 __enable_if_t<!treat_as_floating_point<_Rep2>::value, duration&>
669 operator%=(
const duration& __d)
676 static constexpr duration
680 static constexpr duration
684 static constexpr duration
696 template<
typename _Rep1,
typename _Period1,
697 typename _Rep2,
typename _Period2>
706 return __cd(__cd(__lhs).count() + __cd(__rhs).count());
710 template<
typename _Rep1,
typename _Period1,
711 typename _Rep2,
typename _Period2>
712 constexpr
typename common_type<duration<_Rep1, _Period1>,
720 return __cd(__cd(__lhs).count() - __cd(__rhs).count());
731 template<
typename _Rep1,
typename _Rep2,
733 using __common_rep_t =
typename 743 template<
typename _Rep1,
typename _Period,
typename _Rep2>
749 return __cd(__cd(__d).count() * __s);
752 template<
typename _Rep1,
typename _Rep2,
typename _Period>
755 {
return __d * __s; }
757 template<
typename _Rep1,
typename _Period,
typename _Rep2>
764 return __cd(__cd(__d).count() / __s);
767 template<
typename _Rep1,
typename _Period1,
768 typename _Rep2,
typename _Period2>
776 return __cd(__lhs).count() / __cd(__rhs).count();
780 template<
typename _Rep1,
typename _Period,
typename _Rep2>
782 duration<__common_rep_t<_Rep1, __disable_if_is_duration<_Rep2>>, _Period>
787 return __cd(__cd(__d).count() % __s);
790 template<
typename _Rep1,
typename _Period1,
791 typename _Rep2,
typename _Period2>
792 constexpr
typename common_type<duration<_Rep1, _Period1>,
800 return __cd(__cd(__lhs).count() % __cd(__rhs).count());
811 template<
typename _Rep1,
typename _Period1,
812 typename _Rep2,
typename _Period2>
820 return __ct(__lhs).count() == __ct(__rhs).count();
823 template<
typename _Rep1,
typename _Period1,
824 typename _Rep2,
typename _Period2>
826 operator<(const duration<_Rep1, _Period1>& __lhs,
832 return __ct(__lhs).count() < __ct(__rhs).count();
835 #if __cpp_lib_three_way_comparison 836 template<
typename _Rep1,
typename _Period1,
837 typename _Rep2,
typename _Period2>
838 requires three_way_comparable<common_type_t<_Rep1, _Rep2>>
845 return __ct(__lhs).count() <=> __ct(__rhs).count();
848 template<
typename _Rep1,
typename _Period1,
849 typename _Rep2,
typename _Period2>
853 {
return !(__lhs == __rhs); }
856 template<
typename _Rep1,
typename _Period1,
857 typename _Rep2,
typename _Period2>
859 operator<=(const duration<_Rep1, _Period1>& __lhs,
861 {
return !(__rhs < __lhs); }
863 template<
typename _Rep1,
typename _Period1,
864 typename _Rep2,
typename _Period2>
868 {
return __rhs < __lhs; }
870 template<
typename _Rep1,
typename _Period1,
871 typename _Rep2,
typename _Period2>
875 {
return !(__lhs < __rhs); }
880 #ifdef _GLIBCXX_USE_C99_STDINT 881 # define _GLIBCXX_CHRONO_INT64_T int64_t 882 #elif defined __INT64_TYPE__ 883 # define _GLIBCXX_CHRONO_INT64_T __INT64_TYPE__ 886 "Representation type for nanoseconds must have at least 64 bits");
887 # define _GLIBCXX_CHRONO_INT64_T long long 909 #if __cplusplus > 201703L 923 #undef _GLIBCXX_CHRONO_INT64_T 925 template<
typename _Clock,
typename _Dur>
928 static_assert(__is_duration<_Dur>::value,
929 "duration must be a specialization of std::chrono::duration");
932 typedef _Clock clock;
933 typedef _Dur duration;
934 typedef typename duration::rep rep;
935 typedef typename duration::period period;
937 constexpr
time_point() : __d(duration::zero())
940 constexpr
explicit time_point(
const duration& __dur)
945 template<
typename _Dur2,
946 typename = _Require<is_convertible<_Dur2, _Dur>>>
948 : __d(__t.time_since_epoch())
953 time_since_epoch()
const 956 #if __cplusplus > 201703L 957 constexpr time_point&
966 {
return time_point{__d++}; }
968 constexpr time_point&
977 {
return time_point{__d--}; }
981 _GLIBCXX17_CONSTEXPR time_point&
982 operator+=(
const duration& __dur)
988 _GLIBCXX17_CONSTEXPR time_point&
989 operator-=(
const duration& __dur)
996 static constexpr time_point
998 {
return time_point(duration::min()); }
1000 static constexpr time_point
1002 {
return time_point(duration::max()); }
1020 template<
typename _ToDur,
typename _Clock,
typename _Dur>
1021 _GLIBCXX_NODISCARD constexpr
1026 return __time_point(duration_cast<_ToDur>(__t.time_since_epoch()));
1029 #if __cplusplus > 201402L 1042 template<
typename _ToDur,
typename _Clock,
typename _Dur>
1043 [[nodiscard]] constexpr
1048 chrono::floor<_ToDur>(__tp.time_since_epoch())};
1063 template<
typename _ToDur,
typename _Clock,
typename _Dur>
1064 [[nodiscard]] constexpr
1069 chrono::ceil<_ToDur>(__tp.time_since_epoch())};
1085 template<
typename _ToDur,
typename _Clock,
typename _Dur>
1086 [[nodiscard]] constexpr
1087 enable_if_t<__is_duration_v<_ToDur>
1088 && !treat_as_floating_point_v<typename _ToDur::rep>,
1093 chrono::round<_ToDur>(__tp.time_since_epoch())};
1101 template<
typename _Clock,
typename _Dur1,
1102 typename _Rep2,
typename _Period2>
1106 const duration<_Rep2, _Period2>& __rhs)
1108 typedef duration<_Rep2, _Period2> __dur2;
1111 return __time_point(__lhs.time_since_epoch() + __rhs);
1115 template<
typename _Rep1,
typename _Period1,
1116 typename _Clock,
typename _Dur2>
1118 typename common_type<duration<_Rep1, _Period1>, _Dur2>::type>
1125 return __time_point(__rhs.time_since_epoch() + __lhs);
1129 template<
typename _Clock,
typename _Dur1,
1130 typename _Rep2,
typename _Period2>
1139 return __time_point(__lhs.time_since_epoch() -__rhs);
1143 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1147 {
return __lhs.time_since_epoch() - __rhs.time_since_epoch(); }
1155 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1159 {
return __lhs.time_since_epoch() == __rhs.time_since_epoch(); }
1161 #if __cpp_lib_three_way_comparison 1162 template<
typename _Clock,
typename _Dur1,
1163 three_way_comparable_with<_Dur1> _Dur2>
1167 {
return __lhs.time_since_epoch() <=> __rhs.time_since_epoch(); }
1169 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1173 {
return !(__lhs == __rhs); }
1176 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1178 operator<(const time_point<_Clock, _Dur1>& __lhs,
1180 {
return __lhs.time_since_epoch() < __rhs.time_since_epoch(); }
1182 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1184 operator<=(const time_point<_Clock, _Dur1>& __lhs,
1186 {
return !(__rhs < __lhs); }
1188 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1192 {
return __rhs < __lhs; }
1194 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1198 {
return !(__lhs < __rhs); }
1222 _GLIBCXX_BEGIN_INLINE_ABI_NAMESPACE(_V2)
1233 typedef duration::rep rep;
1234 typedef duration::period period;
1237 static_assert(system_clock::duration::min()
1238 < system_clock::duration::zero(),
1239 "a clock's minimum duration cannot be less than its epoch");
1241 static constexpr
bool is_steady =
false;
1247 [[__gnu__::__always_inline__]]
1249 to_time_t(
const time_point& __t) noexcept
1251 return std::time_t(duration_cast<chrono::seconds>
1252 (__t.time_since_epoch()).count());
1255 [[__gnu__::__always_inline__]]
1257 from_time_t(std::time_t __t) noexcept
1275 typedef duration::rep rep;
1276 typedef duration::period period;
1279 static constexpr
bool is_steady =
true;
1296 _GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2)
1298 #if __cplusplus >= 202002L 1301 template<
typename _Duration>
1306 using file_clock = ::std::filesystem::__file_clock;
1308 template<
typename _Duration>
1312 template<>
struct is_clock<steady_clock> :
true_type { };
1313 template<>
struct is_clock<file_clock> :
true_type { };
1315 template<>
inline constexpr
bool is_clock_v<system_clock> =
true;
1316 template<>
inline constexpr
bool is_clock_v<steady_clock> =
true;
1317 template<>
inline constexpr
bool is_clock_v<file_clock> =
true;
1320 #elif __cplusplus >= 202002L 1324 template<
typename _Duration>
1328 #endif // _GLIBCXX_HOSTED 1331 #ifdef __glibcxx_chrono_udls // C++ >= 14 1332 inline namespace literals
1358 inline namespace chrono_literals
1363 #pragma GCC diagnostic push 1364 #pragma GCC diagnostic ignored "-Wliteral-suffix" 1366 template<
typename _Dur,
char... _Digits>
1367 constexpr _Dur __check_overflow()
1369 using _Val = __parse_int::_Parse_int<_Digits...>;
1370 constexpr
typename _Dur::rep __repval = _Val::value;
1371 static_assert(__repval >= 0 && __repval == _Val::value,
1372 "literal value cannot be represented by duration type");
1373 return _Dur(__repval);
1379 operator""h(
long double __hours)
1383 template <
char... _Digits>
1390 operator""min(
long double __mins)
1394 template <
char... _Digits>
1401 operator""s(
long double __secs)
1405 template <
char... _Digits>
1412 operator""ms(
long double __msecs)
1416 template <
char... _Digits>
1423 operator""us(
long double __usecs)
1427 template <
char... _Digits>
1434 operator""ns(
long double __nsecs)
1438 template <
char... _Digits>
1443 #pragma GCC diagnostic pop 1450 using namespace literals::chrono_literals;
1452 #endif // __glibcxx_chrono_udls 1454 #if __cplusplus >= 201703L && _GLIBCXX_HOSTED 1455 namespace filesystem
1460 using rep = duration::rep;
1461 using period = duration::period;
1463 static constexpr
bool is_steady =
false;
1467 {
return _S_from_sys(chrono::system_clock::now()); }
1469 #if __cplusplus > 201703L 1470 template<
typename _Dur>
1474 {
return _S_from_sys(__t); }
1477 template<
typename _Dur>
1481 {
return _S_to_sys(__t); }
1494 template<
typename _Dur>
1501 return __file_time{__t.time_since_epoch()} - _S_epoch_diff;
1505 template<
typename _Dur>
1512 return __sys_time{__t.time_since_epoch()} + _S_epoch_diff;
1516 #endif // C++17 && HOSTED 1519 #if ! defined _GLIBCXX_NO_SLEEP || defined _GLIBCXX_HAS_GTHREADS \ 1520 || _GLIBCXX_HAVE_LINUX_FUTEX 1525 #pragma GCC diagnostic push 1526 #pragma GCC diagnostic ignored "-Wc++17-extensions" 1529 template<
typename _Rep,
typename _Period>
1530 [[__nodiscard__]] _GLIBCXX14_CONSTEXPR
inline 1532 __to_timeout_timespec(
const duration<_Rep, _Period>& __d)
1534 struct ::timespec __ts{};
1536 if (__d < __d.zero())
1540 || treat_as_floating_point<_Rep>::value)
1546 if (__d > __fmax) [[__unlikely__]]
1547 return chrono::__to_timeout_timespec(chrono::seconds::max());
1556 if (__s.count() > __tmax) [[__unlikely__]]
1558 __ts.tv_sec = __tmax;
1565 if constexpr (treat_as_floating_point<_Rep>::value)
1566 if (__ns.count() > 999999999) [[__unlikely__]]
1569 __ts.tv_sec =
static_cast<time_t
>(__s.count());
1570 __ts.tv_nsec =
static_cast<long>(__ns.count());
1573 #pragma GCC diagnostic pop 1579 template<
typename _Clock,
typename _Dur>
1580 [[__nodiscard__]] _GLIBCXX14_CONSTEXPR
inline 1582 __to_timeout_timespec(
const time_point<_Clock, _Dur>& __t)
1584 return chrono::__to_timeout_timespec(__t.time_since_epoch());
1589 #endif // !NO_SLEEP || HAS_GTHREADS || HAVE_LINUX_FUTEX 1592 _GLIBCXX_END_NAMESPACE_VERSION
1597 #endif //_GLIBCXX_CHRONO_H _Tp abs(const complex< _Tp > &)
Return magnitude of z.
constexpr bool operator==(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
typename enable_if< _Cond, _Tp >::type enable_if_t
Alias template for enable_if.
duration< int64_t, nano > nanoseconds
nanoseconds
constexpr time_point< _Clock, typename common_type< _Dur1, duration< _Rep2, _Period2 > >::type > operator+(const time_point< _Clock, _Dur1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
duration< int64_t, ratio< 3600 > > hours
hours
typename __ratio_divide< _R1, _R2 >::type ratio_divide
ratio_divide
constexpr bool operator>=(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
__bool_constant< true > true_type
The type used as a compile-time boolean with true value.
duration< int64_t, micro > microseconds
microseconds
constexpr duration< __common_rep_t< _Rep1, __disable_if_is_duration< _Rep2 > >, _Period > operator%(const duration< _Rep1, _Period > &__d, const _Rep2 &__s)
typename common_type< _Tp... >::type common_type_t
Alias template for common_type.
constexpr complex< _Tp > operator/(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x divided by y.
constexpr __enable_if_is_duration< _ToDur > duration_cast(const duration< _Rep, _Period > &__d)
ISO C++ entities toplevel namespace is std.
__bool_constant< false > false_type
The type used as a compile-time boolean with false value.
concept same_as
[concept.same], concept same_as
chrono::time_point represents a point in time as measured by a clock
Properties of fundamental types.
constexpr __enable_if_t< __is_duration< _ToDur >::value, time_point< _Clock, _ToDur > > time_point_cast(const time_point< _Clock, _Dur > &__t)
Provides compile-time rational arithmetic.
static constexpr _Tp max() noexcept
constexpr enable_if_t< __is_duration_v< _ToDur > &&!treat_as_floating_point_v< typename _ToDur::rep >, time_point< _Clock, _ToDur > > round(const time_point< _Clock, _Dur > &__tp)
duration< int64_t > seconds
seconds
duration< int64_t, milli > milliseconds
milliseconds
constexpr duration< __common_rep_t< _Rep1, _Rep2 >, _Period > operator*(const duration< _Rep1, _Period > &__d, const _Rep2 &__s)
static constexpr _Tp lowest() noexcept
Define a member typedef type only if a boolean constant is true.
constexpr complex< _Tp > operator+(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x plus y.
constexpr complex< _Tp > operator*(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x times y.
duration< int64_t, ratio< 60 > > minutes
minutes
constexpr complex< _Tp > operator-(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x minus y.
void void_t
A metafunction that always yields void, used for detecting valid types.
chrono::duration represents a distance between two points in time
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 __enable_if_is_duration< _ToDur > ceil(const duration< _Rep, _Period > &__d)
constexpr const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.