libstdc++
std::chrono::duration< _Rep, _Period > Class Template Reference

Public Types

using period = typename _Period::type
 
using rep = _Rep
 

Public Member Functions

template<typename _Rep2 , typename = _Require< is_convertible<const _Rep2&, rep>, __or_<__is_float<rep>, __not_<__is_float<_Rep2>>>>>
constexpr duration (const _Rep2 &__rep)
 
 duration (const duration &)=default
 
template<typename _Rep2 , typename _Period2 , typename = _Require< is_convertible<const _Rep2&, rep>, __or_<__is_float<rep>, __and_<__is_harmonic<_Period2>, __not_<__is_float<_Rep2>>>>>>
constexpr duration (const duration< _Rep2, _Period2 > &__d)
 
constexpr rep count () const
 
template<typename _Rep2 = rep>
constexpr __enable_if_t<!treat_as_floating_point< _Rep2 >::value, duration & > operator%= (const duration &__d)
 
template<typename _Rep2 = rep>
constexpr __enable_if_t<!treat_as_floating_point< _Rep2 >::value, duration & > operator%= (const rep &__rhs)
 
constexpr durationoperator*= (const rep &__rhs)
 
constexpr duration< typename common_type< rep >::type, period > operator+ () const
 
constexpr durationoperator++ ()
 
constexpr duration operator++ (int)
 
constexpr durationoperator+= (const duration &__d)
 
constexpr duration< typename common_type< rep >::type, period > operator- () const
 
constexpr durationoperator-- ()
 
constexpr duration operator-- (int)
 
constexpr durationoperator-= (const duration &__d)
 
constexpr durationoperator/= (const rep &__rhs)
 
durationoperator= (const duration &)=default
 

Static Public Member Functions

static constexpr duration max () noexcept
 
static constexpr duration min () noexcept
 
static constexpr duration zero () noexcept
 

Related Functions

(Note that these are not member functions.)

template<typename _Rep1 , typename _Period1 , typename _Rep2 , typename _Period2 >
constexpr common_type< duration< _Rep1, _Period1 >, duration< _Rep2, _Period2 > >::type operator+ (const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
 
template<typename _Rep1 , typename _Period , typename _Rep2 >
constexpr duration< __common_rep_t< _Rep1, _Rep2 >, _Period > operator* (const duration< _Rep1, _Period > &__d, const _Rep2 &__s)
 
template<typename _Rep1 , typename _Period1 , typename _Rep2 , typename _Period2 >
constexpr bool operator== (const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
 

Detailed Description

template<typename _Rep, typename _Period>
class std::chrono::duration< _Rep, _Period >

chrono::duration represents a distance between two points in time

Definition at line 509 of file chrono.h.

Member Typedef Documentation

◆ period

template<typename _Rep , typename _Period >
using std::chrono::duration< _Rep, _Period >::period = typename _Period::type

Definition at line 559 of file chrono.h.

◆ rep

template<typename _Rep , typename _Period >
using std::chrono::duration< _Rep, _Period >::rep = _Rep

Definition at line 558 of file chrono.h.

Constructor & Destructor Documentation

◆ duration() [1/2]

template<typename _Rep , typename _Period >
template<typename _Rep2 , typename = _Require< is_convertible<const _Rep2&, rep>, __or_<__is_float<rep>, __not_<__is_float<_Rep2>>>>>
constexpr std::chrono::duration< _Rep, _Period >::duration ( const _Rep2 &  __rep)
inlineexplicitconstexpr

Definition at line 571 of file chrono.h.

◆ duration() [2/2]

template<typename _Rep , typename _Period >
template<typename _Rep2 , typename _Period2 , typename = _Require< is_convertible<const _Rep2&, rep>, __or_<__is_float<rep>, __and_<__is_harmonic<_Period2>, __not_<__is_float<_Rep2>>>>>>
constexpr std::chrono::duration< _Rep, _Period >::duration ( const duration< _Rep2, _Period2 > &  __d)
inlineconstexpr

Definition at line 579 of file chrono.h.

Member Function Documentation

◆ count()

template<typename _Rep , typename _Period >
constexpr rep std::chrono::duration< _Rep, _Period >::count ( ) const
inlineconstexpr

Definition at line 587 of file chrono.h.

◆ max()

template<typename _Rep , typename _Period >
static constexpr duration std::chrono::duration< _Rep, _Period >::max ( )
inlinestaticconstexprnoexcept

Definition at line 679 of file chrono.h.

◆ min()

template<typename _Rep , typename _Period >
static constexpr duration std::chrono::duration< _Rep, _Period >::min ( )
inlinestaticconstexprnoexcept

Definition at line 675 of file chrono.h.

◆ operator%=() [1/2]

template<typename _Rep , typename _Period >
template<typename _Rep2 = rep>
constexpr __enable_if_t<!treat_as_floating_point< _Rep2 >::value, duration & > std::chrono::duration< _Rep, _Period >::operator%= ( const duration< _Rep, _Period > &  __d)
inlineconstexpr

Definition at line 663 of file chrono.h.

◆ operator%=() [2/2]

template<typename _Rep , typename _Period >
template<typename _Rep2 = rep>
constexpr __enable_if_t<!treat_as_floating_point< _Rep2 >::value, duration & > std::chrono::duration< _Rep, _Period >::operator%= ( const rep &  __rhs)
inlineconstexpr

Definition at line 654 of file chrono.h.

◆ operator*=()

template<typename _Rep , typename _Period >
constexpr duration & std::chrono::duration< _Rep, _Period >::operator*= ( const rep &  __rhs)
inlineconstexpr

Definition at line 637 of file chrono.h.

◆ operator+()

template<typename _Rep , typename _Period >
constexpr duration< typename common_type< rep >::type, period > std::chrono::duration< _Rep, _Period >::operator+ ( ) const
inlineconstexpr

Definition at line 593 of file chrono.h.

◆ operator++() [1/2]

template<typename _Rep , typename _Period >
constexpr duration & std::chrono::duration< _Rep, _Period >::operator++ ( )
inlineconstexpr

Definition at line 601 of file chrono.h.

◆ operator++() [2/2]

template<typename _Rep , typename _Period >
constexpr duration std::chrono::duration< _Rep, _Period >::operator++ ( int  )
inlineconstexpr

Definition at line 608 of file chrono.h.

◆ operator+=()

template<typename _Rep , typename _Period >
constexpr duration & std::chrono::duration< _Rep, _Period >::operator+= ( const duration< _Rep, _Period > &  __d)
inlineconstexpr

Definition at line 623 of file chrono.h.

◆ operator-()

template<typename _Rep , typename _Period >
constexpr duration< typename common_type< rep >::type, period > std::chrono::duration< _Rep, _Period >::operator- ( ) const
inlineconstexpr

Definition at line 597 of file chrono.h.

◆ operator--() [1/2]

template<typename _Rep , typename _Period >
constexpr duration & std::chrono::duration< _Rep, _Period >::operator-- ( )
inlineconstexpr

Definition at line 612 of file chrono.h.

◆ operator--() [2/2]

template<typename _Rep , typename _Period >
constexpr duration std::chrono::duration< _Rep, _Period >::operator-- ( int  )
inlineconstexpr

Definition at line 619 of file chrono.h.

◆ operator-=()

template<typename _Rep , typename _Period >
constexpr duration & std::chrono::duration< _Rep, _Period >::operator-= ( const duration< _Rep, _Period > &  __d)
inlineconstexpr

Definition at line 630 of file chrono.h.

◆ operator/=()

template<typename _Rep , typename _Period >
constexpr duration & std::chrono::duration< _Rep, _Period >::operator/= ( const rep &  __rhs)
inlineconstexpr

Definition at line 644 of file chrono.h.

◆ zero()

template<typename _Rep , typename _Period >
static constexpr duration std::chrono::duration< _Rep, _Period >::zero ( )
inlinestaticconstexprnoexcept

Definition at line 671 of file chrono.h.


The documentation for this class was generated from the following file: