30#ifndef _GLIBCXX_CHRONO
31#define _GLIBCXX_CHRONO 1
33#pragma GCC system_header
37#if __cplusplus < 201103L
42#if __cplusplus > 201703L
47namespace std _GLIBCXX_VISIBILITY(default)
49_GLIBCXX_BEGIN_NAMESPACE_VERSION
66#if __cplusplus >= 202002L
70 template<
typename _Duration>
79 template<
typename _Duration>
83 template<
typename _Duration>
87 template<
typename _Duration>
91 template<>
struct is_clock<utc_clock> :
true_type { };
92 template<>
struct is_clock<tai_clock> :
true_type { };
93 template<>
struct is_clock<gps_clock> :
true_type { };
95 template<>
inline constexpr bool is_clock_v<utc_clock> =
true;
96 template<>
inline constexpr bool is_clock_v<tai_clock> =
true;
97 template<>
inline constexpr bool is_clock_v<gps_clock> =
true;
99 struct leap_second_info
112 class weekday_indexed;
115 class month_day_last;
117 class month_weekday_last;
119 class year_month_day;
120 class year_month_day_last;
121 class year_month_weekday;
122 class year_month_weekday_last;
126 explicit last_spec() =
default;
128 friend constexpr month_day_last
131 friend constexpr month_day_last
135 inline constexpr last_spec last{};
145 __modulo(
long long __n,
unsigned __d)
150 return (__d + (__n % __d)) % __d;
153 inline constexpr unsigned __days_per_month[12]
154 = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
168 day(
unsigned __d) noexcept
173 operator++()
noexcept
180 operator++(
int)
noexcept
188 operator--()
noexcept
195 operator--(
int)
noexcept
203 operator+=(
const days& __d)
noexcept
210 operator-=(
const days& __d)
noexcept
217 operator unsigned()
const noexcept
222 {
return 1 <= _M_d && _M_d <= 31; }
224 friend constexpr bool
225 operator==(
const day& __x,
const day& __y)
noexcept
226 {
return unsigned{__x} ==
unsigned{__y}; }
228 friend constexpr strong_ordering
229 operator<=>(
const day& __x,
const day& __y)
noexcept
230 {
return unsigned{__x} <=>
unsigned{__y}; }
234 {
return day(
unsigned{__x} + __y.count()); }
238 {
return __y + __x; }
242 {
return __x + -__y; }
244 friend constexpr days
245 operator-(
const day& __x,
const day& __y)
noexcept
246 {
return days{int(
unsigned{__x}) -
int(
unsigned{__y})}; }
248 friend constexpr month_day
249 operator/(
const month& __m,
const day& __d)
noexcept;
251 friend constexpr month_day
252 operator/(
int __m,
const day& __d)
noexcept;
254 friend constexpr month_day
255 operator/(
const day& __d,
const month& __m)
noexcept;
257 friend constexpr month_day
258 operator/(
const day& __d,
int __m)
noexcept;
260 friend constexpr year_month_day
261 operator/(
const year_month& __ym,
const day& __d)
noexcept;
277 month(
unsigned __m) noexcept
282 operator++()
noexcept
289 operator++(
int)
noexcept
297 operator--()
noexcept
304 operator--(
int)
noexcept
312 operator+=(
const months& __m)
noexcept
319 operator-=(
const months& __m)
noexcept
326 operator unsigned()
const noexcept
331 {
return 1 <= _M_m && _M_m <= 12; }
333 friend constexpr bool
334 operator==(
const month& __x,
const month& __y)
noexcept
335 {
return unsigned{__x} ==
unsigned{__y}; }
337 friend constexpr strong_ordering
338 operator<=>(
const month& __x,
const month& __y)
noexcept
339 {
return unsigned{__x} <=>
unsigned{__y}; }
341 friend constexpr month
344 auto __n =
static_cast<long long>(
unsigned{__x}) + (__y.count() - 1);
345 return month{__detail::__modulo(__n, 12) + 1};
348 friend constexpr month
350 {
return __y + __x; }
352 friend constexpr month
354 {
return __x + -__y; }
357 operator-(
const month& __x,
const month& __y)
noexcept
359 const auto __dm = int(
unsigned(__x)) - int(
unsigned(__y));
360 return months{__dm < 0 ? 12 + __dm : __dm};
363 friend constexpr year_month
364 operator/(
const year& __y,
const month& __m)
noexcept;
366 friend constexpr month_day
367 operator/(
const month& __m,
int __d)
noexcept;
369 friend constexpr month_day_last
370 operator/(
const month& __m, last_spec)
noexcept;
372 friend constexpr month_day_last
373 operator/(last_spec,
const month& __m)
noexcept;
375 friend constexpr month_weekday
376 operator/(
const month& __m,
const weekday_indexed& __wdi)
noexcept;
378 friend constexpr month_weekday
379 operator/(
const weekday_indexed& __wdi,
const month& __m)
noexcept;
381 friend constexpr month_weekday_last
382 operator/(
const month& __m,
const weekday_last& __wdl)
noexcept;
384 friend constexpr month_weekday_last
385 operator/(
const weekday_last& __wdl,
const month& __m)
noexcept;
390 inline constexpr month January{1};
391 inline constexpr month February{2};
392 inline constexpr month March{3};
393 inline constexpr month April{4};
394 inline constexpr month May{5};
395 inline constexpr month June{6};
396 inline constexpr month July{7};
397 inline constexpr month August{8};
398 inline constexpr month September{9};
399 inline constexpr month October{10};
400 inline constexpr month November{11};
401 inline constexpr month December{12};
414 year(
int __y) noexcept
415 : _M_y{
static_cast<short>(__y)}
418 static constexpr year
420 {
return year{-32767}; }
422 static constexpr year
424 {
return year{32767}; }
427 operator++()
noexcept
434 operator++(
int)
noexcept
442 operator--()
noexcept
449 operator--(
int)
noexcept
457 operator+=(
const years& __y)
noexcept
464 operator-=(
const years& __y)
noexcept
476 {
return year{-_M_y}; }
479 is_leap()
const noexcept
497 constexpr uint32_t __multiplier = 42949673;
498 constexpr uint32_t __bound = 42949669;
499 constexpr uint32_t __max_dividend = 1073741799;
500 constexpr uint32_t __offset = __max_dividend / 2 / 100 * 100;
501 const bool __is_multiple_of_100
502 = __multiplier * (_M_y + __offset) < __bound;
503 return (_M_y & (__is_multiple_of_100 ? 15 : 3)) == 0;
507 operator int()
const noexcept
512 {
return min()._M_y <= _M_y && _M_y <=
max()._M_y; }
514 friend constexpr bool
515 operator==(
const year& __x,
const year& __y)
noexcept
516 {
return int{__x} ==
int{__y}; }
518 friend constexpr strong_ordering
519 operator<=>(
const year& __x,
const year& __y)
noexcept
520 {
return int{__x} <=>
int{__y}; }
522 friend constexpr year
524 {
return year{
int{__x} +
static_cast<int>(__y.count())}; }
526 friend constexpr year
528 {
return __y + __x; }
530 friend constexpr year
532 {
return __x + -__y; }
534 friend constexpr years
535 operator-(
const year& __x,
const year& __y)
noexcept
536 {
return years{
int{__x} -
int{__y}}; }
538 friend constexpr year_month
539 operator/(
const year& __y,
int __m)
noexcept;
541 friend constexpr year_month_day
542 operator/(
const year& __y,
const month_day& __md)
noexcept;
544 friend constexpr year_month_day
545 operator/(
const month_day& __md,
const year& __y)
noexcept;
547 friend constexpr year_month_day_last
548 operator/(
const year& __y,
const month_day_last& __mdl)
noexcept;
550 friend constexpr year_month_day_last
551 operator/(
const month_day_last& __mdl,
const year& __y)
noexcept;
553 friend constexpr year_month_weekday
554 operator/(
const year& __y,
const month_weekday& __mwd)
noexcept;
556 friend constexpr year_month_weekday
557 operator/(
const month_weekday& __mwd,
const year& __y)
noexcept;
559 friend constexpr year_month_weekday_last
560 operator/(
const year& __y,
const month_weekday_last& __mwdl)
noexcept;
562 friend constexpr year_month_weekday_last
563 operator/(
const month_weekday_last& __mwdl,
const year& __y)
noexcept;
575 static constexpr weekday
576 _S_from_days(
const days& __d)
578 auto __n = __d.count();
579 return weekday(__n >= -4 ? (__n + 4) % 7 : (__n + 5) % 7 + 6);
586 weekday(
unsigned __wd) noexcept
587 : _M_wd(__wd == 7 ? 0 : __wd)
591 weekday(
const sys_days& __dp) noexcept
592 : weekday{_S_from_days(__dp.time_since_epoch())}
597 : weekday{
sys_days{__dp.time_since_epoch()}}
601 operator++()
noexcept
608 operator++(
int)
noexcept
616 operator--()
noexcept
623 operator--(
int)
noexcept
631 operator+=(
const days& __d)
noexcept
638 operator-=(
const days& __d)
noexcept
645 c_encoding()
const noexcept
649 iso_encoding()
const noexcept
650 {
return _M_wd == 0u ? 7u : _M_wd; }
654 {
return _M_wd <= 6; }
656 constexpr weekday_indexed
657 operator[](
unsigned __index)
const noexcept;
659 constexpr weekday_last
660 operator[](last_spec)
const noexcept;
662 friend constexpr bool
663 operator==(
const weekday& __x,
const weekday& __y)
noexcept
664 {
return __x._M_wd == __y._M_wd; }
666 friend constexpr weekday
669 auto __n =
static_cast<long long>(__x._M_wd) + __y.count();
670 return weekday{__detail::__modulo(__n, 7)};
673 friend constexpr weekday
675 {
return __y + __x; }
677 friend constexpr weekday
679 {
return __x + -__y; }
681 friend constexpr days
682 operator-(
const weekday& __x,
const weekday& __y)
noexcept
684 auto __n =
static_cast<long long>(__x._M_wd) - __y._M_wd;
685 return days{__detail::__modulo(__n, 7)};
691 inline constexpr weekday Sunday{0};
692 inline constexpr weekday Monday{1};
693 inline constexpr weekday Tuesday{2};
694 inline constexpr weekday Wednesday{3};
695 inline constexpr weekday Thursday{4};
696 inline constexpr weekday Friday{5};
697 inline constexpr weekday Saturday{6};
701 class weekday_indexed
704 chrono::weekday _M_wd;
705 unsigned char _M_index;
708 weekday_indexed() =
default;
711 weekday_indexed(
const chrono::weekday& __wd,
unsigned __index) noexcept
712 : _M_wd(__wd), _M_index(__index)
715 constexpr chrono::weekday
716 weekday() const noexcept
720 index() const noexcept
721 {
return _M_index; };
725 {
return _M_wd.ok() && 1 <= _M_index && _M_index <= 5; }
727 friend constexpr bool
728 operator==(
const weekday_indexed& __x,
const weekday_indexed& __y)
noexcept
729 {
return __x.weekday() == __y.weekday() && __x.index() == __y.index(); }
731 friend constexpr month_weekday
732 operator/(
const month& __m,
const weekday_indexed& __wdi)
noexcept;
734 friend constexpr month_weekday
735 operator/(
int __m,
const weekday_indexed& __wdi)
noexcept;
737 friend constexpr month_weekday
738 operator/(
const weekday_indexed& __wdi,
const month& __m)
noexcept;
740 friend constexpr month_weekday
741 operator/(
const weekday_indexed& __wdi,
int __m)
noexcept;
743 friend constexpr year_month_weekday
744 operator/(
const year_month& __ym,
const weekday_indexed& __wdi)
noexcept;
749 constexpr weekday_indexed
750 weekday::operator[](
unsigned __index)
const noexcept
751 {
return {*
this, __index}; }
758 chrono::weekday _M_wd;
762 weekday_last(
const chrono::weekday& __wd) noexcept
766 constexpr chrono::weekday
767 weekday() const noexcept
772 {
return _M_wd.ok(); }
774 friend constexpr bool
775 operator==(
const weekday_last& __x,
const weekday_last& __y)
noexcept
776 {
return __x.weekday() == __y.weekday(); }
778 friend constexpr month_weekday_last
779 operator/(
int __m,
const weekday_last& __wdl)
noexcept;
781 friend constexpr month_weekday_last
782 operator/(
const weekday_last& __wdl,
int __m)
noexcept;
784 friend constexpr year_month_weekday_last
785 operator/(
const year_month& __ym,
const weekday_last& __wdl)
noexcept;
790 constexpr weekday_last
791 weekday::operator[](last_spec)
const noexcept
792 {
return weekday_last{*
this}; }
803 month_day() =
default;
806 month_day(
const chrono::month& __m,
const chrono::day& __d) noexcept
807 : _M_m{__m}, _M_d{__d}
810 constexpr chrono::month
811 month() const noexcept
814 constexpr chrono::day
822 && 1u <= unsigned(_M_d)
823 && unsigned(_M_d) <= __detail::__days_per_month[unsigned(_M_m) - 1];
826 friend constexpr bool
827 operator==(
const month_day& __x,
const month_day& __y)
noexcept
828 {
return __x.month() == __y.month() && __x.day() == __y.day(); }
830 friend constexpr strong_ordering
831 operator<=>(
const month_day& __x,
const month_day& __y)
noexcept
834 friend constexpr month_day
835 operator/(
const chrono::month& __m,
const chrono::day& __d)
noexcept
836 {
return {__m, __d}; }
838 friend constexpr month_day
839 operator/(
const chrono::month& __m,
int __d)
noexcept
840 {
return {__m, chrono::day(
unsigned(__d))}; }
842 friend constexpr month_day
843 operator/(
int __m,
const chrono::day& __d)
noexcept
844 {
return {chrono::month(
unsigned(__m)), __d}; }
846 friend constexpr month_day
847 operator/(
const chrono::day& __d,
const chrono::month& __m)
noexcept
848 {
return {__m, __d}; }
850 friend constexpr month_day
851 operator/(
const chrono::day& __d,
int __m)
noexcept
852 {
return {chrono::month(
unsigned(__m)), __d}; }
854 friend constexpr year_month_day
855 operator/(
int __y,
const month_day& __md)
noexcept;
857 friend constexpr year_month_day
858 operator/(
const month_day& __md,
int __y)
noexcept;
872 month_day_last(
const chrono::month& __m) noexcept
876 constexpr chrono::month
877 month() const noexcept
882 {
return _M_m.ok(); }
884 friend constexpr bool
885 operator==(
const month_day_last& __x,
const month_day_last& __y)
noexcept
886 {
return __x.month() == __y.month(); }
888 friend constexpr strong_ordering
889 operator<=>(
const month_day_last& __x,
const month_day_last& __y)
noexcept
892 friend constexpr month_day_last
893 operator/(
const chrono::month& __m, last_spec)
noexcept
894 {
return month_day_last{__m}; }
896 friend constexpr month_day_last
898 {
return chrono::month(
unsigned(__m)) / last; }
900 friend constexpr month_day_last
901 operator/(last_spec,
const chrono::month& __m)
noexcept
902 {
return __m / last; }
904 friend constexpr month_day_last
906 {
return __m / last; }
908 friend constexpr year_month_day_last
909 operator/(
int __y,
const month_day_last& __mdl)
noexcept;
911 friend constexpr year_month_day_last
912 operator/(
const month_day_last& __mdl,
int __y)
noexcept;
923 chrono::weekday_indexed _M_wdi;
927 month_weekday(
const chrono::month& __m,
928 const chrono::weekday_indexed& __wdi) noexcept
929 : _M_m{__m}, _M_wdi{__wdi}
932 constexpr chrono::month
933 month() const noexcept
936 constexpr chrono::weekday_indexed
937 weekday_indexed() const noexcept
942 {
return _M_m.ok() && _M_wdi.ok(); }
944 friend constexpr bool
945 operator==(
const month_weekday& __x,
const month_weekday& __y)
noexcept
947 return __x.month() == __y.month()
948 && __x.weekday_indexed() == __y.weekday_indexed();
951 friend constexpr month_weekday
953 const chrono::weekday_indexed& __wdi)
noexcept
954 {
return {__m, __wdi}; }
956 friend constexpr month_weekday
957 operator/(
int __m,
const chrono::weekday_indexed& __wdi)
noexcept
958 {
return chrono::month(
unsigned(__m)) / __wdi; }
960 friend constexpr month_weekday
961 operator/(
const chrono::weekday_indexed& __wdi,
962 const chrono::month& __m)
noexcept
963 {
return __m / __wdi; }
965 friend constexpr month_weekday
966 operator/(
const chrono::weekday_indexed& __wdi,
int __m)
noexcept
967 {
return __m / __wdi; }
969 friend constexpr year_month_weekday
970 operator/(
int __y,
const month_weekday& __mwd)
noexcept;
972 friend constexpr year_month_weekday
973 operator/(
const month_weekday& __mwd,
int __y)
noexcept;
980 class month_weekday_last
984 chrono::weekday_last _M_wdl;
988 month_weekday_last(
const chrono::month& __m,
989 const chrono::weekday_last& __wdl) noexcept
990 :_M_m{__m}, _M_wdl{__wdl}
993 constexpr chrono::month
994 month() const noexcept
997 constexpr chrono::weekday_last
998 weekday_last() const noexcept
1003 {
return _M_m.ok() && _M_wdl.ok(); }
1005 friend constexpr bool
1006 operator==(
const month_weekday_last& __x,
1007 const month_weekday_last& __y)
noexcept
1009 return __x.month() == __y.month()
1010 && __x.weekday_last() == __y.weekday_last();
1013 friend constexpr month_weekday_last
1015 const chrono::weekday_last& __wdl)
noexcept
1016 {
return {__m, __wdl}; }
1018 friend constexpr month_weekday_last
1019 operator/(
int __m,
const chrono::weekday_last& __wdl)
noexcept
1020 {
return chrono::month(
unsigned(__m)) / __wdl; }
1022 friend constexpr month_weekday_last
1023 operator/(
const chrono::weekday_last& __wdl,
1024 const chrono::month& __m)
noexcept
1025 {
return __m / __wdl; }
1027 friend constexpr month_weekday_last
1028 operator/(
const chrono::weekday_last& __wdl,
int __m)
noexcept
1029 {
return chrono::month(
unsigned(__m)) / __wdl; }
1031 friend constexpr year_month_weekday_last
1032 operator/(
int __y,
const month_weekday_last& __mwdl)
noexcept;
1034 friend constexpr year_month_weekday_last
1035 operator/(
const month_weekday_last& __mwdl,
int __y)
noexcept;
1056 using __months_years_conversion_disambiguator = void;
1066 year_month() =
default;
1069 year_month(
const chrono::year& __y,
const chrono::month& __m) noexcept
1070 : _M_y{__y}, _M_m{__m}
1073 constexpr chrono::year
1074 year() const noexcept
1077 constexpr chrono::month
1078 month() const noexcept
1081 template<
typename = __detail::__months_years_conversion_disambiguator>
1082 constexpr year_month&
1083 operator+=(
const months& __dm)
noexcept
1085 *
this = *
this + __dm;
1089 template<
typename = __detail::__months_years_conversion_disambiguator>
1090 constexpr year_month&
1091 operator-=(
const months& __dm)
noexcept
1093 *
this = *
this - __dm;
1097 constexpr year_month&
1098 operator+=(
const years& __dy)
noexcept
1100 *
this = *
this + __dy;
1104 constexpr year_month&
1105 operator-=(
const years& __dy)
noexcept
1107 *
this = *
this - __dy;
1113 {
return _M_y.ok() && _M_m.ok(); }
1115 friend constexpr bool
1116 operator==(
const year_month& __x,
const year_month& __y)
noexcept
1117 {
return __x.year() == __y.year() && __x.month() == __y.month(); }
1119 friend constexpr strong_ordering
1120 operator<=>(
const year_month& __x,
const year_month& __y)
noexcept
1123 template<
typename = __detail::__months_years_conversion_disambiguator>
1124 friend constexpr year_month
1128 auto __m = __ym.month() + __dm;
1129 auto __i = int(
unsigned(__ym.month())) - 1 + __dm.count();
1131 ? __ym.year() +
years{(__i - 11) / 12}
1132 : __ym.year() +
years{__i / 12});
1136 template<
typename = __detail::__months_years_conversion_disambiguator>
1137 friend constexpr year_month
1139 {
return __ym + __dm; }
1141 template<
typename = __detail::__months_years_conversion_disambiguator>
1142 friend constexpr year_month
1144 {
return __ym + -__dm; }
1147 operator-(
const year_month& __x,
const year_month& __y)
noexcept
1149 return (__x.year() - __y.year()
1150 +
months{static_cast<int>(unsigned{__x.month()})
1151 -
static_cast<int>(
unsigned{__y.month()})});
1154 friend constexpr year_month
1156 {
return (__ym.year() + __dy) / __ym.month(); }
1158 friend constexpr year_month
1160 {
return __ym + __dy; }
1162 friend constexpr year_month
1164 {
return __ym + -__dy; }
1166 friend constexpr year_month
1167 operator/(
const chrono::year& __y,
const chrono::month& __m)
noexcept
1168 {
return {__y, __m}; }
1170 friend constexpr year_month
1171 operator/(
const chrono::year& __y,
int __m)
noexcept
1172 {
return {__y, chrono::month(
unsigned(__m))}; }
1174 friend constexpr year_month_day
1175 operator/(
const year_month& __ym,
int __d)
noexcept;
1177 friend constexpr year_month_day_last
1178 operator/(
const year_month& __ym, last_spec)
noexcept;
1185 class year_month_day
1192 static constexpr year_month_day _S_from_days(
const days& __dp)
noexcept;
1194 constexpr days _M_days_since_epoch() const noexcept;
1197 year_month_day() = default;
1200 year_month_day(const chrono::year& __y, const chrono::month& __m,
1201 const chrono::day& __d) noexcept
1202 : _M_y{__y}, _M_m{__m}, _M_d{__d}
1206 year_month_day(
const year_month_day_last& __ymdl)
noexcept;
1209 year_month_day(
const sys_days& __dp) noexcept
1210 : year_month_day(_S_from_days(__dp.time_since_epoch()))
1214 year_month_day(
const local_days& __dp) noexcept
1215 : year_month_day(sys_days{__dp.time_since_epoch()})
1218 template<
typename = __detail::__months_years_conversion_disambiguator>
1219 constexpr year_month_day&
1220 operator+=(
const months& __m)
noexcept
1222 *
this = *
this + __m;
1226 template<
typename = __detail::__months_years_conversion_disambiguator>
1227 constexpr year_month_day&
1228 operator-=(
const months& __m)
noexcept
1230 *
this = *
this - __m;
1234 constexpr year_month_day&
1235 operator+=(
const years& __y)
noexcept
1237 *
this = *
this + __y;
1241 constexpr year_month_day&
1242 operator-=(
const years& __y)
noexcept
1244 *
this = *
this - __y;
1248 constexpr chrono::year
1249 year() const noexcept
1252 constexpr chrono::month
1253 month() const noexcept
1256 constexpr chrono::day
1257 day() const noexcept
1261 operator sys_days() const noexcept
1262 {
return sys_days{_M_days_since_epoch()}; }
1265 operator local_days() const noexcept
1266 {
return local_days{sys_days{*
this}.time_since_epoch()}; }
1268 constexpr bool ok() const noexcept;
1270 friend constexpr
bool
1271 operator==(const year_month_day& __x, const year_month_day& __y) noexcept
1273 return __x.year() == __y.year()
1274 && __x.month() == __y.month()
1275 && __x.day() == __y.day();
1278 friend constexpr strong_ordering
1279 operator<=>(
const year_month_day& __x,
const year_month_day& __y)
noexcept
1282 template<
typename = __detail::__months_years_conversion_disambiguator>
1283 friend constexpr year_month_day
1285 {
return (__ymd.year() / __ymd.month() + __dm) / __ymd.day(); }
1287 template<
typename = __detail::__months_years_conversion_disambiguator>
1288 friend constexpr year_month_day
1290 {
return __ymd + __dm; }
1292 friend constexpr year_month_day
1293 operator+(
const year_month_day& __ymd,
const years& __dy)
noexcept
1294 {
return (__ymd.year() + __dy) / __ymd.month() / __ymd.day(); }
1296 friend constexpr year_month_day
1297 operator+(
const years& __dy,
const year_month_day& __ymd)
noexcept
1298 {
return __ymd + __dy; }
1300 template<
typename = __detail::__months_years_conversion_disambiguator>
1301 friend constexpr year_month_day
1303 {
return __ymd + -__dm; }
1305 friend constexpr year_month_day
1306 operator-(
const year_month_day& __ymd,
const years& __dy)
noexcept
1307 {
return __ymd + -__dy; }
1309 friend constexpr year_month_day
1310 operator/(
const year_month& __ym,
const chrono::day& __d)
noexcept
1311 {
return {__ym.year(), __ym.month(), __d}; }
1313 friend constexpr year_month_day
1314 operator/(
const year_month& __ym,
int __d)
noexcept
1315 {
return __ym / chrono::day{unsigned(__d)}; }
1317 friend constexpr year_month_day
1318 operator/(
const chrono::year& __y,
const month_day& __md)
noexcept
1319 {
return __y / __md.month() / __md.day(); }
1321 friend constexpr year_month_day
1322 operator/(
int __y,
const month_day& __md)
noexcept
1323 {
return chrono::year{__y} / __md; }
1325 friend constexpr year_month_day
1326 operator/(
const month_day& __md,
const chrono::year& __y)
noexcept
1327 {
return __y / __md; }
1329 friend constexpr year_month_day
1330 operator/(
const month_day& __md,
int __y)
noexcept
1331 {
return chrono::year(__y) / __md; }
1340 constexpr year_month_day
1341 year_month_day::_S_from_days(
const days& __dp)
noexcept
1343 constexpr auto __z2 =
static_cast<uint32_t
>(-1468000);
1344 constexpr auto __r2_e3 =
static_cast<uint32_t
>(536895458);
1346 const auto __r0 =
static_cast<uint32_t
>(__dp.count()) + __r2_e3;
1348 const auto __n1 = 4 * __r0 + 3;
1349 const auto __q1 = __n1 / 146097;
1350 const auto __r1 = __n1 % 146097 / 4;
1352 constexpr auto __p32 =
static_cast<uint64_t
>(1) << 32;
1353 const auto __n2 = 4 * __r1 + 3;
1354 const auto __u2 =
static_cast<uint64_t
>(2939745) * __n2;
1355 const auto __q2 =
static_cast<uint32_t
>(__u2 / __p32);
1356 const auto __r2 =
static_cast<uint32_t
>(__u2 % __p32) / 2939745 / 4;
1358 constexpr auto __p16 =
static_cast<uint32_t
>(1) << 16;
1359 const auto __n3 = 2141 * __r2 + 197913;
1360 const auto __q3 = __n3 / __p16;
1361 const auto __r3 = __n3 % __p16 / 2141;
1363 const auto __y0 = 100 * __q1 + __q2;
1364 const auto __m0 = __q3;
1365 const auto __d0 = __r3;
1367 const auto __j = __r2 >= 306;
1368 const auto __y1 = __y0 + __j;
1369 const auto __m1 = __j ? __m0 - 12 : __m0;
1370 const auto __d1 = __d0 + 1;
1372 return year_month_day{chrono::year{
static_cast<int>(__y1 + __z2)},
1373 chrono::month{__m1}, chrono::day{__d1}};
1381 year_month_day::_M_days_since_epoch() const noexcept
1383 auto constexpr __z2 =
static_cast<uint32_t
>(-1468000);
1384 auto constexpr __r2_e3 =
static_cast<uint32_t
>(536895458);
1386 const auto __y1 =
static_cast<uint32_t
>(
static_cast<int>(_M_y)) - __z2;
1387 const auto __m1 =
static_cast<uint32_t
>(
static_cast<unsigned>(_M_m));
1388 const auto __d1 =
static_cast<uint32_t
>(
static_cast<unsigned>(_M_d));
1390 const auto __j =
static_cast<uint32_t
>(__m1 < 3);
1391 const auto __y0 = __y1 - __j;
1392 const auto __m0 = __j ? __m1 + 12 : __m1;
1393 const auto __d0 = __d1 - 1;
1395 const auto __q1 = __y0 / 100;
1396 const auto __yc = 1461 * __y0 / 4 - __q1 + __q1 / 4;
1397 const auto __mc = (979 *__m0 - 2919) / 32;
1398 const auto __dc = __d0;
1400 return days{
static_cast<int32_t
>(__yc + __mc + __dc - __r2_e3)};
1405 class year_month_day_last
1409 chrono::month_day_last _M_mdl;
1413 year_month_day_last(
const chrono::year& __y,
1414 const chrono::month_day_last& __mdl) noexcept
1415 : _M_y{__y}, _M_mdl{__mdl}
1418 template<
typename = __detail::__months_years_conversion_disambiguator>
1419 constexpr year_month_day_last&
1420 operator+=(
const months& __m)
noexcept
1422 *
this = *
this + __m;
1426 template<
typename = __detail::__months_years_conversion_disambiguator>
1427 constexpr year_month_day_last&
1428 operator-=(
const months& __m)
noexcept
1430 *
this = *
this - __m;
1434 constexpr year_month_day_last&
1435 operator+=(
const years& __y)
noexcept
1437 *
this = *
this + __y;
1441 constexpr year_month_day_last&
1442 operator-=(
const years& __y)
noexcept
1444 *
this = *
this - __y;
1448 constexpr chrono::year
1449 year() const noexcept
1452 constexpr chrono::month
1453 month() const noexcept
1454 {
return _M_mdl.month(); }
1456 constexpr chrono::month_day_last
1457 month_day_last() const noexcept
1461 constexpr chrono::day
1462 day() const noexcept
1464 const auto __m =
static_cast<unsigned>(month());
1480 return chrono::day{__m != 2 ? ((__m ^ (__m >> 3)) & 1) | 30
1481 : _M_y.is_leap() ? 29 : 28};
1485 operator sys_days() const noexcept
1486 {
return sys_days{year() / month() / day()}; }
1489 operator local_days() const noexcept
1490 {
return local_days{sys_days{*
this}.time_since_epoch()}; }
1494 {
return _M_y.ok() && _M_mdl.ok(); }
1496 friend constexpr bool
1497 operator==(
const year_month_day_last& __x,
1498 const year_month_day_last& __y)
noexcept
1500 return __x.year() == __y.year()
1501 && __x.month_day_last() == __y.month_day_last();
1504 friend constexpr strong_ordering
1505 operator<=>(
const year_month_day_last& __x,
1506 const year_month_day_last& __y)
noexcept
1509 template<
typename = __detail::__months_years_conversion_disambiguator>
1510 friend constexpr year_month_day_last
1511 operator+(
const year_month_day_last& __ymdl,
1512 const months& __dm)
noexcept
1513 {
return (__ymdl.year() / __ymdl.month() + __dm) / last; }
1515 template<
typename = __detail::__months_years_conversion_disambiguator>
1516 friend constexpr year_month_day_last
1518 const year_month_day_last& __ymdl)
noexcept
1519 {
return __ymdl + __dm; }
1521 template<
typename = __detail::__months_years_conversion_disambiguator>
1522 friend constexpr year_month_day_last
1523 operator-(
const year_month_day_last& __ymdl,
1524 const months& __dm)
noexcept
1525 {
return __ymdl + -__dm; }
1527 friend constexpr year_month_day_last
1528 operator+(
const year_month_day_last& __ymdl,
1529 const years& __dy)
noexcept
1530 {
return {__ymdl.year() + __dy, __ymdl.month_day_last()}; }
1532 friend constexpr year_month_day_last
1534 const year_month_day_last& __ymdl)
noexcept
1535 {
return __ymdl + __dy; }
1537 friend constexpr year_month_day_last
1538 operator-(
const year_month_day_last& __ymdl,
1539 const years& __dy)
noexcept
1540 {
return __ymdl + -__dy; }
1542 friend constexpr year_month_day_last
1543 operator/(
const year_month& __ym, last_spec)
noexcept
1544 {
return {__ym.year(), chrono::month_day_last{__ym.month()}}; }
1546 friend constexpr year_month_day_last
1548 const chrono::month_day_last& __mdl)
noexcept
1549 {
return {__y, __mdl}; }
1551 friend constexpr year_month_day_last
1552 operator/(
int __y,
const chrono::month_day_last& __mdl)
noexcept
1553 {
return chrono::year(__y) / __mdl; }
1555 friend constexpr year_month_day_last
1556 operator/(
const chrono::month_day_last& __mdl,
1557 const chrono::year& __y)
noexcept
1558 {
return __y / __mdl; }
1560 friend constexpr year_month_day_last
1561 operator/(
const chrono::month_day_last& __mdl,
int __y)
noexcept
1562 {
return chrono::year(__y) / __mdl; }
1569 year_month_day::year_month_day(
const year_month_day_last& __ymdl) noexcept
1570 : _M_y{__ymdl.year()}, _M_m{__ymdl.month()}, _M_d{__ymdl.day()}
1574 year_month_day::ok() const noexcept
1576 if (!_M_y.ok() || !_M_m.ok())
1578 return chrono::day{1} <= _M_d && _M_d <= (_M_y / _M_m / last).day();
1583 class year_month_weekday
1588 chrono::weekday_indexed _M_wdi;
1590 static constexpr year_month_weekday
1591 _S_from_sys_days(
const sys_days& __dp)
1593 year_month_day __ymd{__dp};
1594 chrono::weekday __wd{__dp};
1595 auto __index = __wd[(
unsigned{__ymd.day()} - 1) / 7 + 1];
1596 return {__ymd.year(), __ymd.month(), __index};
1600 year_month_weekday() =
default;
1603 year_month_weekday(
const chrono::year& __y,
const chrono::month& __m,
1604 const chrono::weekday_indexed& __wdi) noexcept
1605 : _M_y{__y}, _M_m{__m}, _M_wdi{__wdi}
1609 year_month_weekday(
const sys_days& __dp) noexcept
1610 : year_month_weekday{_S_from_sys_days(__dp)}
1614 year_month_weekday(
const local_days& __dp) noexcept
1615 : year_month_weekday{sys_days{__dp.time_since_epoch()}}
1618 template<
typename = __detail::__months_years_conversion_disambiguator>
1619 constexpr year_month_weekday&
1620 operator+=(
const months& __m)
noexcept
1622 *
this = *
this + __m;
1626 template<
typename = __detail::__months_years_conversion_disambiguator>
1627 constexpr year_month_weekday&
1628 operator-=(
const months& __m)
noexcept
1630 *
this = *
this - __m;
1634 constexpr year_month_weekday&
1635 operator+=(
const years& __y)
noexcept
1637 *
this = *
this + __y;
1641 constexpr year_month_weekday&
1642 operator-=(
const years& __y)
noexcept
1644 *
this = *
this - __y;
1648 constexpr chrono::year
1649 year() const noexcept
1652 constexpr chrono::month
1653 month() const noexcept
1656 constexpr chrono::weekday
1657 weekday() const noexcept
1658 {
return _M_wdi.weekday(); }
1661 index() const noexcept
1662 {
return _M_wdi.index(); }
1664 constexpr chrono::weekday_indexed
1665 weekday_indexed() const noexcept
1669 operator sys_days() const noexcept
1671 auto __d = sys_days{year() / month() / 1};
1672 return __d + (weekday() - chrono::weekday(__d)
1673 +
days{(
static_cast<int>(index())-1)*7});
1677 operator local_days() const noexcept
1678 {
return local_days{sys_days{*
this}.time_since_epoch()}; }
1683 if (!_M_y.ok() || !_M_m.ok() || !_M_wdi.ok())
1685 if (_M_wdi.index() <= 4)
1687 days __d = (_M_wdi.weekday()
1688 - chrono::weekday{sys_days{_M_y / _M_m / 1}}
1689 +
days((_M_wdi.index()-1)*7 + 1));
1690 __glibcxx_assert(__d.count() >= 1);
1691 return __d.count() <=
unsigned{(_M_y / _M_m / last).day()};
1694 friend constexpr bool
1695 operator==(
const year_month_weekday& __x,
1696 const year_month_weekday& __y)
noexcept
1698 return __x.year() == __y.year()
1699 && __x.month() == __y.month()
1700 && __x.weekday_indexed() == __y.weekday_indexed();
1703 template<
typename = __detail::__months_years_conversion_disambiguator>
1704 friend constexpr year_month_weekday
1705 operator+(
const year_month_weekday& __ymwd,
const months& __dm)
noexcept
1707 return ((__ymwd.year() / __ymwd.month() + __dm)
1708 / __ymwd.weekday_indexed());
1711 template<
typename = __detail::__months_years_conversion_disambiguator>
1712 friend constexpr year_month_weekday
1713 operator+(
const months& __dm,
const year_month_weekday& __ymwd)
noexcept
1714 {
return __ymwd + __dm; }
1716 friend constexpr year_month_weekday
1717 operator+(
const year_month_weekday& __ymwd,
const years& __dy)
noexcept
1718 {
return {__ymwd.year() + __dy, __ymwd.month(), __ymwd.weekday_indexed()}; }
1720 friend constexpr year_month_weekday
1721 operator+(
const years& __dy,
const year_month_weekday& __ymwd)
noexcept
1722 {
return __ymwd + __dy; }
1724 template<
typename = __detail::__months_years_conversion_disambiguator>
1725 friend constexpr year_month_weekday
1726 operator-(
const year_month_weekday& __ymwd,
const months& __dm)
noexcept
1727 {
return __ymwd + -__dm; }
1729 friend constexpr year_month_weekday
1730 operator-(
const year_month_weekday& __ymwd,
const years& __dy)
noexcept
1731 {
return __ymwd + -__dy; }
1733 friend constexpr year_month_weekday
1735 const chrono::weekday_indexed& __wdi)
noexcept
1736 {
return {__ym.year(), __ym.month(), __wdi}; }
1738 friend constexpr year_month_weekday
1739 operator/(
const chrono::year& __y,
const month_weekday& __mwd)
noexcept
1740 {
return {__y, __mwd.month(), __mwd.weekday_indexed()}; }
1742 friend constexpr year_month_weekday
1743 operator/(
int __y,
const month_weekday& __mwd)
noexcept
1744 {
return chrono::year(__y) / __mwd; }
1746 friend constexpr year_month_weekday
1747 operator/(
const month_weekday& __mwd,
const chrono::year& __y)
noexcept
1748 {
return __y / __mwd; }
1750 friend constexpr year_month_weekday
1751 operator/(
const month_weekday& __mwd,
int __y)
noexcept
1752 {
return chrono::year(__y) / __mwd; }
1759 class year_month_weekday_last
1764 chrono::weekday_last _M_wdl;
1768 year_month_weekday_last(
const chrono::year& __y,
const chrono::month& __m,
1769 const chrono::weekday_last& __wdl) noexcept
1770 : _M_y{__y}, _M_m{__m}, _M_wdl{__wdl}
1773 template<
typename = __detail::__months_years_conversion_disambiguator>
1774 constexpr year_month_weekday_last&
1775 operator+=(
const months& __m)
noexcept
1777 *
this = *
this + __m;
1781 template<
typename = __detail::__months_years_conversion_disambiguator>
1782 constexpr year_month_weekday_last&
1783 operator-=(
const months& __m)
noexcept
1785 *
this = *
this - __m;
1789 constexpr year_month_weekday_last&
1790 operator+=(
const years& __y)
noexcept
1792 *
this = *
this + __y;
1796 constexpr year_month_weekday_last&
1797 operator-=(
const years& __y)
noexcept
1799 *
this = *
this - __y;
1803 constexpr chrono::year
1804 year() const noexcept
1807 constexpr chrono::month
1808 month() const noexcept
1811 constexpr chrono::weekday
1812 weekday() const noexcept
1813 {
return _M_wdl.weekday(); }
1815 constexpr chrono::weekday_last
1816 weekday_last() const noexcept
1820 operator sys_days() const noexcept
1822 const auto __d = sys_days{_M_y / _M_m / last};
1823 return sys_days{(__d - (chrono::weekday{__d}
1824 - _M_wdl.weekday())).time_since_epoch()};
1828 operator local_days() const noexcept
1829 {
return local_days{sys_days{*
this}.time_since_epoch()}; }
1833 {
return _M_y.ok() && _M_m.ok() && _M_wdl.ok(); }
1835 friend constexpr bool
1836 operator==(
const year_month_weekday_last& __x,
1837 const year_month_weekday_last& __y)
noexcept
1839 return __x.year() == __y.year()
1840 && __x.month() == __y.month()
1841 && __x.weekday_last() == __y.weekday_last();
1844 template<
typename = __detail::__months_years_conversion_disambiguator>
1845 friend constexpr year_month_weekday_last
1846 operator+(
const year_month_weekday_last& __ymwdl,
1847 const months& __dm)
noexcept
1849 return ((__ymwdl.year() / __ymwdl.month() + __dm)
1850 / __ymwdl.weekday_last());
1853 template<
typename = __detail::__months_years_conversion_disambiguator>
1854 friend constexpr year_month_weekday_last
1856 const year_month_weekday_last& __ymwdl)
noexcept
1857 {
return __ymwdl + __dm; }
1859 friend constexpr year_month_weekday_last
1860 operator+(
const year_month_weekday_last& __ymwdl,
1861 const years& __dy)
noexcept
1862 {
return {__ymwdl.year() + __dy, __ymwdl.month(), __ymwdl.weekday_last()}; }
1864 friend constexpr year_month_weekday_last
1866 const year_month_weekday_last& __ymwdl)
noexcept
1867 {
return __ymwdl + __dy; }
1869 template<
typename = __detail::__months_years_conversion_disambiguator>
1870 friend constexpr year_month_weekday_last
1871 operator-(
const year_month_weekday_last& __ymwdl,
1872 const months& __dm)
noexcept
1873 {
return __ymwdl + -__dm; }
1875 friend constexpr year_month_weekday_last
1876 operator-(
const year_month_weekday_last& __ymwdl,
1877 const years& __dy)
noexcept
1878 {
return __ymwdl + -__dy; }
1880 friend constexpr year_month_weekday_last
1882 const chrono::weekday_last& __wdl)
noexcept
1883 {
return {__ym.year(), __ym.month(), __wdl}; }
1885 friend constexpr year_month_weekday_last
1887 const chrono::month_weekday_last& __mwdl)
noexcept
1888 {
return {__y, __mwdl.month(), __mwdl.weekday_last()}; }
1890 friend constexpr year_month_weekday_last
1891 operator/(
int __y,
const chrono::month_weekday_last& __mwdl)
noexcept
1892 {
return chrono::year(__y) / __mwdl; }
1894 friend constexpr year_month_weekday_last
1895 operator/(
const chrono::month_weekday_last& __mwdl,
1896 const chrono::year& __y)
noexcept
1897 {
return __y / __mwdl; }
1899 friend constexpr year_month_weekday_last
1900 operator/(
const chrono::month_weekday_last& __mwdl,
int __y)
noexcept
1901 {
return chrono::year(__y) / __mwdl; }
1911 __pow10(
unsigned __n)
1920 template<
typename _Duration>
1924 static constexpr int
1925 _S_fractional_width()
1927 int __multiplicity_2 = 0;
1928 int __multiplicity_5 = 0;
1929 auto __den = _Duration::period::den;
1930 while ((__den % 2) == 0)
1935 while ((__den % 5) == 0)
1943 int __width = (__multiplicity_2 > __multiplicity_5
1944 ? __multiplicity_2 : __multiplicity_5);
1951 static constexpr unsigned fractional_width = {_S_fractional_width()};
1955 chrono::seconds::rep>,
1956 ratio<1, __detail::__pow10(fractional_width)>>;
1960 : hh_mm_ss{_Duration::zero()}
1964 hh_mm_ss(_Duration __d) noexcept
1965 : _M_is_neg (__d < _Duration::zero()),
1966 _M_h (duration_cast<chrono::hours>(
abs(__d))),
1967 _M_m (duration_cast<chrono::minutes>(
abs(__d) -
hours())),
1970 if constexpr (treat_as_floating_point_v<typename precision::rep>)
1973 _M_ss = duration_cast<precision>(
abs(__d) -
hours()
1978 is_negative() const noexcept
1979 {
return _M_is_neg; }
1982 hours() const noexcept
1994 subseconds() const noexcept
1998 operator precision() const noexcept
1999 {
return to_duration(); }
2002 to_duration() const noexcept
2005 return -(_M_h + _M_m + _M_s + _M_ss);
2007 return _M_h + _M_m + _M_s + _M_ss;
2023 is_am(
const hours& __h)
noexcept
2024 {
return 0h <= __h && __h <= 11h; }
2027 is_pm(
const hours& __h)
noexcept
2028 {
return 12h <= __h && __h <= 23h; }
2031 make12(
const hours& __h)
noexcept
2041 make24(
const hours& __h,
bool __is_pm)
noexcept
2062#if __cplusplus >= 202002L
2063 inline namespace literals
2065 inline namespace chrono_literals
2069#pragma GCC diagnostic push
2070#pragma GCC diagnostic ignored "-Wliteral-suffix"
2073 constexpr chrono::day
2074 operator""d(
unsigned long long __d)
noexcept
2075 {
return chrono::day{
static_cast<unsigned>(__d)}; }
2079 constexpr chrono::year
2080 operator""y(
unsigned long long __y)
noexcept
2081 {
return chrono::year{
static_cast<int>(__y)}; }
2082#pragma GCC diagnostic pop
2095 template<
typename _Period>
2097 __units_suffix_misc(
char* __buf,
size_t __n)
noexcept
2102 unsigned __nlen = __tc::__to_chars_len((uintmax_t)_Period::num);
2103 __tc::__to_chars_10_impl(__p + 1, __nlen, (uintmax_t)_Period::num);
2105 if constexpr (_Period::den != 1)
2108 unsigned __dlen = __tc::__to_chars_len((uintmax_t)_Period::den);
2109 __tc::__to_chars_10_impl(__p + 1, __dlen, (uintmax_t)_Period::den);
2118 template<
typename _Period,
typename _CharT>
2120 __units_suffix(
char* __buf,
size_t __n)
noexcept
2122#define _GLIBCXX_UNITS_SUFFIX(period, suffix) \
2123 if constexpr (is_same_v<_Period, period>) \
2125 if constexpr (is_same_v<_CharT, wchar_t>) \
2132 _GLIBCXX_UNITS_SUFFIX(atto,
"as")
2133 _GLIBCXX_UNITS_SUFFIX(femto, "fs")
2134 _GLIBCXX_UNITS_SUFFIX(pico, "ps")
2135 _GLIBCXX_UNITS_SUFFIX(nano, "ns")
2136 _GLIBCXX_UNITS_SUFFIX(micro, "\u00b5s")
2137 _GLIBCXX_UNITS_SUFFIX(milli, "ms")
2138 _GLIBCXX_UNITS_SUFFIX(centi, "cs")
2139 _GLIBCXX_UNITS_SUFFIX(deci, "ds")
2140 _GLIBCXX_UNITS_SUFFIX(ratio<1>, "s")
2141 _GLIBCXX_UNITS_SUFFIX(deca, "das")
2142 _GLIBCXX_UNITS_SUFFIX(hecto, "hs")
2143 _GLIBCXX_UNITS_SUFFIX(kilo, "ks")
2144 _GLIBCXX_UNITS_SUFFIX(mega, "Ms")
2145 _GLIBCXX_UNITS_SUFFIX(giga, "Gs")
2146 _GLIBCXX_UNITS_SUFFIX(tera, "Ts")
2147 _GLIBCXX_UNITS_SUFFIX(tera, "Ts")
2148 _GLIBCXX_UNITS_SUFFIX(peta, "Ps")
2149 _GLIBCXX_UNITS_SUFFIX(exa, "Es")
2150 _GLIBCXX_UNITS_SUFFIX(ratio<60>, "min")
2151 _GLIBCXX_UNITS_SUFFIX(ratio<3600>, "h")
2152 _GLIBCXX_UNITS_SUFFIX(ratio<86400>, "d")
2153#undef _GLIBCXX_UNITS_SUFFIX
2154 return __detail::__units_suffix_misc<_Period>(__buf, __n);
2159 template<
typename _CharT,
typename _Traits,
2160 typename _Rep,
typename _Period>
2161 inline basic_ostream<_CharT, _Traits>&
2163 const duration<_Rep, _Period>& __d)
2165 using period =
typename _Period::type;
2166 char __buf[
sizeof(
"[/]s") + 2 * numeric_limits<intmax_t>::digits10];
2169 __s.imbue(__os.
getloc());
2172 __s << __detail::__units_suffix<period, _CharT>(__buf,
sizeof(__buf));
2183_GLIBCXX_END_NAMESPACE_VERSION
duration< int64_t > seconds
seconds
duration< int64_t, ratio< 3600 > > hours
hours
duration< int64_t, ratio< 86400 > > days
days
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)
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)
duration< int64_t, ratio< 2629746 > > months
months
duration< int64_t, ratio< 31556952 > > years
years
constexpr complex< _Tp > operator-(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x minus y.
constexpr complex< _Tp > operator+(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x plus y.
_Tp abs(const complex< _Tp > &)
Return magnitude of z.
constexpr complex< _Tp > operator/(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x divided by y.
typename common_type< _Tp... >::type common_type_t
Alias template for common_type.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
constexpr const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
constexpr const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
ISO C++ entities toplevel namespace is std.
std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const bitset< _Nb > &__x)
Global I/O operators for bitsets.
Implementation details not part of the namespace std interface.
Template class basic_ostream.
Controlling output for std::string.
chrono::time_point represents a point in time as measured by a clock
streamsize precision() const
Flags access.
fmtflags flags() const
Access to format flags.
locale getloc() const
Locale access.