Lines Matching refs:duration
25 duration_cast(const duration<Rep, Period>& fd);
38 // duration
41 class duration
43 static_assert(!__is_duration<Rep>::value, "A duration representation can not be a duration");
44 …static_assert(__is_ratio<Period>::value, "Second template parameter of duration must be a std::rat…
45 static_assert(Period::num > 0, "duration period must be positive");
50 constexpr duration() = default;
52 constexpr explicit duration(const Rep2& r,
62 constexpr duration(const duration<Rep2, Period2>& d,
75 constexpr duration operator+() const;
76 constexpr duration operator-() const;
77 duration& operator++();
78 duration operator++(int);
79 duration& operator--();
80 duration operator--(int);
82 duration& operator+=(const duration& d);
83 duration& operator-=(const duration& d);
85 duration& operator*=(const rep& rhs);
86 duration& operator/=(const rep& rhs);
90 static constexpr duration zero();
91 static constexpr duration min();
92 static constexpr duration max();
95 typedef duration<long long, nano> nanoseconds;
96 typedef duration<long long, micro> microseconds;
97 typedef duration<long long, milli> milliseconds;
98 typedef duration<long long > seconds;
99 typedef duration< long, ratio< 60> > minutes;
100 typedef duration< long, ratio<3600> > hours;
102 template <class Clock, class Duration = typename Clock::duration>
107 typedef Duration duration;
108 typedef typename duration::rep rep;
109 typedef typename duration::period period;
111 duration d_; // exposition only
115 explicit time_point(const duration& d); // same as time_point() + d // constexpr in C++14
123 duration time_since_epoch() const; // constexpr in C++14
127 time_point& operator+=(const duration& d);
128 time_point& operator-=(const duration& d);
140 struct common_type<chrono::duration<Rep1, Period1>, chrono::duration<Rep2, Period2>>;
147 // duration arithmetic
150 typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2>>::type
151 operator+(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
154 typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2>>::type
155 operator-(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
158 duration<typename common_type<Rep1, Rep2>::type, Period>
159 operator*(const duration<Rep1, Period>& d, const Rep2& s);
162 duration<typename common_type<Rep1, Rep2>::type, Period>
163 operator*(const Rep1& s, const duration<Rep2, Period>& d);
166 duration<typename common_type<Rep1, Rep2>::type, Period>
167 operator/(const duration<Rep1, Period>& d, const Rep2& s);
171 operator/(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
173 // duration comparisons
176 bool operator==(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
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);
195 ToDuration duration_cast(const duration<Rep, Period>& d);
199 time_point<Clock, typename common_type<Duration1, duration<Rep2, Period2>>::type>
200 operator+(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs);
202 time_point<Clock, typename common_type<duration<Rep1, Period1>, Duration2>::type>
203 operator+(const duration<Rep1, Period1>& lhs, const time_point<Clock, Duration2>& rhs);
205 time_point<Clock, typename common_type<Duration1, duration<Rep2, Period2>>::type>
206 operator-(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs);
235 typedef microseconds duration;
236 typedef duration::rep rep;
237 typedef duration::period period;
249 typedef nanoseconds duration;
250 typedef duration::rep rep;
251 typedef duration::period period;
252 typedef chrono::time_point<steady_clock, duration> time_point;
263 constexpr chrono::duration<unspecified , ratio<3600,1>> operator "" h(long double); // C++14
265 constexpr chrono::duration<unspecified , ratio<60,1>> operator "" min(long double); // C++14
267 constexpr chrono::duration<unspecified > operator "" s(long double); // C++14
269 constexpr chrono::duration<unspecified , milli> operator "" ms(long double); // C++14
271 constexpr chrono::duration<unspecified , micro> operator "" us(long double); // C++14
273 constexpr chrono::duration<unspecified , nano> operator "" ns(long double); // C++14
295 template <class _Rep, class _Period = ratio<1> > class _LIBCPP_TYPE_VIS_ONLY duration;
301 struct __is_duration<duration<_Rep, _Period> > : true_type {};
304 struct __is_duration<const duration<_Rep, _Period> > : true_type {};
307 struct __is_duration<volatile duration<_Rep, _Period> > : true_type {};
310 struct __is_duration<const volatile duration<_Rep, _Period> > : true_type {};
315 struct _LIBCPP_TYPE_VIS_ONLY common_type<chrono::duration<_Rep1, _Period1>,
316 chrono::duration<_Rep2, _Period2> >
318 typedef chrono::duration<typename common_type<_Rep1, _Rep2>::type,
387 duration_cast(const duration<_Rep, _Period>& __fd)
389 return __duration_cast<duration<_Rep, _Period>, _ToDuration>()(__fd);
404 // duration
407 class _LIBCPP_TYPE_VIS_ONLY duration
409 static_assert(!__is_duration<_Rep>::value, "A duration representation can not be a duration");
410 …static_assert(__is_ratio<_Period>::value, "Second template parameter of duration must be a std::ra…
411 static_assert(_Period::num > 0, "duration period must be positive");
452 duration() = default;
454 duration() {}
459 explicit duration(const _Rep2& __r,
471 duration(const duration<_Rep2, _Period2>& __d,
479 : __rep_(_VSTD::chrono::duration_cast<duration>(__d).count()) {}
487 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR duration operator+() const {return *this;}
488 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR duration operator-() const {return duration(-__rep_);}
489 _LIBCPP_INLINE_VISIBILITY duration& operator++() {++__rep_; return *this;}
490 _LIBCPP_INLINE_VISIBILITY duration operator++(int) {return duration(__rep_++);}
491 _LIBCPP_INLINE_VISIBILITY duration& operator--() {--__rep_; return *this;}
492 _LIBCPP_INLINE_VISIBILITY duration operator--(int) {return duration(__rep_--);}
494 …_LIBCPP_INLINE_VISIBILITY duration& operator+=(const duration& __d) {__rep_ += __d.count(); return…
495 …_LIBCPP_INLINE_VISIBILITY duration& operator-=(const duration& __d) {__rep_ -= __d.count(); return…
497 _LIBCPP_INLINE_VISIBILITY duration& operator*=(const rep& rhs) {__rep_ *= rhs; return *this;}
498 _LIBCPP_INLINE_VISIBILITY duration& operator/=(const rep& rhs) {__rep_ /= rhs; return *this;}
499 _LIBCPP_INLINE_VISIBILITY duration& operator%=(const rep& rhs) {__rep_ %= rhs; return *this;}
500 …_LIBCPP_INLINE_VISIBILITY duration& operator%=(const duration& rhs) {__rep_ %= rhs.count(); return…
504 …_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR duration zero() {return duration(duration_value…
505 …_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR duration min() {return duration(duration_value…
506 …_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR duration max() {return duration(duration_value…
509 typedef duration<long long, nano> nanoseconds;
510 typedef duration<long long, micro> microseconds;
511 typedef duration<long long, milli> milliseconds;
512 typedef duration<long long > seconds;
513 typedef duration< long, ratio< 60> > minutes;
514 typedef duration< long, ratio<3600> > hours;
541 operator==(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
543 return __duration_eq<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >()(__lhs, __rhs);
552 operator!=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
582 operator< (const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
584 return __duration_lt<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >()(__lhs, __rhs);
593 operator> (const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
604 operator<=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
615 operator>=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
625 typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
626 operator+(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
628 typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd;
637 typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
638 operator-(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
640 typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd;
652 duration<typename common_type<_Rep1, _Rep2>::type, _Period>
654 operator*(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
657 typedef duration<_Cr, _Period> _Cd;
667 duration<typename common_type<_Rep1, _Rep2>::type, _Period>
669 operator*(const _Rep1& __s, const duration<_Rep2, _Period>& __d)
689 struct __duration_divide_imp<duration<_Rep1, _Period>, _Rep2, true>
691 typedef duration<typename common_type<_Rep1, _Rep2>::type, _Period> type;
695 struct __duration_divide_result<duration<_Rep1, _Period>, _Rep2, false>
696 : __duration_divide_imp<duration<_Rep1, _Period>, _Rep2>
703 typename __duration_divide_result<duration<_Rep1, _Period>, _Rep2>::type
704 operator/(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
707 typedef duration<_Cr, _Period> _Cd;
715 operator/(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
717 typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Ct;
726 typename __duration_divide_result<duration<_Rep1, _Period>, _Rep2>::type
727 operator%(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
730 typedef duration<_Cr, _Period> _Cd;
737 typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
738 operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
741 typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd;
749 template <class _Clock, class _Duration = typename _Clock::duration>
753 "Second template parameter of time_point must be a std::chrono::duration");
756 typedef _Duration duration;
757 typedef typename duration::rep rep;
758 typedef typename duration::period period;
760 duration __d_;
763 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 time_point() : __d_(duration::zero()) {}
764 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit time_point(const duration& __d) :…
772 is_convertible<_Duration2, duration>::value
778 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 duration time_since_epoch() const {return …
782 … _LIBCPP_INLINE_VISIBILITY time_point& operator+=(const duration& __d) {__d_ += __d; return *this;}
783 … _LIBCPP_INLINE_VISIBILITY time_point& operator-=(const duration& __d) {__d_ -= __d; return *this;}
787 …_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR time_point min() {return time_point(duration::m…
788 …_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR time_point max() {return time_point(duration::m…
870 // time_point operator+(time_point x, duration y);
874 time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type>
875 operator+(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
877 …typedef time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> _Tr;
881 // time_point operator+(duration x, time_point y);
885 time_point<_Clock, typename common_type<duration<_Rep1, _Period1>, _Duration2>::type>
886 operator+(const duration<_Rep1, _Period1>& __lhs, const time_point<_Clock, _Duration2>& __rhs)
891 // time_point operator-(time_point x, duration y);
895 time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type>
896 operator-(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
901 // duration operator-(time_point x, time_point y);
918 typedef microseconds duration;
919 typedef duration::rep rep;
920 typedef duration::period period;
932 typedef nanoseconds duration;
933 typedef duration::rep rep;
934 typedef duration::period period;
935 typedef chrono::time_point<steady_clock, duration> time_point;
946 // Suffixes for duration literals [time.duration.literals]
957 constexpr chrono::duration<long double, ratio<3600,1>> operator"" h(long double __h)
959 return chrono::duration<long double, ratio<3600,1>>(__h);
968 constexpr chrono::duration<long double, ratio<60,1>> operator"" min(long double __m)
970 return chrono::duration<long double, ratio<60,1>> (__m);
979 constexpr chrono::duration<long double> operator"" s(long double __s)
981 return chrono::duration<long double> (__s);
990 constexpr chrono::duration<long double, milli> operator"" ms(long double __ms)
992 return chrono::duration<long double, milli>(__ms);
1001 constexpr chrono::duration<long double, micro> operator"" us(long double __us)
1003 return chrono::duration<long double, micro> (__us);
1012 constexpr chrono::duration<long double, nano> operator"" ns(long double __ns)
1014 return chrono::duration<long double, nano> (__ns);