[time.duration.arithmetic]

# 30 Time library [[time]](./#time)

## 30.5 Class template duration [[time.duration]](time.duration#arithmetic)

### 30.5.4 Arithmetic [time.duration.arithmetic]

[ð](#lib:operator+,duration)

`constexpr common_type_t<duration> operator+() const;
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1404)

*Returns*: common_type_t<duration>(*this)[.](#1.sentence-1)

[ð](#lib:operator-,duration)

`constexpr common_type_t<duration> operator-() const;
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1415)

*Returns*: common_type_t<duration>(-rep_)[.](#2.sentence-1)

[ð](#lib:operator++,duration)

`constexpr duration& operator++();
`

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1426)

*Effects*: Equivalent to: ++rep_[.](#3.sentence-1)

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1430)

*Returns*: *this[.](#4.sentence-1)

[ð](#lib:operator++,duration_)

`constexpr duration operator++(int);
`

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1441)

*Effects*: Equivalent to: return duration(rep_++);

[ð](#lib:operator--,duration)

`constexpr duration& operator--();
`

[6](#6)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1452)

*Effects*: Equivalent to: --rep_[.](#6.sentence-1)

[7](#7)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1456)

*Returns*: *this[.](#7.sentence-1)

[ð](#lib:operator--,duration_)

`constexpr duration operator--(int);
`

[8](#8)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1467)

*Effects*: Equivalent to: return duration(rep_--);

[ð](#lib:operator+=,duration)

`constexpr duration& operator+=(const duration& d);
`

[9](#9)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1478)

*Effects*: Equivalent to: rep_ += d.count()[.](#9.sentence-1)

[10](#10)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1482)

*Returns*: *this[.](#10.sentence-1)

[ð](#lib:operator-=,duration)

`constexpr duration& operator-=(const duration& d);
`

[11](#11)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1493)

*Effects*: Equivalent to: rep_ -= d.count()[.](#11.sentence-1)

[12](#12)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1497)

*Returns*: *this[.](#12.sentence-1)

[ð](#lib:operator*=,duration)

`constexpr duration& operator*=(const rep& rhs);
`

[13](#13)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1508)

*Effects*: Equivalent to: rep_ *= rhs[.](#13.sentence-1)

[14](#14)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1512)

*Returns*: *this[.](#14.sentence-1)

[ð](#lib:operator/=,duration)

`constexpr duration& operator/=(const rep& rhs);
`

[15](#15)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1523)

*Effects*: Equivalent to: rep_ /= rhs[.](#15.sentence-1)

[16](#16)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1527)

*Returns*: *this[.](#16.sentence-1)

[ð](#lib:operator%25=,duration)

`constexpr duration& operator%=(const rep& rhs);
`

[17](#17)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1538)

*Effects*: Equivalent to: rep_ %= rhs[.](#17.sentence-1)

[18](#18)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1542)

*Returns*: *this[.](#18.sentence-1)

[ð](#lib:operator%25=,duration_)

`constexpr duration& operator%=(const duration& rhs);
`

[19](#19)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1553)

*Effects*: Equivalent to: rep_ %= rhs.count()[.](#19.sentence-1)

[20](#20)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1557)

*Returns*: *this[.](#20.sentence-1)
