Lines Matching refs:duration

25 duration_cast(const duration<Rep, Period>& fd);
41 // duration
44 class duration
46 static_assert(!__is_duration<Rep>::value, "A duration representation can not be a duration");
47 …static_assert(__is_ratio<Period>::value, "Second template parameter of duration must be a std::rat…
48 static_assert(Period::num > 0, "duration period must be positive");
53 constexpr duration() = default;
55 constexpr explicit duration(const Rep2& r,
65 constexpr duration(const duration<Rep2, Period2>& d,
78 constexpr duration operator+() const;
79 constexpr duration operator-() const;
80 constexpr duration& operator++();
81 constexpr duration operator++(int);
82 constexpr duration& operator--();
83 constexpr duration operator--(int);
85 constexpr duration& operator+=(const duration& d);
86 constexpr duration& operator-=(const duration& d);
88 duration& operator*=(const rep& rhs);
89 duration& operator/=(const rep& rhs);
93 static constexpr duration zero();
94 static constexpr duration min();
95 static constexpr duration max();
98 typedef duration<long long, nano> nanoseconds;
99 typedef duration<long long, micro> microseconds;
100 typedef duration<long long, milli> milliseconds;
101 typedef duration<long long > seconds;
102 typedef duration< long, ratio< 60> > minutes;
103 typedef duration< long, ratio<3600> > hours;
105 template <class Clock, class Duration = typename Clock::duration>
110 typedef Duration duration;
111 typedef typename duration::rep rep;
112 typedef typename duration::period period;
114 duration d_; // exposition only
118 explicit time_point(const duration& d); // same as time_point() + d // constexpr in C++14
126 duration time_since_epoch() const; // constexpr in C++14
130 time_point& operator+=(const duration& d);
131 time_point& operator-=(const duration& d);
143 struct common_type<chrono::duration<Rep1, Period1>, chrono::duration<Rep2, Period2>>;
150 // duration arithmetic
153 typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2>>::type
154 operator+(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
157 typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2>>::type
158 operator-(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
161 duration<typename common_type<Rep1, Rep2>::type, Period>
162 operator*(const duration<Rep1, Period>& d, const Rep2& s);
165 duration<typename common_type<Rep1, Rep2>::type, Period>
166 operator*(const Rep1& s, const duration<Rep2, Period>& d);
169 duration<typename common_type<Rep1, Rep2>::type, Period>
170 operator/(const duration<Rep1, Period>& d, const Rep2& s);
174 operator/(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
176 // duration comparisons
179 bool operator==(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
182 bool operator!=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
185 bool operator< (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
188 bool operator<=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
191 bool operator> (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
194 bool operator>=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
198 ToDuration duration_cast(const duration<Rep, Period>& d);
201 constexpr ToDuration floor(const duration<Rep, Period>& d); // C++17
203 constexpr ToDuration ceil(const duration<Rep, Period>& d); // C++17
205 constexpr ToDuration round(const duration<Rep, Period>& d); // C++17
209 time_point<Clock, typename common_type<Duration1, duration<Rep2, Period2>>::type>
210 operator+(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs);
212 time_point<Clock, typename common_type<duration<Rep1, Period1>, Duration2>::type>
213 operator+(const duration<Rep1, Period1>& lhs, const time_point<Clock, Duration2>& rhs);
215 time_point<Clock, typename common_type<Duration1, duration<Rep2, Period2>>::type>
216 operator-(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs);
253 constexpr duration<Rep, Period> abs(duration<Rep, Period> d); // C++17
259 typedef microseconds duration;
260 typedef duration::rep rep;
261 typedef duration::period period;
273 typedef nanoseconds duration;
274 typedef duration::rep rep;
275 typedef duration::period period;
276 typedef chrono::time_point<steady_clock, duration> time_point;
287 constexpr chrono::duration<unspecified , ratio<3600,1>> operator "" h(long double); // C++14
289 constexpr chrono::duration<unspecified , ratio<60,1>> operator "" min(long double); // C++14
291 constexpr chrono::duration<unspecified > operator "" s(long double); // C++14
293 constexpr chrono::duration<unspecified , milli> operator "" ms(long double); // C++14
295 constexpr chrono::duration<unspecified , micro> operator "" us(long double); // C++14
297 constexpr chrono::duration<unspecified , nano> operator "" ns(long double); // C++14
319 template <class _Rep, class _Period = ratio<1> > class _LIBCPP_TEMPLATE_VIS duration;
325 struct __is_duration<duration<_Rep, _Period> > : true_type {};
328 struct __is_duration<const duration<_Rep, _Period> > : true_type {};
331 struct __is_duration<volatile duration<_Rep, _Period> > : true_type {};
334 struct __is_duration<const volatile duration<_Rep, _Period> > : true_type {};
339 struct _LIBCPP_TEMPLATE_VIS common_type<chrono::duration<_Rep1, _Period1>,
340 chrono::duration<_Rep2, _Period2> >
342 typedef chrono::duration<typename common_type<_Rep1, _Rep2>::type,
411 duration_cast(const duration<_Rep, _Period>& __fd)
413 return __duration_cast<duration<_Rep, _Period>, _ToDuration>()(__fd);
441 floor(const duration<_Rep, _Period>& __d)
456 ceil(const duration<_Rep, _Period>& __d)
471 round(const duration<_Rep, _Period>& __d)
485 // duration
488 class _LIBCPP_TEMPLATE_VIS duration
490 static_assert(!__is_duration<_Rep>::value, "A duration representation can not be a duration");
491 …static_assert(__is_ratio<_Period>::value, "Second template parameter of duration must be a std::ra…
492 static_assert(_Period::num > 0, "duration period must be positive");
533 duration() = default;
535 duration() {}
540 explicit duration(const _Rep2& __r,
552 duration(const duration<_Rep2, _Period2>& __d,
560 : __rep_(_VSTD::chrono::duration_cast<duration>(__d).count()) {}
568 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR duration operator+() const {return *this;}
569 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR duration operator-() const {return duration(-__rep_);}
570 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator++() {++__rep_; ret…
571 …IBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration operator++(int) {return duration
572 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator--() {--__rep_; ret…
573 …IBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration operator--(int) {return duration
575 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator+=(const duration& __d) …
576 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator-=(const duration& __d) …
578 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator*=(const rep& rhs) {__re…
579 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator/=(const rep& rhs) {__re…
580 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator%=(const rep& rhs) {__re…
581 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator%=(const duration& rhs) …
585 …_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR duration zero() {return duration(duration_value…
586 …_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR duration min() {return duration(duration_value…
587 …_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR duration max() {return duration(duration_value…
590 typedef duration<long long, nano> nanoseconds;
591 typedef duration<long long, micro> microseconds;
592 typedef duration<long long, milli> milliseconds;
593 typedef duration<long long > seconds;
594 typedef duration< long, ratio< 60> > minutes;
595 typedef duration< long, ratio<3600> > hours;
622 operator==(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
624 return __duration_eq<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >()(__lhs, __rhs);
633 operator!=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
663 operator< (const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
665 return __duration_lt<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >()(__lhs, __rhs);
674 operator> (const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
685 operator<=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
696 operator>=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
706 typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
707 operator+(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
709 typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd;
718 typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
719 operator-(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
721 typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd;
733 duration<typename common_type<_Rep1, _Rep2>::type, _Period>
735 operator*(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
738 typedef duration<_Cr, _Period> _Cd;
748 duration<typename common_type<_Rep1, _Rep2>::type, _Period>
750 operator*(const _Rep1& __s, const duration<_Rep2, _Period>& __d)
770 struct __duration_divide_imp<duration<_Rep1, _Period>, _Rep2, true>
772 typedef duration<typename common_type<_Rep1, _Rep2>::type, _Period> type;
776 struct __duration_divide_result<duration<_Rep1, _Period>, _Rep2, false>
777 : __duration_divide_imp<duration<_Rep1, _Period>, _Rep2>
784 typename __duration_divide_result<duration<_Rep1, _Period>, _Rep2>::type
785 operator/(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
788 typedef duration<_Cr, _Period> _Cd;
796 operator/(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
798 typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Ct;
807 typename __duration_divide_result<duration<_Rep1, _Period>, _Rep2>::type
808 operator%(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
811 typedef duration<_Cr, _Period> _Cd;
818 typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
819 operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
822 typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd;
830 template <class _Clock, class _Duration = typename _Clock::duration>
834 "Second template parameter of time_point must be a std::chrono::duration");
837 typedef _Duration duration;
838 typedef typename duration::rep rep;
839 typedef typename duration::period period;
841 duration __d_;
844 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 time_point() : __d_(duration::zero()) {}
845 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit time_point(const duration& __d) :…
853 is_convertible<_Duration2, duration>::value
859 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 duration time_since_epoch() const {return …
863 … _LIBCPP_INLINE_VISIBILITY time_point& operator+=(const duration& __d) {__d_ += __d; return *this;}
864 … _LIBCPP_INLINE_VISIBILITY time_point& operator-=(const duration& __d) {__d_ -= __d; return *this;}
868 …_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR time_point min() {return time_point(duration::m…
869 …_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR time_point max() {return time_point(duration::m…
933 duration<_Rep, _Period>
935 abs(duration<_Rep, _Period> __d)
1001 // time_point operator+(time_point x, duration y);
1005 time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type>
1006 operator+(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
1008 …typedef time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> _Tr;
1012 // time_point operator+(duration x, time_point y);
1016 time_point<_Clock, typename common_type<duration<_Rep1, _Period1>, _Duration2>::type>
1017 operator+(const duration<_Rep1, _Period1>& __lhs, const time_point<_Clock, _Duration2>& __rhs)
1022 // time_point operator-(time_point x, duration y);
1026 time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type>
1027 operator-(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
1029 …typedef time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> _Re…
1033 // duration operator-(time_point x, time_point y);
1050 typedef microseconds duration;
1051 typedef duration::rep rep;
1052 typedef duration::period period;
1065 typedef nanoseconds duration;
1066 typedef duration::rep rep;
1067 typedef duration::period period;
1068 typedef chrono::time_point<steady_clock, duration> time_point;
1082 // Suffixes for duration literals [time.duration.literals]
1093 constexpr chrono::duration<long double, ratio<3600,1>> operator"" h(long double __h)
1095 return chrono::duration<long double, ratio<3600,1>>(__h);
1104 constexpr chrono::duration<long double, ratio<60,1>> operator"" min(long double __m)
1106 return chrono::duration<long double, ratio<60,1>> (__m);
1115 constexpr chrono::duration<long double> operator"" s(long double __s)
1117 return chrono::duration<long double> (__s);
1126 constexpr chrono::duration<long double, milli> operator"" ms(long double __ms)
1128 return chrono::duration<long double, milli>(__ms);
1137 constexpr chrono::duration<long double, micro> operator"" us(long double __us)
1139 return chrono::duration<long double, micro> (__us);
1148 constexpr chrono::duration<long double, nano> operator"" ns(long double __ns)
1150 return chrono::duration<long double, nano> (__ns);