|
| constexpr | duration () noexcept(is_nothrow_default_constructible_v< rep >) |
| | Default constructor Initializes the duration with a zero tick count.
|
| |
| template<typename Rep2, typename Period2, arene::base::constraints< enable_if_t< is_convertible_v< Rep2 const &, rep > >, enable_if_t< chrono_detail::check_conversion_overflow< Period2, period >::value >, enable_if_t< treat_as_floating_point_v< rep >||(ratio_divide< Period2, period >::den==1 &&!treat_as_floating_point_v< Rep2 >)>> |
| constexpr | duration (duration< Rep2, Period2 > const &other) noexcept(noexcept(duration_cast< duration >(std::declval< duration< Rep2, Period2 > const & >()).count()) &&//is_nothrow_constructible_v< rep, >) |
| | Constructor from another duration type.
|
| |
| template<typename Rep2, arene::base::constraints< enable_if_t< is_convertible_v< Rep2 const &, rep > >, enable_if_t< treat_as_floating_point_v< rep >||!treat_as_floating_point_v< Rep2 > > > = nullptr> |
| constexpr | duration (Rep2 const &rep_in) noexcept(is_nothrow_copy_constructible_v< rep > &&is_nothrow_constructible_v< rep, Rep2 const & >) |
| | Constructor from a representation value.
|
| |
| constexpr auto | count () const noexcept(is_nothrow_copy_constructible_v< rep >) -> rep |
| | Returns the tick count.
|
| |
| constexpr auto | operator%= (duration const &rhs) noexcept(noexcept(declval< rep & >() %=rhs.count())) -> duration & |
| | Compound modulo assignment operator with duration.
|
| |
| constexpr auto | operator%= (rep const &rhs) noexcept(noexcept(declval< rep & >() %=rhs)) -> duration & |
| | Compound modulo assignment operator with scalar.
|
| |
| constexpr auto | operator*= (rep const &rhs) noexcept(noexcept(declval< rep & >() *=rhs)) -> duration & |
| | Compound multiplication assignment operator.
|
| |
| constexpr auto | operator+ () const noexcept(is_nothrow_copy_constructible_v< duration >) -> duration |
| | Unary plus operator.
|
| |
| constexpr auto | operator++ () noexcept(noexcept(++declval< rep & >())) -> duration & |
| | Pre-increment operator.
|
| |
| constexpr auto | operator++ (int) noexcept(is_nothrow_copy_constructible_v< duration > &&noexcept(++declval< rep & >())) -> duration |
| | Post-increment operator.
|
| |
| constexpr auto | operator+= (duration const &rhs) noexcept(noexcept(declval< rep & >()+=rhs.count())) -> duration & |
| | Compound addition assignment operator.
|
| |
| constexpr auto | operator- () const noexcept(is_nothrow_constructible_v< duration, rep >) -> duration |
| | Unary minus operator.
|
| |
| constexpr auto | operator-- () noexcept(noexcept(--declval< rep & >())) -> duration & |
| | Pre-decrement operator.
|
| |
| constexpr auto | operator-- (int) noexcept(is_nothrow_copy_constructible_v< duration > &&noexcept(--declval< rep & >())) -> duration |
| | Post-decrement operator.
|
| |
| constexpr auto | operator-= (duration const &rhs) noexcept(noexcept(declval< rep & >() -=rhs.count())) -> duration & |
| | Compound subtraction assignment operator.
|
| |
| constexpr auto | operator/= (rep const &rhs) noexcept(noexcept(declval< rep & >()/=rhs)) -> duration & |
| | Compound division assignment operator.
|
| |
template<typename Rep, typename Period>
class std::chrono::duration< Rep, Period >
Forward declaration of duration class template.
A time interval represented as a count of ticks of a given period.
The duration class template represents a time interval. It consists of a count of ticks of type Rep and a tick period, where the tick period is a compile-time rational fraction representing the number of seconds from one tick to the next.
- Template Parameters
-
| Rep | An arithmetic type or a class emulating an arithmetic type, representing the type of the tick count. Must not be a specialization of duration. |
| Period | A specialization of std::ratio, representing the tick period in seconds. Must be positive. Defaults to std::ratio<1> (1 second). |