[time.cal.year.members]

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

## 30.8 The civil calendar [[time.cal]](time.cal#year.members)

### 30.8.5 Class year [[time.cal.year]](time.cal.year#members)

#### 30.8.5.2 Member functions [time.cal.year.members]

[ð](#lib:year,constructor)

`constexpr explicit year(int y) noexcept;
`

[1](#1)

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

*Effects*: Initializes y_ with y[.](#1.sentence-1)

The value held is unspecified if y is not in the range [-32767, 32767][.](#1.sentence-2)

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

`constexpr year& operator++() noexcept;
`

[2](#2)

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

*Effects*: ++y_[.](#2.sentence-1)

[3](#3)

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

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

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

`constexpr year operator++(int) noexcept;
`

[4](#4)

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

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

[5](#5)

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

*Returns*: A copy of *this as it existed on entry to this member function[.](#5.sentence-1)

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

`constexpr year& operator--() noexcept;
`

[6](#6)

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

*Effects*: --y_[.](#6.sentence-1)

[7](#7)

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

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

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

`constexpr year operator--(int) noexcept;
`

[8](#8)

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

*Effects*: --(*this)[.](#8.sentence-1)

[9](#9)

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

*Returns*: A copy of *this as it existed on entry to this member function[.](#9.sentence-1)

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

`constexpr year& operator+=(const years& y) noexcept;
`

[10](#10)

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

*Effects*: *this = *this + y[.](#10.sentence-1)

[11](#11)

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

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

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

`constexpr year& operator-=(const years& y) noexcept;
`

[12](#12)

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

*Effects*: *this = *this - y[.](#12.sentence-1)

[13](#13)

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

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

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

`constexpr year operator+() const noexcept;
`

[14](#14)

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

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

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

`constexpr year operator-() const noexcept;
`

[15](#15)

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

*Returns*: year{-y_}[.](#15.sentence-1)

[ð](#lib:is_leap,year)

`constexpr bool is_leap() const noexcept;
`

[16](#16)

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

*Returns*: y_ % 4 == 0 && (y_ % 100 != 0 || y_ % 400 == 0)[.](#16.sentence-1)

[ð](#lib:operator_int,year)

`constexpr explicit operator int() const noexcept;
`

[17](#17)

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

*Returns*: y_[.](#17.sentence-1)

[ð](#lib:ok,year)

`constexpr bool ok() const noexcept;
`

[18](#18)

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

*Returns*: min().y_ <= y_ && y_ <= max().y_[.](#18.sentence-1)

[ð](#lib:min,year)

`static constexpr year min() noexcept;
`

[19](#19)

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

*Returns*: year{-32767}[.](#19.sentence-1)

[ð](#lib:max,year)

`static constexpr year max() noexcept;
`

[20](#20)

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

*Returns*: year{32767}[.](#20.sentence-1)
