From ae682782457ef2f22281857c996e0d22c99a6aa0 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Wed, 19 Oct 2016 12:01:51 -0400 Subject: [PATCH] Add unary operators + and - to year --- date.html | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/date.html b/date.html index 01e1517..92d7408 100644 --- a/date.html +++ b/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;

+
+constepxr year year::operator-() const noexcept;
+
+ +
+

+Returns: year{-y_}. +

+
+ +
+constepxr year year::operator+() const noexcept;
+
+ +
+

+Returns: *this. +

+
+
 constexpr bool year::is_leap() const noexcept;