STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Typedefs | Functions
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 long > seconds
 
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)
 

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
typedef duration<long long, micro> chrono::microseconds
typedef duration<long long, milli> chrono::milliseconds
typedef duration<int, ratio<60> > chrono::minutes
typedef duration<long long, nano> chrono::nanoseconds
typedef duration<long long> chrono::seconds

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:728
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:41
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  }
_In_ int _Val
Definition: vcruntime_string.h:62
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  }
_In_ int _Val
Definition: vcruntime_string.h:62
Definition: type_traits:1356
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  return (_CF::num == 1 && _CF::den == 1
729  ? static_cast<_To>(static_cast<_ToRep>(_Dur.count()))
730  : _CF::num != 1 && _CF::den == 1
731  ? static_cast<_To>(static_cast<_ToRep>(
732  static_cast<_CR>(
733  _Dur.count()) * static_cast<_CR>(_CF::num)))
734  : _CF::num == 1 && _CF::den != 1
735  ? static_cast<_To>(static_cast<_ToRep>(_Bankers_divide(
736  static_cast<_CR>(_Dur.count()), static_cast<_CR>(_CF::den))))
737  : static_cast<_To>(static_cast<_ToRep>(
739  static_cast<_CR>(_Dur.count()) * static_cast<_CR>(_CF::num),
740  static_cast<_CR>(_CF::den)))));
741  }
_Ratio_divide_sfinae< _R1, _R2, false > ratio_divide
Definition: ratio:258
constexpr _Rep _Bankers_divide(_Rep _Dividend, _Rep _Divisor)
Definition: chrono:675
Definition: type_traits:1159
template<class _To , class _Rep , class _Period >
constexpr _To chrono::_Round ( const duration< _Rep, _Period > &  _Dur,
false_type  ,
true_type   
)
inline
748  { // Implement round() when the target is integral, source is floating
749  // Do any period adjustments in floating point values
750  // (in duration_cast), then round to nearest integer, ties to even
751  typedef duration<_Rep, typename _To::period> _FloatTo;
752  return (static_cast<_To>(static_cast<typename _To::rep>(
753  _Round_fp(chrono::duration_cast<_FloatTo>(_Dur).count()))));
754  }
constexpr _Rep _Round_fp(_Rep _Val)
Definition: chrono:705
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3318
template<class _To , class _Rep , class _Period , class _Source_integral >
constexpr _To chrono::_Round ( const duration< _Rep, _Period > &  _Dur,
true_type  ,
_Source_integral   
)
inline
762  { // Implement round() when the target is floating, source is anything
763  // Convert to floating point, then round to nearest integer, ties to even
764  return (static_cast<_To>(_Round_fp(chrono::duration_cast<_To>(_Dur).count())));
765  }
constexpr _Rep _Round_fp(_Rep _Val)
Definition: chrono:705
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3318
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
_In_ int _Val
Definition: vcruntime_string.h:62
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  }
_In_ int _Val
Definition: vcruntime_string.h:62
constexpr bool _Round_should_truncate(_Rep _Val, intmax_t _Val_trunc)
Definition: chrono:685
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
_In_ int _Val
Definition: vcruntime_string.h:62
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  }
_In_ int _Val
Definition: vcruntime_string.h:62
constexpr bool _Is_even(_Rep _Val)
Definition: chrono:632
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
784  { // create a duration with count() the absolute value of _Dur.count()
785  return (_Dur < duration<_Rep, _Period>::zero()
786  ? duration<_Rep, _Period>::zero() - _Dur
787  : _Dur);
788  }
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:550
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
943  { // change the duration type of a time_point; round towards positive infinity
944  return (time_point<_Clock, _To>(
945  chrono::ceil<_To>(_Time.time_since_epoch())));
946  }
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
551  { // convert duration to another duration; truncate
553 
554  typedef typename _To::rep _ToRep;
555  typedef typename common_type<_ToRep, _Rep, intmax_t>::type _CR;
556  return (_CF::num == 1 && _CF::den == 1
557  ? static_cast<_To>(static_cast<_ToRep>(_Dur.count()))
558  : _CF::num != 1 && _CF::den == 1
559  ? static_cast<_To>(static_cast<_ToRep>(
560  static_cast<_CR>(
561  _Dur.count()) * static_cast<_CR>(_CF::num)))
562  : _CF::num == 1 && _CF::den != 1
563  ? static_cast<_To>(static_cast<_ToRep>(
564  static_cast<_CR>(_Dur.count())
565  / static_cast<_CR>(_CF::den)))
566  : static_cast<_To>(static_cast<_ToRep>(
567  static_cast<_CR>(_Dur.count()) * static_cast<_CR>(_CF::num)
568  / static_cast<_CR>(_CF::den))));
569  }
_Ratio_divide_sfinae< _R1, _R2, false > ratio_divide
Definition: ratio:258
Definition: type_traits:1159
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:550
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
931  { // change the duration type of a time_point; round towards negative infinity
932  return (time_point<_Clock, _To>(
933  chrono::floor<_To>(_Time.time_since_epoch())));
934  }
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr bool chrono::operator!= ( const duration< _Rep1, _Period1 > &  _Left,
const duration< _Rep2, _Period2 > &  _Right 
)
inline
494  { // test if duration != duration
495  return (!(_Left == _Right));
496  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Clock , class _Duration1 , class _Duration2 >
constexpr bool chrono::operator!= ( const time_point< _Clock, _Duration1 > &  _Left,
const time_point< _Clock, _Duration2 > &  _Right 
)
inline
868  { // test for time_point != time_point
869  return (!(_Left == _Right));
870  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
constexpr const _Ty &() _Right
Definition: algorithm:3591
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
451  { // divide duration by rep
452  typedef typename common_type<_Rep1, _Rep2>::type _CR;
453  typedef duration<_CR, _Period1> _CD;
454  return (_CD(_CD(_Left).count() % _Right));
455  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3318
constexpr const _Ty &() _Right
Definition: algorithm:3591
Definition: type_traits:1159
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
466  { // divide duration by duration
467  typedef typename common_type<
468  duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _CD;
469  return (_CD(_CD(_Left).count() % _CD(_Right).count()));
470  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3318
constexpr const _Ty &() _Right
Definition: algorithm:3591
Definition: type_traits:1159
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
365  { // multiply duration by rep
366  typedef typename common_type<_Rep1, _Rep2>::type _CR;
367  typedef duration<_CR, _Period1> _CD;
368  return (_CD(_CD(_Left).count() * _Right));
369  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3318
constexpr const _Ty &() _Right
Definition: algorithm:3591
Definition: type_traits:1159
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
380  { // multiply rep by duration
381  return (_Right * _Left);
382  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
constexpr const _Ty &() _Right
Definition: algorithm:3591
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
333  { // add two durations
334  typedef typename common_type<
335  duration<_Rep1, _Period1>,
336  duration<_Rep2, _Period2> >::type _CD;
337  return (_CD(_CD(_Left).count() + _CD(_Right).count()));
338  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3318
constexpr const _Ty &() _Right
Definition: algorithm:3591
Definition: type_traits:1159
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
808  { // add duration to time_point
809  typedef time_point<_Clock, typename common_type<
810  _Duration, duration<_Rep, _Period> >::type> _RT;
811  return (_RT(_Left.time_since_epoch() + _Right));
812  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
constexpr const _Ty &() _Right
Definition: algorithm:3591
Definition: type_traits:1159
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
823  { // add time_point to duration
824  return (_Right + _Left);
825  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
constexpr const _Ty &() _Right
Definition: algorithm:3591
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
350  { // subtract two durations
351  typedef typename common_type<
352  duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _CD;
353  return (_CD(_CD(_Left).count() - _CD(_Right).count()));
354  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3318
constexpr const _Ty &() _Right
Definition: algorithm:3591
Definition: type_traits:1159
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
836  { // subtract duration from time_point
837  return (_Left + (-_Right));
838  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
constexpr const _Ty &() _Right
Definition: algorithm:3591
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
847  { // add time_point to time_point
848  return (_Left.time_since_epoch() - _Right.time_since_epoch());
849  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
constexpr const _Ty &() _Right
Definition: algorithm:3591
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
424  { // divide duration by rep
425  typedef typename common_type<_Rep1, _Rep2>::type _CR;
426  typedef duration<_CR, _Period1> _CD;
427  return (_CD(_CD(_Left).count() / _Right));
428  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3318
constexpr const _Ty &() _Right
Definition: algorithm:3591
Definition: type_traits:1159
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
438  { // divide duration by duration
439  typedef typename common_type<
440  duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _CD;
441  return (_CD(_Left).count() / _CD(_Right).count());
442  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3318
constexpr const _Ty &() _Right
Definition: algorithm:3591
Definition: type_traits:1159
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr bool chrono::operator< ( const duration< _Rep1, _Period1 > &  _Left,
const duration< _Rep2, _Period2 > &  _Right 
)
inline
505  { // test if duration < duration
506  typedef typename common_type<
507  duration<_Rep1, _Period1>,
508  duration<_Rep2, _Period2> >::type _CT;
509  return (_CT(_Left).count() < _CT(_Right).count());
510  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3318
constexpr const _Ty &() _Right
Definition: algorithm:3591
Definition: type_traits:1159
template<class _Clock , class _Duration1 , class _Duration2 >
constexpr bool chrono::operator< ( const time_point< _Clock, _Duration1 > &  _Left,
const time_point< _Clock, _Duration2 > &  _Right 
)
inline
878  { // test for time_point < time_point
879  return (_Left.time_since_epoch() < _Right.time_since_epoch());
880  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr bool chrono::operator<= ( const duration< _Rep1, _Period1 > &  _Left,
const duration< _Rep2, _Period2 > &  _Right 
)
inline
519  { // test if duration <= duration
520  return (!(_Right < _Left));
521  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Clock , class _Duration1 , class _Duration2 >
constexpr bool chrono::operator<= ( const time_point< _Clock, _Duration1 > &  _Left,
const time_point< _Clock, _Duration2 > &  _Right 
)
inline
888  { // test for time_point <= time_point
889  return (!(_Right < _Left));
890  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr bool chrono::operator== ( const duration< _Rep1, _Period1 > &  _Left,
const duration< _Rep2, _Period2 > &  _Right 
)
inline
480  { // test if duration == duration
481  typedef typename common_type<
482  duration<_Rep1, _Period1>,
483  duration<_Rep2, _Period2> >::type _CT;
484  return (_CT(_Left).count() == _CT(_Right).count());
485  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
_Iter_diff_t< _InIt > count(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3318
constexpr const _Ty &() _Right
Definition: algorithm:3591
Definition: type_traits:1159
template<class _Clock , class _Duration1 , class _Duration2 >
constexpr bool chrono::operator== ( const time_point< _Clock, _Duration1 > &  _Left,
const time_point< _Clock, _Duration2 > &  _Right 
)
inline
858  { // test for time_point == time_point
859  return (_Left.time_since_epoch() == _Right.time_since_epoch());
860  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr bool chrono::operator> ( const duration< _Rep1, _Period1 > &  _Left,
const duration< _Rep2, _Period2 > &  _Right 
)
inline
530  { // test if duration > duration
531  return (_Right < _Left);
532  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Clock , class _Duration1 , class _Duration2 >
constexpr bool chrono::operator> ( const time_point< _Clock, _Duration1 > &  _Left,
const time_point< _Clock, _Duration2 > &  _Right 
)
inline
898  { // test for time_point > time_point
899  return (_Right < _Left);
900  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Rep1 , class _Period1 , class _Rep2 , class _Period2 >
constexpr bool chrono::operator>= ( const duration< _Rep1, _Period1 > &  _Left,
const duration< _Rep2, _Period2 > &  _Right 
)
inline
541  { // test if duration >= duration
542  return (!(_Left < _Right));
543  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Clock , class _Duration1 , class _Duration2 >
constexpr bool chrono::operator>= ( const time_point< _Clock, _Duration1 > &  _Left,
const time_point< _Clock, _Duration2 > &  _Right 
)
inline
908  { // test for time_point >= time_point
909  return (!(_Left < _Right));
910  }
constexpr const _Ty &() _Left
Definition: algorithm:3590
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _To , class _Rep , class _Period >
constexpr enable_if<_Is_duration<_To>::value, _To>::type chrono::round ( const duration< _Rep, _Period > &  _Dur)
inline
772  { // convert duration to another duration, round to nearest, ties to even
773  return (_Round<_To>(_Dur,
774  treat_as_floating_point<typename _To::rep>(),
775  treat_as_floating_point<_Rep>()));
776  }
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
955  { // change the duration type of a time_point; round to nearest, ties to even
956  return (time_point<_Clock, _To>(
957  chrono::round<_To>(_Time.time_since_epoch())));
958  }
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
919  { // change the duration type of a time_point; truncate
920  return (time_point<_Clock, _To>(
921  chrono::duration_cast<_To>(_Time.time_since_epoch())));
922  }