30 #ifndef _GLIBCXX_CHRONO
31 #define _GLIBCXX_CHRONO 1
33 #pragma GCC system_header
35 #if __cplusplus < 201103L
44 #if __cplusplus > 201703L
49 namespace std _GLIBCXX_VISIBILITY(default)
51 _GLIBCXX_BEGIN_NAMESPACE_VERSION
53 #if __cplusplus >= 201703L
54 namespace filesystem {
struct __file_clock; };
70 template<
typename _Rep,
typename _Period = ratio<1>>
73 template<
typename _Clock,
typename _Dur =
typename _Clock::duration>
81 template<
typename _CT,
typename _Period1,
typename _Period2,
typename =
void>
82 struct __duration_common_type
85 template<
typename _CT,
typename _Period1,
typename _Period2>
86 struct __duration_common_type<_CT, _Period1, _Period2,
87 __void_t<typename _CT::type>>
90 using __gcd_num = __static_gcd<_Period1::num, _Period2::num>;
91 using __gcd_den = __static_gcd<_Period1::den, _Period2::den>;
92 using __cr =
typename _CT::type;
93 using __r = ratio<__gcd_num::value,
94 (_Period1::den / __gcd_den::value) * _Period2::den>;
97 using type = chrono::duration<__cr, typename __r::type>;
104 template<
typename _Rep1,
typename _Period1,
typename _Rep2,
typename _Period2>
107 : __duration_common_type<common_type<_Rep1, _Rep2>,
108 typename _Period1::type,
109 typename _Period2::type>
114 template<
typename _Rep,
typename _Period>
119 typename _Period::type>;
124 template<
typename _Rep,
typename _Period>
128 typename _Period::type>;
135 template<
typename _CT,
typename _Clock,
typename =
void>
136 struct __timepoint_common_type
139 template<
typename _CT,
typename _Clock>
140 struct __timepoint_common_type<_CT, _Clock, __void_t<typename _CT::type>>
142 using type = chrono::time_point<_Clock, typename _CT::type>;
149 template<
typename _Clock,
typename _Duration1,
typename _Duration2>
152 : __timepoint_common_type<common_type<_Duration1, _Duration2>, _Clock>
157 template<
typename _Clock,
typename _Duration>
164 template<
typename _Clock,
typename _Duration>
178 template<
typename _ToDur,
typename _CF,
typename _CR,
179 bool _NumIsOne =
false,
bool _DenIsOne =
false>
180 struct __duration_cast_impl
182 template<
typename _Rep,
typename _Period>
183 static constexpr _ToDur
184 __cast(
const duration<_Rep, _Period>& __d)
186 typedef typename _ToDur::rep __to_rep;
187 return _ToDur(
static_cast<__to_rep
>(
static_cast<_CR
>(__d.count())
188 *
static_cast<_CR
>(_CF::num)
189 /
static_cast<_CR
>(_CF::den)));
193 template<
typename _ToDur,
typename _CF,
typename _CR>
194 struct __duration_cast_impl<_ToDur, _CF, _CR, true, true>
196 template<
typename _Rep,
typename _Period>
197 static constexpr _ToDur
198 __cast(
const duration<_Rep, _Period>& __d)
200 typedef typename _ToDur::rep __to_rep;
201 return _ToDur(
static_cast<__to_rep
>(__d.count()));
205 template<
typename _ToDur,
typename _CF,
typename _CR>
206 struct __duration_cast_impl<_ToDur, _CF, _CR, true, false>
208 template<
typename _Rep,
typename _Period>
209 static constexpr _ToDur
210 __cast(
const duration<_Rep, _Period>& __d)
212 typedef typename _ToDur::rep __to_rep;
213 return _ToDur(
static_cast<__to_rep
>(
214 static_cast<_CR
>(__d.count()) /
static_cast<_CR
>(_CF::den)));
218 template<
typename _ToDur,
typename _CF,
typename _CR>
219 struct __duration_cast_impl<_ToDur, _CF, _CR, false, true>
221 template<
typename _Rep,
typename _Period>
222 static constexpr _ToDur
223 __cast(
const duration<_Rep, _Period>& __d)
225 typedef typename _ToDur::rep __to_rep;
226 return _ToDur(
static_cast<__to_rep
>(
227 static_cast<_CR
>(__d.count()) *
static_cast<_CR
>(_CF::num)));
231 template<
typename _Tp>
236 template<
typename _Rep,
typename _Period>
237 struct __is_duration<duration<_Rep, _Period>>
241 template<
typename _Tp>
242 using __enable_if_is_duration
243 =
typename enable_if<__is_duration<_Tp>::value, _Tp>::type;
245 template<
typename _Tp>
246 using __disable_if_is_duration
247 =
typename enable_if<!__is_duration<_Tp>::value, _Tp>::type;
252 template<
typename _ToDur,
typename _Rep,
typename _Period>
253 constexpr __enable_if_is_duration<_ToDur>
256 typedef typename _ToDur::period __to_period;
257 typedef typename _ToDur::rep __to_rep;
261 typedef __duration_cast_impl<_ToDur, __cf, __cr,
262 __cf::num == 1, __cf::den == 1> __dc;
263 return __dc::__cast(__d);
267 template<
typename _Rep>
272 #if __cplusplus > 201402L
273 template <
typename _Rep>
274 inline constexpr
bool treat_as_floating_point_v =
278 #if __cplusplus > 201703L
279 template<
typename _Tp>
282 template<
typename _Tp>
283 inline constexpr
bool is_clock_v = is_clock<_Tp>::value;
285 #if __cpp_lib_concepts
286 template<
typename _Tp>
290 template<
typename _Tp>
293 typename _Tp::period;
294 typename _Tp::duration;
295 typename _Tp::time_point::clock;
296 typename _Tp::time_point::duration;
297 { &_Tp::is_steady } -> same_as<const bool*>;
298 { _Tp::now() } -> same_as<typename _Tp::time_point>;
299 requires same_as<
typename _Tp::duration,
300 duration<typename _Tp::rep, typename _Tp::period>>;
301 requires same_as<
typename _Tp::time_point::duration,
302 typename _Tp::duration>;
307 template<
typename _Tp,
typename =
void>
311 template<
typename _Tp>
312 struct __is_clock_impl<_Tp,
313 void_t<typename _Tp::rep, typename _Tp::period,
314 typename _Tp::duration,
315 typename _Tp::time_point::duration,
316 decltype(_Tp::is_steady),
317 decltype(_Tp::now())>>
318 : __and_<is_same<typename _Tp::duration,
319 duration<typename _Tp::rep, typename _Tp::period>>,
320 is_same<typename _Tp::time_point::duration,
321 typename _Tp::duration>,
322 is_same<decltype(&_Tp::is_steady), const bool*>,
323 is_same<decltype(_Tp::now()), typename _Tp::time_point>>::type
326 template<
typename _Tp>
327 struct is_clock : __is_clock_impl<_Tp>::type
332 #if __cplusplus >= 201703L
333 # define __cpp_lib_chrono 201611
335 template<
typename _ToDur,
typename _Rep,
typename _Period>
336 constexpr __enable_if_is_duration<_ToDur>
337 floor(
const duration<_Rep, _Period>& __d)
339 auto __to = chrono::duration_cast<_ToDur>(__d);
341 return __to - _ToDur{1};
345 template<
typename _ToDur,
typename _Rep,
typename _Period>
346 constexpr __enable_if_is_duration<_ToDur>
347 ceil(
const duration<_Rep, _Period>& __d)
349 auto __to = chrono::duration_cast<_ToDur>(__d);
351 return __to + _ToDur{1};
355 template <
typename _ToDur,
typename _Rep,
typename _Period>
357 __and_<__is_duration<_ToDur>,
358 __not_<treat_as_floating_point<typename _ToDur::rep>>>::value,
360 round(
const duration<_Rep, _Period>& __d)
362 _ToDur __t0 = chrono::floor<_ToDur>(__d);
363 _ToDur __t1 = __t0 + _ToDur{1};
364 auto __diff0 = __d - __t0;
365 auto __diff1 = __t1 - __d;
366 if (__diff0 == __diff1)
368 if (__t0.count() & 1)
372 else if (__diff0 < __diff1)
377 template<
typename _Rep,
typename _Period>
379 enable_if_t<numeric_limits<_Rep>::is_signed, duration<_Rep, _Period>>
380 abs(duration<_Rep, _Period> __d)
382 if (__d >= __d.zero())
389 template<
typename _Rep>
392 static constexpr _Rep
396 static constexpr _Rep
400 static constexpr _Rep
407 template<
typename _Tp>
412 template<
intmax_t _Num,
intmax_t _Den>
413 struct __is_ratio<
ratio<_Num, _Den>>
420 template<
typename _Rep,
typename _Period>
424 template<
typename _Rep2>
427 static constexpr intmax_t
428 _S_gcd(intmax_t __m, intmax_t __n) noexcept
432 return (__m == 0) ? __n : (__n == 0) ? __m : _S_gcd(__n, __m % __n);
439 template<
typename _R1,
typename _R2,
440 intmax_t __gcd1 = _S_gcd(_R1::num, _R2::num),
441 intmax_t __gcd2 = _S_gcd(_R1::den, _R2::den)>
442 using __divide =
ratio<(_R1::num / __gcd1) * (_R2::den / __gcd2),
443 (_R1::den / __gcd2) * (_R2::num / __gcd1)>;
446 template<
typename _Period2>
453 using period =
typename _Period::type;
455 static_assert(!__is_duration<_Rep>::value,
"rep cannot be a duration");
456 static_assert(__is_ratio<_Period>::value,
457 "period must be a specialization of ratio");
458 static_assert(_Period::num > 0,
"period must be positive");
467 template<
typename _Rep2,
typename = _Require<
469 __or_<__is_float<rep>, __not_<__is_float<_Rep2>>>>>
470 constexpr
explicit duration(
const _Rep2& __rep)
471 : __r(
static_cast<rep
>(__rep)) { }
473 template<
typename _Rep2,
typename _Period2,
typename = _Require<
475 __or_<__is_float<rep>,
476 __and_<__is_harmonic<_Period2>,
477 __not_<__is_float<_Rep2>>>>>>
479 : __r(duration_cast<duration>(__d).count()) { }
536 operator*=(
const rep& __rhs)
543 operator/=(
const rep& __rhs)
550 template<
typename _Rep2 = rep>
554 operator%=(
const rep& __rhs)
560 template<
typename _Rep2 = rep>
590 template<
typename _Rep1,
typename _Period1,
591 typename _Rep2,
typename _Period2>
600 return __cd(__cd(__lhs).count() + __cd(__rhs).count());
604 template<
typename _Rep1,
typename _Period1,
605 typename _Rep2,
typename _Period2>
614 return __cd(__cd(__lhs).count() - __cd(__rhs).count());
625 template<
typename _Rep1,
typename _Rep2,
627 using __common_rep_t =
typename
635 template<
typename _Rep1,
typename _Period,
typename _Rep2>
641 return __cd(__cd(__d).count() * __s);
645 template<
typename _Rep1,
typename _Rep2,
typename _Period>
648 {
return __d * __s; }
650 template<
typename _Rep1,
typename _Period,
typename _Rep2>
657 return __cd(__cd(__d).count() / __s);
660 template<
typename _Rep1,
typename _Period1,
661 typename _Rep2,
typename _Period2>
663 operator/(
const duration<_Rep1, _Period1>& __lhs,
664 const duration<_Rep2, _Period2>& __rhs)
666 typedef duration<_Rep1, _Period1> __dur1;
667 typedef duration<_Rep2, _Period2> __dur2;
669 return __cd(__lhs).count() / __cd(__rhs).count();
673 template<
typename _Rep1,
typename _Period,
typename _Rep2>
675 duration<__common_rep_t<_Rep1, __disable_if_is_duration<_Rep2>>, _Period>
676 operator%(
const duration<_Rep1, _Period>& __d,
const _Rep2& __s)
678 typedef duration<typename common_type<_Rep1, _Rep2>::type, _Period>
680 return __cd(__cd(__d).count() % __s);
683 template<
typename _Rep1,
typename _Period1,
684 typename _Rep2,
typename _Period2>
685 constexpr
typename common_type<duration<_Rep1, _Period1>,
686 duration<_Rep2, _Period2>>::type
687 operator%(
const duration<_Rep1, _Period1>& __lhs,
688 const duration<_Rep2, _Period2>& __rhs)
690 typedef duration<_Rep1, _Period1> __dur1;
691 typedef duration<_Rep2, _Period2> __dur2;
692 typedef typename common_type<__dur1,__dur2>::type __cd;
693 return __cd(__cd(__lhs).count() % __cd(__rhs).count());
698 template<
typename _Rep1,
typename _Period1,
699 typename _Rep2,
typename _Period2>
701 operator==(
const duration<_Rep1, _Period1>& __lhs,
702 const duration<_Rep2, _Period2>& __rhs)
704 typedef duration<_Rep1, _Period1> __dur1;
705 typedef duration<_Rep2, _Period2> __dur2;
706 typedef typename common_type<__dur1,__dur2>::type __ct;
707 return __ct(__lhs).count() == __ct(__rhs).count();
710 template<
typename _Rep1,
typename _Period1,
711 typename _Rep2,
typename _Period2>
713 operator<(
const duration<_Rep1, _Period1>& __lhs,
714 const duration<_Rep2, _Period2>& __rhs)
716 typedef duration<_Rep1, _Period1> __dur1;
717 typedef duration<_Rep2, _Period2> __dur2;
718 typedef typename common_type<__dur1,__dur2>::type __ct;
719 return __ct(__lhs).count() < __ct(__rhs).count();
722 #if __cpp_lib_three_way_comparison
723 template<
typename _Rep1,
typename _Period1,
724 typename _Rep2,
typename _Period2>
725 requires three_way_comparable<common_type_t<_Rep1, _Rep2>>
727 operator<=>(
const duration<_Rep1, _Period1>& __lhs,
728 const duration<_Rep2, _Period2>& __rhs)
730 using __ct = common_type_t<duration<_Rep1, _Period1>,
731 duration<_Rep2, _Period2>>;
732 return __ct(__lhs).count() <=> __ct(__rhs).count();
735 template<
typename _Rep1,
typename _Period1,
736 typename _Rep2,
typename _Period2>
738 operator!=(
const duration<_Rep1, _Period1>& __lhs,
739 const duration<_Rep2, _Period2>& __rhs)
740 {
return !(__lhs == __rhs); }
743 template<
typename _Rep1,
typename _Period1,
744 typename _Rep2,
typename _Period2>
746 operator<=(
const duration<_Rep1, _Period1>& __lhs,
747 const duration<_Rep2, _Period2>& __rhs)
748 {
return !(__rhs < __lhs); }
750 template<
typename _Rep1,
typename _Period1,
751 typename _Rep2,
typename _Period2>
753 operator>(
const duration<_Rep1, _Period1>& __lhs,
754 const duration<_Rep2, _Period2>& __rhs)
755 {
return __rhs < __lhs; }
757 template<
typename _Rep1,
typename _Period1,
758 typename _Rep2,
typename _Period2>
760 operator>=(
const duration<_Rep1, _Period1>& __lhs,
761 const duration<_Rep2, _Period2>& __rhs)
762 {
return !(__lhs < __rhs); }
766 #ifdef _GLIBCXX_USE_C99_STDINT_TR1
767 # define _GLIBCXX_CHRONO_INT64_T int64_t
768 #elif defined __INT64_TYPE__
769 # define _GLIBCXX_CHRONO_INT64_T __INT64_TYPE__
772 "Representation type for nanoseconds must have at least 64 bits");
773 # define _GLIBCXX_CHRONO_INT64_T long long
794 #if __cplusplus > 201703L
808 #undef _GLIBCXX_CHRONO_INT64_T
811 template<
typename _Clock,
typename _Dur>
814 static_assert(__is_duration<_Dur>::value,
815 "duration must be a specialization of std::chrono::duration");
817 typedef _Clock clock;
818 typedef _Dur duration;
819 typedef typename duration::rep rep;
820 typedef typename duration::period period;
822 constexpr
time_point() : __d(duration::zero())
825 constexpr
explicit time_point(
const duration& __dur)
830 template<
typename _Dur2,
831 typename = _Require<is_convertible<_Dur2, _Dur>>>
833 : __d(__t.time_since_epoch())
838 time_since_epoch()
const
843 operator+=(
const duration& __dur)
850 operator-=(
const duration& __dur)
870 template<
typename _ToDur,
typename _Clock,
typename _Dur>
876 return __time_point(duration_cast<_ToDur>(__t.time_since_epoch()));
879 #if __cplusplus > 201402L
880 template<
typename _ToDur,
typename _Clock,
typename _Dur>
883 floor(
const time_point<_Clock, _Dur>& __tp)
885 return time_point<_Clock, _ToDur>{
886 chrono::floor<_ToDur>(__tp.time_since_epoch())};
889 template<
typename _ToDur,
typename _Clock,
typename _Dur>
891 enable_if_t<__is_duration<_ToDur>::value, time_point<_Clock, _ToDur>>
892 ceil(
const time_point<_Clock, _Dur>& __tp)
894 return time_point<_Clock, _ToDur>{
895 chrono::ceil<_ToDur>(__tp.time_since_epoch())};
898 template<
typename _ToDur,
typename _Clock,
typename _Dur>
900 __and_<__is_duration<_ToDur>,
901 __not_<treat_as_floating_point<typename _ToDur::rep>>>::value,
902 time_point<_Clock, _ToDur>>
903 round(
const time_point<_Clock, _Dur>& __tp)
905 return time_point<_Clock, _ToDur>{
906 chrono::round<_ToDur>(__tp.time_since_epoch())};
913 template<
typename _Clock,
typename _Dur1,
914 typename _Rep2,
typename _Period2>
915 constexpr time_point<_Clock,
916 typename common_type<_Dur1, duration<_Rep2, _Period2>>::type>
918 const duration<_Rep2, _Period2>& __rhs)
920 typedef duration<_Rep2, _Period2> __dur2;
923 return __time_point(__lhs.time_since_epoch() + __rhs);
927 template<
typename _Rep1,
typename _Period1,
928 typename _Clock,
typename _Dur2>
934 typedef duration<_Rep1, _Period1> __dur1;
937 return __time_point(__rhs.time_since_epoch() + __lhs);
941 template<
typename _Clock,
typename _Dur1,
942 typename _Rep2,
typename _Period2>
946 const duration<_Rep2, _Period2>& __rhs)
948 typedef duration<_Rep2, _Period2> __dur2;
951 return __time_point(__lhs.time_since_epoch() -__rhs);
959 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
963 {
return __lhs.time_since_epoch() - __rhs.time_since_epoch(); }
965 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
969 {
return __lhs.time_since_epoch() == __rhs.time_since_epoch(); }
971 #if __cpp_lib_three_way_comparison
972 template<
typename _Clock,
typename _Dur1,
973 three_way_comparable_with<_Dur1> _Dur2>
975 operator<=>(
const time_point<_Clock, _Dur1>& __lhs,
976 const time_point<_Clock, _Dur2>& __rhs)
977 {
return __lhs.time_since_epoch() <=> __rhs.time_since_epoch(); }
979 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
981 operator!=(
const time_point<_Clock, _Dur1>& __lhs,
982 const time_point<_Clock, _Dur2>& __rhs)
983 {
return !(__lhs == __rhs); }
986 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
988 operator<(
const time_point<_Clock, _Dur1>& __lhs,
989 const time_point<_Clock, _Dur2>& __rhs)
990 {
return __lhs.time_since_epoch() < __rhs.time_since_epoch(); }
992 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
994 operator<=(
const time_point<_Clock, _Dur1>& __lhs,
995 const time_point<_Clock, _Dur2>& __rhs)
996 {
return !(__rhs < __lhs); }
998 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1000 operator>(
const time_point<_Clock, _Dur1>& __lhs,
1001 const time_point<_Clock, _Dur2>& __rhs)
1002 {
return __rhs < __lhs; }
1004 template<
typename _Clock,
typename _Dur1,
typename _Dur2>
1006 operator>=(
const time_point<_Clock, _Dur1>& __lhs,
1007 const time_point<_Clock, _Dur2>& __rhs)
1008 {
return !(__lhs < __rhs); }
1030 inline namespace _V2 {
1041 typedef duration::rep rep;
1042 typedef duration::period period;
1045 static_assert(system_clock::duration::min()
1046 < system_clock::duration::zero(),
1047 "a clock's minimum duration cannot be less than its epoch");
1049 static constexpr
bool is_steady =
false;
1058 return std::time_t(duration_cast<chrono::seconds>
1059 (__t.time_since_epoch()).count());
1063 from_time_t(std::time_t __t) noexcept
1066 return time_point_cast<system_clock::duration>
1081 typedef duration::rep rep;
1082 typedef duration::period period;
1085 static constexpr
bool is_steady =
true;
1104 #if __cplusplus > 201703L
1105 template<
typename _Duration>
1107 using sys_seconds = sys_time<seconds>;
1108 using sys_days = sys_time<days>;
1110 using file_clock = ::std::filesystem::__file_clock;
1112 template<
typename _Duration>
1116 template<>
struct is_clock<steady_clock> :
true_type { };
1117 template<>
struct is_clock<file_clock> :
true_type { };
1119 template<>
inline constexpr
bool is_clock_v<system_clock> =
true;
1120 template<>
inline constexpr
bool is_clock_v<steady_clock> =
true;
1121 template<>
inline constexpr
bool is_clock_v<file_clock> =
true;
1124 template<
typename _Duration>
1125 using local_time = time_point<local_t, _Duration>;
1126 using local_seconds = local_time<seconds>;
1127 using local_days = local_time<days>;
1133 #if __cplusplus > 201103L
1135 #define __cpp_lib_chrono_udls 201304
1137 inline namespace literals
1162 inline namespace chrono_literals
1164 #pragma GCC diagnostic push
1165 #pragma GCC diagnostic ignored "-Wliteral-suffix"
1167 template<
typename _Dur,
char... _Digits>
1168 constexpr _Dur __check_overflow()
1170 using _Val = __parse_int::_Parse_int<_Digits...>;
1171 constexpr
typename _Dur::rep __repval = _Val::value;
1172 static_assert(__repval >= 0 && __repval == _Val::value,
1173 "literal value cannot be represented by duration type");
1174 return _Dur(__repval);
1180 operator""h(
long double __hours)
1184 template <
char... _Digits>
1191 operator""min(
long double __mins)
1195 template <
char... _Digits>
1202 operator""s(
long double __secs)
1206 template <
char... _Digits>
1213 operator""ms(
long double __msecs)
1217 template <
char... _Digits>
1224 operator""us(
long double __usecs)
1228 template <
char... _Digits>
1235 operator""ns(
long double __nsecs)
1239 template <
char... _Digits>
1244 #pragma GCC diagnostic pop
1250 using namespace literals::chrono_literals;
1253 #if __cplusplus >= 201703L
1254 namespace filesystem
1259 using rep = duration::rep;
1260 using period = duration::period;
1261 using time_point = chrono::time_point<__file_clock>;
1262 static constexpr
bool is_steady =
false;
1266 {
return _S_from_sys(chrono::system_clock::now()); }
1268 #if __cplusplus > 201703L
1269 template<
typename _Dur>
1271 chrono::file_time<_Dur>
1272 from_sys(
const chrono::sys_time<_Dur>& __t) noexcept
1273 {
return _S_from_sys(__t); }
1276 template<
typename _Dur>
1278 chrono::sys_time<_Dur>
1279 to_sys(
const chrono::file_time<_Dur>& __t) noexcept
1280 {
return _S_to_sys(__t); }
1284 using __sys_clock = chrono::system_clock;
1293 template<
typename _Dur>
1295 chrono::time_point<__file_clock, _Dur>
1296 _S_from_sys(
const chrono::time_point<__sys_clock, _Dur>& __t) noexcept
1298 using __file_time = chrono::time_point<__file_clock, _Dur>;
1299 return __file_time{__t.time_since_epoch()} - _S_epoch_diff;
1303 template<
typename _Dur>
1305 chrono::time_point<__sys_clock, _Dur>
1306 _S_to_sys(
const chrono::time_point<__file_clock, _Dur>& __t) noexcept
1308 using __sys_time = chrono::time_point<__sys_clock, _Dur>;
1309 return __sys_time{__t.time_since_epoch()} + _S_epoch_diff;
1316 _GLIBCXX_END_NAMESPACE_VERSION
constexpr duration< __common_rep_t< _Rep2, _Rep1 >, _Period > operator*(const _Rep1 &__s, const duration< _Rep2, _Period > &__d)
Multiply a duration by a scalar value.
duration< int64_t, milli > milliseconds
milliseconds
constexpr enable_if< __is_duration< _ToDur >::value, time_point< _Clock, _ToDur > >::type time_point_cast(const time_point< _Clock, _Dur > &__t)
time_point_cast
constexpr time_point< _Clock, typename common_type< _Dur1, duration< _Rep2, _Period2 > >::type > operator-(const time_point< _Clock, _Dur1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
Adjust a time point backwards by the given duration.
constexpr __enable_if_is_duration< _ToDur > duration_cast(const duration< _Rep, _Period > &__d)
duration_cast
constexpr common_type< duration< _Rep1, _Period1 >, duration< _Rep2, _Period2 > >::type operator-(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
The difference between two durations.
duration< int64_t, ratio< 3600 > > hours
hours
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< 60 > > minutes
minutes
constexpr common_type< duration< _Rep1, _Period1 >, duration< _Rep2, _Period2 > >::type operator+(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr 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.
duration< int64_t, nano > nanoseconds
nanoseconds
constexpr common_type< _Dur1, _Dur2 >::type operator-(const time_point< _Clock, _Dur1 > &__lhs, const time_point< _Clock, _Dur2 > &__rhs)
constexpr duration< __common_rep_t< _Rep1, _Rep2 >, _Period > operator*(const duration< _Rep1, _Period > &__d, const _Rep2 &__s)
duration< int64_t, micro > microseconds
microseconds
duration< int64_t > seconds
seconds
constexpr complex< _Tp > operator/(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x divided by y.
_Tp abs(const complex< _Tp > &)
Return magnitude of z.
typename __ratio_divide< _R1, _R2 >::type ratio_divide
ratio_divide
void void_t
A metafunction that always yields void, used for detecting valid types.
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
typename enable_if< _Cond, _Tp >::type enable_if_t
Alias template for enable_if.
integral_constant< bool, false > false_type
The type used as a compile-time boolean with false value.
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.