STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Typedefs | Functions | Variables
chrono Namespace Reference

Classes

struct  _Duration_div_mod
 
struct  _Duration_div_mod1
 
struct  _Duration_div_mod1< _CR, _Period1, _Rep2, false >
 
struct  _Duration_div_mod< _Rep1, _Period1, _Rep2, false >
 
struct  _Is_duration
 
struct  _Is_duration< duration< _Rep, _Period > >
 
struct  _Is_ratio
 
struct  _Is_ratio< ratio< _R1, _R2 > >
 
class  duration
 
struct  duration_values
 
struct  steady_clock
 
struct  system_clock
 
class  time_point
 
struct  treat_as_floating_point
 

Typedefs

template<class _Dur >
using _As_integral = duration< typename conditional< treat_as_floating_point< typename _Dur::rep >::value, intmax_t, typename _Dur::rep >::type, typename _Dur::period >
 
typedef duration< long long, nanonanoseconds
 
typedef duration< long long, micromicroseconds
 
typedef duration< long long, millimilliseconds
 
typedef duration< long longseconds
 
typedef duration< int, ratio< 60 > > minutes
 
typedef duration< int, ratio< 3600 > > hours
 
typedef steady_clock high_resolution_clock
 

Functions

template<class _To , class _Rep , class _Period >
constexpr enable_if< _Is_duration< _To >::value, _To >::type duration_cast (const duration< _Rep, _Period > &)
 
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr common_type< duration< _Rep1, _Period1 >, duration< _Rep2, _Period2 > >::type operator+ (const duration< _Rep1, _Period1 > &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr common_type< duration< _Rep1, _Period1 >, duration< _Rep2, _Period2 > >::type operator- (const duration< _Rep1, _Period1 > &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 >
constexpr enable_if< is_convertible< _Rep2, typename common_type< _Rep1, _Rep2 >::type >::value, duration< typename common_type< _Rep1, _Rep2 >::type, _Period1 > >::type operator* (const duration< _Rep1, _Period1 > &_Left, const _Rep2 &_Right)
 
template<class _Rep1 , class _Rep2 , class _Period2 >
constexpr enable_if< is_convertible< _Rep1, typename common_type< _Rep1, _Rep2 >::type >::value, duration< typename common_type< _Rep1, _Rep2 >::type, _Period2 > >::type operator* (const _Rep1 &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 >
_Duration_div_mod< _Rep1, _Period1, _Rep2 >::type constexpr operator/ (const duration< _Rep1, _Period1 > &_Left, const _Rep2 &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr common_type< _Rep1, _Rep2 >::type operator/ (const duration< _Rep1, _Period1 > &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 >
constexpr _Duration_div_mod< _Rep1, _Period1, _Rep2 >::type operator% (const duration< _Rep1, _Period1 > &_Left, const _Rep2 &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr common_type< duration< _Rep1, _Period1 >, duration< _Rep2, _Period2 > >::type operator% (const duration< _Rep1, _Period1 > &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr bool operator== (const duration< _Rep1, _Period1 > &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr bool operator!= (const duration< _Rep1, _Period1 > &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr bool operator< (const duration< _Rep1, _Period1 > &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr bool operator<= (const duration< _Rep1, _Period1 > &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr bool operator> (const duration< _Rep1, _Period1 > &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr bool operator>= (const duration< _Rep1, _Period1 > &_Left, const duration< _Rep2, _Period2 > &_Right)
 
template<class _Rep , class _Period , class _To_integral >
constexpr _To_integral _Floor (const duration< _Rep, _Period > &_Dur, const _To_integral &_Dur_integral)
 
template<class _To , class _Rep , class _Period >
constexpr enable_if< _Is_duration< _To >::value, _To >::type floor (const duration< _Rep, _Period > &_Dur)
 
template<class _Rep , class _Period , class _To_integral >
constexpr _To_integral _Ceil (const duration< _Rep, _Period > &_Dur, const _To_integral &_Dur_integral)
 
template<class _To , class _Rep , class _Period >
constexpr enable_if< _Is_duration< _To >::value, _To >::type ceil (const duration< _Rep, _Period > &_Dur)
 
template<class _Rep >
constexpr make_unsigned< _Rep >::type _Make_unsigned (_Rep _Val)
 
template<class _Rep >
constexpr bool _Is_even (_Rep _Val)
 
template<class _Rep >
constexpr _Rep _Bankers_divide_impl (_Rep _Truncated, _Rep _Mod, _Rep _Half_divisor, bool _Half_divisor_is_exact)
 
template<class _Rep >
constexpr _Rep _Bankers_divide_tag (_Rep _Dividend, _Rep _Divisor, false_type)
 
template<class _Rep >
constexpr _Rep _Bankers_divide_tag (_Rep _Dividend, _Rep _Divisor, true_type)
 
template<class _Rep >
constexpr _Rep _Bankers_divide (_Rep _Dividend, _Rep _Divisor)
 
template<class _Rep >
constexpr bool _Round_should_truncate (_Rep _Val, intmax_t _Val_trunc)
 
template<class _Rep >
constexpr intmax_t _Round_fp_non_negative (_Rep _Val, intmax_t _Val_trunc)
 
template<class _Rep >
constexpr intmax_t _Round_fp_non_negative (_Rep _Val)
 
template<class _Rep >
constexpr _Rep _Round_fp (_Rep _Val)
 
template<class _To , class _Rep , class _Period >
constexpr _To _Round (const duration< _Rep, _Period > &_Dur, false_type, false_type)
 
template<class _To , class _Rep , class _Period >
constexpr _To _Round (const duration< _Rep, _Period > &_Dur, false_type, true_type)
 
template<class _To , class _Rep , class _Period , class _Source_integral >
constexpr _To _Round (const duration< _Rep, _Period > &_Dur, true_type, _Source_integral)
 
template<class _To , class _Rep , class _Period >
constexpr enable_if< _Is_duration< _To >::value, _To >::type round (const duration< _Rep, _Period > &_Dur)
 
template<class _Rep , class _Period >
constexpr enable_if< numeric_limits< _Rep >::is_signed, duration< _Rep, _Period > >::type abs (const duration< _Rep, _Period > _Dur)
 
template<class _Clock , class _Duration , class _Rep , class _Period >
constexpr time_point< _Clock, typename common_type< _Duration, duration< _Rep, _Period > >::type > operator+ (const time_point< _Clock, _Duration > &_Left, const duration< _Rep, _Period > &_Right)
 
template<class _Rep , class _Period , class _Clock , class _Duration >
constexpr time_point< _Clock, typename common_type< duration< _Rep, _Period >, _Duration >::type > operator+ (const duration< _Rep, _Period > &_Left, const time_point< _Clock, _Duration > &_Right)
 
template<class _Clock , class _Duration , class _Rep , class _Period >
constexpr time_point< _Clock, typename common_type< _Duration, duration< _Rep, _Period > >::type > operator- (const time_point< _Clock, _Duration > &_Left, const duration< _Rep, _Period > &_Right)
 
template<class _Clock , class _Duration1 , class _Duration2 >
constexpr common_type< _Duration1, _Duration2 >::type operator- (const time_point< _Clock, _Duration1 > &_Left, const time_point< _Clock, _Duration2 > &_Right)
 
template<class _Clock , class _Duration1 , class _Duration2 >
constexpr bool operator== (const time_point< _Clock, _Duration1 > &_Left, const time_point< _Clock, _Duration2 > &_Right)
 
template<class _Clock , class _Duration1 , class _Duration2 >
constexpr bool operator!= (const time_point< _Clock, _Duration1 > &_Left, const time_point< _Clock, _Duration2 > &_Right)
 
template<class _Clock , class _Duration1 , class _Duration2 >
constexpr bool operator< (const time_point< _Clock, _Duration1 > &_Left, const time_point< _Clock, _Duration2 > &_Right)
 
template<class _Clock , class _Duration1 , class _Duration2 >
constexpr bool operator<= (const time_point< _Clock, _Duration1 > &_Left, const time_point< _Clock, _Duration2 > &_Right)
 
template<class _Clock , class _Duration1 , class _Duration2 >
constexpr bool operator> (const time_point< _Clock, _Duration1 > &_Left, const time_point< _Clock, _Duration2 > &_Right)
 
template<class _Clock , class _Duration1 , class _Duration2 >
constexpr bool operator>= (const time_point< _Clock, _Duration1 > &_Left, const time_point< _Clock, _Duration2 > &_Right)
 
template<class _To , class _Clock , class _Duration >
constexpr enable_if< _Is_duration< _To >::value, time_point< _Clock, _To > >::type time_point_cast (const time_point< _Clock, _Duration > &_Time)
 
template<class _To , class _Clock , class _Duration >
constexpr enable_if< _Is_duration< _To >::value, time_point< _Clock, _To > >::type floor (const time_point< _Clock, _Duration > &_Time)
 
template<class _To , class _Clock , class _Duration >
constexpr enable_if< _Is_duration< _To >::value, time_point< _Clock, _To > >::type ceil (const time_point< _Clock, _Duration > &_Time)
 
template<class _To , class _Clock , class _Duration >
constexpr enable_if< _Is_duration< _To >::value, time_point< _Clock, _To > >::type round (const time_point< _Clock, _Duration > &_Time)
 

Variables

template<class _Rep >
constexpr bool treat_as_floating_point_v = treat_as_floating_point<_Rep>::value
 

Typedef Documentation

template<class _Dur >
using chrono::_As_integral = typedef duration< typename conditional<treat_as_floating_point<typename _Dur::rep>::value, intmax_t, typename _Dur::rep>::type, typename _Dur::period>
typedef duration<int, ratio<3600> > chrono::hours

Function Documentation

template<class _Rep >
constexpr _Rep chrono::_Bankers_divide ( _Rep  _Dividend,
_Rep  _Divisor 
)
inline
676  { // Integer divide _Dividend by _Divisor, round to nearest, ties to even
677  // Assumes _Divisor > 0 because all the callers of this put
678  // ratio::den as _Divisor, and ratio::den can't be negative or zero by
679  // N4527 20.11.3 [ratio.ratio]/2.2
680  return (_Bankers_divide_tag(_Dividend, _Divisor, is_signed<_Rep>()));
681  }
constexpr _Rep _Bankers_divide_tag(_Rep _Dividend, _Rep _Divisor, true_type)
Definition: chrono:664
Definition: type_traits:799
template<class _Rep >
constexpr _Rep chrono::_Bankers_divide_impl ( _Rep  _Truncated,
_Rep  _Mod,
_Rep  _Half_divisor,
bool  _Half_divisor_is_exact 
)
inline
641  { // Implement _Bankers_divide for unsigned numbers
642  return (_Truncated + static_cast<_Rep>(
643  // strictly closer to positive infinity
644  _Mod > _Half_divisor
645  // equidistant, ties to even
646  || (_Mod == _Half_divisor
647  // The next condition detects _Half_divisor itself being truncated
648  && _Half_divisor_is_exact
649  && !_Is_even(_Truncated)
650  )));
651  }
constexpr bool _Is_even(_Rep _Val)
Definition: chrono:632
template<class _Rep >
constexpr _Rep chrono::_Bankers_divide_tag ( _Rep  _Dividend,
_Rep  _Divisor,
false_type   
)
inline
655  { // _Bankers_divide for unsigned numbers
656  return (_Bankers_divide_impl(
657  _Dividend / _Divisor,
658  _Dividend % _Divisor,
659  _Divisor / static_cast<_Rep>(2),
660  _Is_even(_Divisor)));
661  }
constexpr _Rep _Bankers_divide_impl(_Rep _Truncated, _Rep _Mod, _Rep _Half_divisor, bool _Half_divisor_is_exact)
Definition: chrono:639
constexpr bool _Is_even(_Rep _Val)
Definition: chrono:632
template<class _Rep >
constexpr _Rep chrono::_Bankers_divide_tag ( _Rep  _Dividend,
_Rep  _Divisor,
true_type   
)
inline
665  { // Transform to unsigned then transform back
666  return (static_cast<_Rep>(duration_values<_Rep>::zero() <= _Dividend
667  ? _Bankers_divide_tag(_Make_unsigned(_Dividend),
668  _Make_unsigned(_Divisor), false_type())
669  : duration_values<_Rep>::zero() - _Bankers_divide_tag(
670  duration_values<_Rep>::zero() - _Make_unsigned(_Dividend),
671  _Make_unsigned(_Divisor), false_type())));
672  }
constexpr make_unsigned< _Rep >::type _Make_unsigned(_Rep _Val)
Definition: chrono:625
integral_constant< bool, false > false_type
Definition: xtr1common:42
constexpr _Rep _Bankers_divide_tag(_Rep _Dividend, _Rep _Divisor, true_type)
Definition: chrono:664
template<class _Rep , class _Period , class _To_integral >
constexpr _To_integral chrono::_Ceil ( const duration< _Rep, _Period > &  _Dur,
const _To_integral &  _Dur_integral 
)
inline
607  {
608  return (_Dur <= _Dur_integral
609  ? _Dur_integral
610  : _Dur_integral + static_cast<_To_integral>(1));
611  }
template<class _Rep , class _Period , class _To_integral >
constexpr _To_integral chrono::_Floor ( const duration< _Rep, _Period > &  _Dur,
const _To_integral &  _Dur_integral 
)
inline
585  {
586  return (_Dur_integral <= _Dur
587  ? _Dur_integral
588  : _Dur_integral - static_cast<_To_integral>(1));
589  }
template<class _Rep >
constexpr bool chrono::_Is_even ( _Rep  _Val)
inline
633  { // Tests whether _Val is even
634  return (_Val % 2 == 0);
635  }
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Rep >
constexpr make_unsigned<_Rep>::type chrono::_Make_unsigned ( _Rep  _Val)
inline
626  { // Makes _Val unsigned
627  return (static_cast<typename make_unsigned<_Rep>::type>(_Val));
628  }
Definition: list:422
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _To , class _Rep , class _Period >
constexpr _To chrono::_Round ( const duration< _Rep, _Period > &  _Dur,
false_type  ,
false_type   
)
inline
723  { // Implement round() when everything is integral
725 
726  typedef typename _To::rep _ToRep;
727  typedef typename common_type<_ToRep, _Rep, intmax_t>::type _CR;
728 
729 #pragma warning(push)
730 #pragma warning(disable: 6326) // Potential comparison of a constant with another constant.
731  return (_CF::num == 1 && _CF::den == 1
732  ? static_cast<_To>(static_cast<_ToRep>(_Dur.count()))
733  : _CF::num != 1 && _CF::den == 1
734  ? static_cast<_To>(static_cast<_ToRep>(
735  static_cast<_CR>(
736  _Dur.count()) * static_cast<_CR>(_CF::num)))
737  : _CF::num == 1 && _CF::den != 1
738  ? static_cast<_To>(static_cast<_ToRep>(_Bankers_divide(
739  static_cast<_CR>(_Dur.count()), static_cast<_CR>(_CF::den))))
740  : static_cast<_To>(static_cast<_ToRep>(
742  static_cast<_CR>(_Dur.count()) * static_cast<_CR>(_CF::num),
743  static_cast<_CR>(_CF::den)))));
744 #pragma warning(pop)
745  }
_Ratio_divide_sfinae< _R1, _R2, false > ratio_divide
Definition: ratio:259
constexpr _Rep _Bankers_divide(_Rep _Dividend, _Rep _Divisor)
Definition: chrono:675
Definition: type_traits:1236
template<class _To , class _Rep , class _Period >
constexpr _To chrono::_Round ( const duration< _Rep, _Period > &  _Dur,
false_type  ,
true_type   
)
inline
752  { // Implement round() when the target is integral, source is floating
753  // Do any period adjustments in floating point values
754  // (in duration_cast), then round to nearest integer, ties to even
755  typedef duration<_Rep, typename _To::period> _FloatTo;
756  return (static_cast<_To>(static_cast<typename _To::rep>(
757  _Round_fp(chrono::duration_cast<_FloatTo>(_Dur).count()))));
758  }
constexpr _Rep _Round_fp(_Rep _Val)
Definition: chrono:705
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3221
template<class _To , class _Rep , class _Period , class _Source_integral >
constexpr _To chrono::_Round ( const duration< _Rep, _Period > &  _Dur,
true_type  ,
_Source_integral   
)
inline
766  { // Implement round() when the target is floating, source is anything
767  // Convert to floating point, then round to nearest integer, ties to even
768  return (static_cast<_To>(_Round_fp(chrono::duration_cast<_To>(_Dur).count())));
769  }
constexpr _Rep _Round_fp(_Rep _Val)
Definition: chrono:705
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3221
template<class _Rep >
constexpr _Rep chrono::_Round_fp ( _Rep  _Val)
inline
706  { // Rounds floating point _Val to nearest, ties to even
707  // Transform to non-negative, then transform back.
708  static_assert(treat_as_floating_point<_Rep>::value,
709  "_Round_fp needs floating input");
710  return (static_cast<_Rep>(duration_values<_Rep>::zero() <= _Val
712  : (duration_values<_Rep>::zero()
713  - _Round_fp_non_negative(duration_values<_Rep>::zero() - _Val))
714  ));
715  }
constexpr intmax_t _Round_fp_non_negative(_Rep _Val)
Definition: chrono:699
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Rep >
constexpr intmax_t chrono::_Round_fp_non_negative ( _Rep  _Val,
intmax_t  _Val_trunc 
)
inline
694  { // Rounds non-negative floating point _Val to nearest integer, ties to even
695  return (_Round_should_truncate(_Val, _Val_trunc) ? _Val_trunc : _Val_trunc + 1);
696  }
constexpr bool _Round_should_truncate(_Rep _Val, intmax_t _Val_trunc)
Definition: chrono:685
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Rep >
constexpr intmax_t chrono::_Round_fp_non_negative ( _Rep  _Val)
inline
700  { // Rounds non-negative floating point _Val to nearest integer, ties to even
701  return (_Round_fp_non_negative(_Val, static_cast<intmax_t>(_Val)));
702  }
constexpr intmax_t _Round_fp_non_negative(_Rep _Val)
Definition: chrono:699
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Rep >
constexpr bool chrono::_Round_should_truncate ( _Rep  _Val,
intmax_t  _Val_trunc 
)
inline
686  { // Tests if floating point _Val is closer to _Val_trunc, or should tie to even
687  return (_Val - static_cast<_Rep>(_Val_trunc) < static_cast<_Rep>(_Val_trunc + 1) - _Val
688  || (_Val - static_cast<_Rep>(_Val_trunc) == static_cast<_Rep>(_Val_trunc + 1) - _Val
689  && _Is_even(_Val_trunc)));
690  }
constexpr bool _Is_even(_Rep _Val)
Definition: chrono:632
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Rep , class _Period >
constexpr enable_if<numeric_limits<_Rep>::is_signed, duration<_Rep, _Period> >::type chrono::abs ( const duration< _Rep, _Period >  _Dur)
inline
788  { // create a duration with count() the absolute value of _Dur.count()
789  return (_Dur < duration<_Rep, _Period>::zero()
790  ? duration<_Rep, _Period>::zero() - _Dur
791  : _Dur);
792  }
template<class _To , class _Rep , class _Period >
constexpr enable_if<_Is_duration<_To>::value, _To>::type chrono::ceil ( const duration< _Rep, _Period > &  _Dur)
inline
618  { // convert duration to another duration; round towards positive infinity
619  // i.e. the least integral result such that _Dur <= the result
620  return (_Ceil(_Dur, chrono::duration_cast<_As_integral<_To> >(_Dur)));
621  }
constexpr _To_integral _Ceil(const duration< _Rep, _Period > &_Dur, const _To_integral &_Dur_integral)
Definition: chrono:605
constexpr enable_if< _Is_duration< _To >::value, _To >::type duration_cast(const duration< _Rep, _Period > &)
Definition: chrono:546
template<class _To , class _Clock , class _Duration >
constexpr enable_if<_Is_duration<_To>::value, time_point<_Clock, _To> >::type chrono::ceil ( const time_point< _Clock, _Duration > &  _Time)
inline
947  { // change the duration type of a time_point; round towards positive infinity
948  return (time_point<_Clock, _To>(
949  chrono::ceil<_To>(_Time.time_since_epoch())));
950  }
template<class _To , class _Rep , class _Period >
constexpr enable_if< _Is_duration< _To >::value, _To >::type chrono::duration_cast ( const duration< _Rep, _Period > &  _Dur)
inline
547  { // convert duration to another duration; truncate
549 
550  typedef typename _To::rep _ToRep;
551  typedef typename common_type<_ToRep, _Rep, intmax_t>::type _CR;
552 
553 #pragma warning(push)
554 #pragma warning(disable: 6326) // Potential comparison of a constant with another constant.
555  return (_CF::num == 1 && _CF::den == 1
556  ? static_cast<_To>(static_cast<_ToRep>(_Dur.count()))
557  : _CF::num != 1 && _CF::den == 1
558  ? static_cast<_To>(static_cast<_ToRep>(
559  static_cast<_CR>(
560  _Dur.count()) * static_cast<_CR>(_CF::num)))
561  : _CF::num == 1 && _CF::den != 1
562  ? static_cast<_To>(static_cast<_ToRep>(
563  static_cast<_CR>(_Dur.count())
564  / static_cast<_CR>(_CF::den)))
565  : static_cast<_To>(static_cast<_ToRep>(
566  static_cast<_CR>(_Dur.count()) * static_cast<_CR>(_CF::num)
567  / static_cast<_CR>(_CF::den))));
568 #pragma warning(pop)
569  }
_Ratio_divide_sfinae< _R1, _R2, false > ratio_divide
Definition: ratio:259
Definition: type_traits:1236
template<class _To , class _Rep , class _Period >
constexpr enable_if<_Is_duration<_To>::value, _To>::type chrono::floor ( const duration< _Rep, _Period > &  _Dur)
inline
596  { // convert duration to another duration; round towards negative infinity
597  // i.e. the greatest integral result such that the result <= _Dur
598  return (_Floor(_Dur, chrono::duration_cast<_As_integral<_To> >(_Dur)));
599  }
constexpr _To_integral _Floor(const duration< _Rep, _Period > &_Dur, const _To_integral &_Dur_integral)
Definition: chrono:583
constexpr enable_if< _Is_duration< _To >::value, _To >::type duration_cast(const duration< _Rep, _Period > &)
Definition: chrono:546
template<class _To , class _Clock , class _Duration >
constexpr enable_if<_Is_duration<_To>::value, time_point<_Clock, _To> >::type chrono::floor ( const time_point< _Clock, _Duration > &  _Time)
inline
935  { // change the duration type of a time_point; round towards negative infinity
936  return (time_point<_Clock, _To>(
937  chrono::floor<_To>(_Time.time_since_epoch())));
938  }
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr bool chrono::operator!= ( const duration< _Rep1, _Period1 > &  _Left,
const duration< _Rep2, _Period2 > &  _Right 
)
inline
490  { // test if duration != duration
491  return (!(_Left == _Right));
492  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Clock , class _Duration1 , class _Duration2 >
constexpr bool chrono::operator!= ( const time_point< _Clock, _Duration1 > &  _Left,
const time_point< _Clock, _Duration2 > &  _Right 
)
inline
872  { // test for time_point != time_point
873  return (!(_Left == _Right));
874  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Rep1 , class _Period1 , class _Rep2 >
constexpr _Duration_div_mod<_Rep1, _Period1, _Rep2>::type chrono::operator% ( const duration< _Rep1, _Period1 > &  _Left,
const _Rep2 &  _Right 
)
inline
447  { // divide duration by rep
448  typedef typename common_type<_Rep1, _Rep2>::type _CR;
449  typedef duration<_CR, _Period1> _CD;
450  return (_CD(_CD(_Left).count() % _Right));
451  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3221
constexpr const _Ty &() _Right
Definition: algorithm:3723
Definition: type_traits:1236
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr common_type< duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type chrono::operator% ( const duration< _Rep1, _Period1 > &  _Left,
const duration< _Rep2, _Period2 > &  _Right 
)
inline
462  { // divide duration by duration
463  typedef typename common_type<
464  duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _CD;
465  return (_CD(_CD(_Left).count() % _CD(_Right).count()));
466  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3221
constexpr const _Ty &() _Right
Definition: algorithm:3723
Definition: type_traits:1236
template<class _Rep1 , class _Period1 , class _Rep2 >
constexpr enable_if<is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value, duration<typename common_type<_Rep1, _Rep2>::type, _Period1> >::type chrono::operator* ( const duration< _Rep1, _Period1 > &  _Left,
const _Rep2 &  _Right 
)
inline
361  { // multiply duration by rep
362  typedef typename common_type<_Rep1, _Rep2>::type _CR;
363  typedef duration<_CR, _Period1> _CD;
364  return (_CD(_CD(_Left).count() * _Right));
365  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3221
constexpr const _Ty &() _Right
Definition: algorithm:3723
Definition: type_traits:1236
template<class _Rep1 , class _Rep2 , class _Period2 >
constexpr enable_if<is_convertible<_Rep1, typename common_type<_Rep1, _Rep2>::type>::value, duration<typename common_type<_Rep1, _Rep2>::type, _Period2> >::type chrono::operator* ( const _Rep1 &  _Left,
const duration< _Rep2, _Period2 > &  _Right 
)
inline
376  { // multiply rep by duration
377  return (_Right * _Left);
378  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr common_type< duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type chrono::operator+ ( const duration< _Rep1, _Period1 > &  _Left,
const duration< _Rep2, _Period2 > &  _Right 
)
inline
329  { // add two durations
330  typedef typename common_type<
331  duration<_Rep1, _Period1>,
332  duration<_Rep2, _Period2> >::type _CD;
333  return (_CD(_CD(_Left).count() + _CD(_Right).count()));
334  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3221
constexpr const _Ty &() _Right
Definition: algorithm:3723
Definition: type_traits:1236
template<class _Clock , class _Duration , class _Rep , class _Period >
constexpr time_point<_Clock, typename common_type<_Duration, duration<_Rep, _Period> >::type> chrono::operator+ ( const time_point< _Clock, _Duration > &  _Left,
const duration< _Rep, _Period > &  _Right 
)
inline
812  { // add duration to time_point
813  typedef time_point<_Clock, typename common_type<
814  _Duration, duration<_Rep, _Period> >::type> _RT;
815  return (_RT(_Left.time_since_epoch() + _Right));
816  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
constexpr const _Ty &() _Right
Definition: algorithm:3723
Definition: type_traits:1236
template<class _Rep , class _Period , class _Clock , class _Duration >
constexpr time_point<_Clock, typename common_type<duration<_Rep, _Period>, _Duration>::type> chrono::operator+ ( const duration< _Rep, _Period > &  _Left,
const time_point< _Clock, _Duration > &  _Right 
)
inline
827  { // add time_point to duration
828  return (_Right + _Left);
829  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr common_type< duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type chrono::operator- ( const duration< _Rep1, _Period1 > &  _Left,
const duration< _Rep2, _Period2 > &  _Right 
)
inline
346  { // subtract two durations
347  typedef typename common_type<
348  duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _CD;
349  return (_CD(_CD(_Left).count() - _CD(_Right).count()));
350  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3221
constexpr const _Ty &() _Right
Definition: algorithm:3723
Definition: type_traits:1236
template<class _Clock , class _Duration , class _Rep , class _Period >
constexpr time_point<_Clock, typename common_type<_Duration, duration<_Rep, _Period> >::type> chrono::operator- ( const time_point< _Clock, _Duration > &  _Left,
const duration< _Rep, _Period > &  _Right 
)
inline
840  { // subtract duration from time_point
841  return (_Left + (-_Right));
842  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Clock , class _Duration1 , class _Duration2 >
constexpr common_type<_Duration1, _Duration2>::type chrono::operator- ( const time_point< _Clock, _Duration1 > &  _Left,
const time_point< _Clock, _Duration2 > &  _Right 
)
inline
851  { // add time_point to time_point
852  return (_Left.time_since_epoch() - _Right.time_since_epoch());
853  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Rep1 , class _Period1 , class _Rep2 >
_Duration_div_mod<_Rep1, _Period1, _Rep2>::type constexpr chrono::operator/ ( const duration< _Rep1, _Period1 > &  _Left,
const _Rep2 &  _Right 
)
inline
420  { // divide duration by rep
421  typedef typename common_type<_Rep1, _Rep2>::type _CR;
422  typedef duration<_CR, _Period1> _CD;
423  return (_CD(_CD(_Left).count() / _Right));
424  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3221
constexpr const _Ty &() _Right
Definition: algorithm:3723
Definition: type_traits:1236
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr common_type<_Rep1, _Rep2>::type chrono::operator/ ( const duration< _Rep1, _Period1 > &  _Left,
const duration< _Rep2, _Period2 > &  _Right 
)
inline
434  { // divide duration by duration
435  typedef typename common_type<
436  duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _CD;
437  return (_CD(_Left).count() / _CD(_Right).count());
438  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3221
constexpr const _Ty &() _Right
Definition: algorithm:3723
Definition: type_traits:1236
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr bool chrono::operator< ( const duration< _Rep1, _Period1 > &  _Left,
const duration< _Rep2, _Period2 > &  _Right 
)
inline
501  { // test if duration < duration
502  typedef typename common_type<
503  duration<_Rep1, _Period1>,
504  duration<_Rep2, _Period2> >::type _CT;
505  return (_CT(_Left).count() < _CT(_Right).count());
506  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3221
constexpr const _Ty &() _Right
Definition: algorithm:3723
Definition: type_traits:1236
template<class _Clock , class _Duration1 , class _Duration2 >
constexpr bool chrono::operator< ( const time_point< _Clock, _Duration1 > &  _Left,
const time_point< _Clock, _Duration2 > &  _Right 
)
inline
882  { // test for time_point < time_point
883  return (_Left.time_since_epoch() < _Right.time_since_epoch());
884  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr bool chrono::operator<= ( const duration< _Rep1, _Period1 > &  _Left,
const duration< _Rep2, _Period2 > &  _Right 
)
inline
515  { // test if duration <= duration
516  return (!(_Right < _Left));
517  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Clock , class _Duration1 , class _Duration2 >
constexpr bool chrono::operator<= ( const time_point< _Clock, _Duration1 > &  _Left,
const time_point< _Clock, _Duration2 > &  _Right 
)
inline
892  { // test for time_point <= time_point
893  return (!(_Right < _Left));
894  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr bool chrono::operator== ( const duration< _Rep1, _Period1 > &  _Left,
const duration< _Rep2, _Period2 > &  _Right 
)
inline
476  { // test if duration == duration
477  typedef typename common_type<
478  duration<_Rep1, _Period1>,
479  duration<_Rep2, _Period2> >::type _CT;
480  return (_CT(_Left).count() == _CT(_Right).count());
481  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3221
constexpr const _Ty &() _Right
Definition: algorithm:3723
Definition: type_traits:1236
template<class _Clock , class _Duration1 , class _Duration2 >
constexpr bool chrono::operator== ( const time_point< _Clock, _Duration1 > &  _Left,
const time_point< _Clock, _Duration2 > &  _Right 
)
inline
862  { // test for time_point == time_point
863  return (_Left.time_since_epoch() == _Right.time_since_epoch());
864  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr bool chrono::operator> ( const duration< _Rep1, _Period1 > &  _Left,
const duration< _Rep2, _Period2 > &  _Right 
)
inline
526  { // test if duration > duration
527  return (_Right < _Left);
528  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Clock , class _Duration1 , class _Duration2 >
constexpr bool chrono::operator> ( const time_point< _Clock, _Duration1 > &  _Left,
const time_point< _Clock, _Duration2 > &  _Right 
)
inline
902  { // test for time_point > time_point
903  return (_Right < _Left);
904  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr bool chrono::operator>= ( const duration< _Rep1, _Period1 > &  _Left,
const duration< _Rep2, _Period2 > &  _Right 
)
inline
537  { // test if duration >= duration
538  return (!(_Left < _Right));
539  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Clock , class _Duration1 , class _Duration2 >
constexpr bool chrono::operator>= ( const time_point< _Clock, _Duration1 > &  _Left,
const time_point< _Clock, _Duration2 > &  _Right 
)
inline
912  { // test for time_point >= time_point
913  return (!(_Left < _Right));
914  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _To , class _Rep , class _Period >
constexpr enable_if<_Is_duration<_To>::value, _To>::type chrono::round ( const duration< _Rep, _Period > &  _Dur)
inline
776  { // convert duration to another duration, round to nearest, ties to even
777  return (_Round<_To>(_Dur,
778  treat_as_floating_point<typename _To::rep>(),
779  treat_as_floating_point<_Rep>()));
780  }
template<class _To , class _Clock , class _Duration >
constexpr enable_if<_Is_duration<_To>::value, time_point<_Clock, _To> >::type chrono::round ( const time_point< _Clock, _Duration > &  _Time)
inline
959  { // change the duration type of a time_point; round to nearest, ties to even
960  return (time_point<_Clock, _To>(
961  chrono::round<_To>(_Time.time_since_epoch())));
962  }
template<class _To , class _Clock , class _Duration >
constexpr enable_if<_Is_duration<_To>::value, time_point<_Clock, _To> >::type chrono::time_point_cast ( const time_point< _Clock, _Duration > &  _Time)
inline
923  { // change the duration type of a time_point; truncate
924  return (time_point<_Clock, _To>(
925  chrono::duration_cast<_To>(_Time.time_since_epoch())));
926  }

Variable Documentation

template<class _Rep >
constexpr bool chrono::treat_as_floating_point_v = treat_as_floating_point<_Rep>::value