Add unary operators + and - to year

This commit is contained in:
Howard Hinnant
2016-10-19 12:01:51 -04:00
parent 769dc09f28
commit ae68278245

View File

@@ -2492,6 +2492,9 @@ public:
year& operator+=(const years& y) noexcept; year& operator+=(const years& y) noexcept;
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 bool is_leap() const noexcept;
constexpr explicit operator int() const noexcept; constexpr explicit operator int() const noexcept;
@@ -2634,6 +2637,26 @@ year& year::operator-=(const years& y) noexcept;
</p> </p>
</blockquote> </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> <pre>
constexpr bool year::is_leap() const noexcept; constexpr bool year::is_leap() const noexcept;
</pre> </pre>