forked from HowardHinnant/date
Add unary operators + and - to year
This commit is contained in:
23
date.html
23
date.html
@@ -2492,6 +2492,9 @@ public:
|
||||
year& operator+=(const years& y) noexcept;
|
||||
year& operator-=(const years& y) noexcept;
|
||||
|
||||
constexpr year operator-() const noexcept;
|
||||
constexpr year operator+() const noexcept;
|
||||
|
||||
constexpr bool is_leap() const noexcept;
|
||||
|
||||
constexpr explicit operator int() const noexcept;
|
||||
@@ -2634,6 +2637,26 @@ year& year::operator-=(const years& y) noexcept;
|
||||
</p>
|
||||
</blockquote>
|
||||
|
||||
<pre>
|
||||
constepxr year year::operator-() const noexcept;
|
||||
</pre>
|
||||
|
||||
<blockquote>
|
||||
<p>
|
||||
<i>Returns:</i> <code>year{-y_}</code>.
|
||||
</p>
|
||||
</blockquote>
|
||||
|
||||
<pre>
|
||||
constepxr year year::operator+() const noexcept;
|
||||
</pre>
|
||||
|
||||
<blockquote>
|
||||
<p>
|
||||
<i>Returns:</i> <code>*this</code>.
|
||||
</p>
|
||||
</blockquote>
|
||||
|
||||
<pre>
|
||||
constexpr bool year::is_leap() const noexcept;
|
||||
</pre>
|
||||
|
Reference in New Issue
Block a user