std::chrono::duration<Rep,Period>::operator+(unary), std::chrono::duration<Rep,Period>::operator-(unary) - cppreference.com (original) (raw)
| (1) | | | | ----------------------------------------------------------------------------------------------- | | ------------- | | constexpr duration operator+() const; | | (until C++17) | | constexpr std::common_type_t<duration> operator+() const; | | (since C++17) | | (2) | | | | constexpr duration operator-() const; | | (until C++17) | | constexpr std::common_type_t<duration> operator-() const; | | (since C++17) |
Implements unary plus and unary minus for the durations.
If rep_ is a member variable holding the number of ticks in a duration object, and D is the return type,
Equivalent to return D(*this);.
Equivalent to return D(-rep_);.
[edit] Parameters
(none)
[edit] Return value
A copy of this duration object.
A copy of this duration object, with the number of ticks negated.