From a6331747d2ee5703bf318d3842db66afd25cd880 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 26 Sep 2015 16:09:56 -0400 Subject: [PATCH] ISO8601d: Added ::oprator++ (postfix) --- src/ISO8601.cpp | 14 ++++++++++++++ src/ISO8601.h | 1 + 2 files changed, 15 insertions(+) diff --git a/src/ISO8601.cpp b/src/ISO8601.cpp index 85813a4d3..797828ab8 100644 --- a/src/ISO8601.cpp +++ b/src/ISO8601.cpp @@ -1243,6 +1243,20 @@ void ISO8601d::operator++ () _date = tomorrow._date; } +//////////////////////////////////////////////////////////////////////////////// +// Postfix increment by one day. +void ISO8601d::operator++ (int) +{ + ISO8601d tomorrow = (startOfDay () + 90001).startOfDay (); + tomorrow = ISO8601d (tomorrow.month (), + tomorrow.day (), + tomorrow.year (), + hour (), + minute (), + second ()); + _date = tomorrow._date; +} + //////////////////////////////////////////////////////////////////////////////// void ISO8601p::clear () { diff --git a/src/ISO8601.h b/src/ISO8601.h index 0694a149c..f5fbc1e9c 100644 --- a/src/ISO8601.h +++ b/src/ISO8601.h @@ -88,6 +88,7 @@ public: void operator-- (); // Prefix void operator-- (int); // Postfix void operator++ (); // Prefix + void operator++ (int); // Postfix private: void clear ();