From 7fba7cfd5d5a5d5f2bdef4ca558a8d954b06fa8e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 24 Jun 2003 18:45:18 +0000 Subject: [PATCH] backported wxDateSpan comparison operators from trunk git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@21358 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/datetime.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/wx/datetime.h b/include/wx/datetime.h index ca0c20ea0f..1aee3708ba 100644 --- a/include/wx/datetime.h +++ b/include/wx/datetime.h @@ -1520,6 +1520,24 @@ inline bool WXDLLEXPORT operator!=(const wxTimeSpan &t1, const wxTimeSpan &t2) // wxDateSpan // ---------------------------------------------------------------------------- +// comparison +// ---------- + +// ds1 == d2 if and only if for every wxDateTime t t + ds1 == t + ds2 +inline WXDLLEXPORT bool operator==(const wxDateSpan& ds1, + const wxDateSpan& ds2) +{ + return ds1.GetYears() == ds2.GetYears() && + ds1.GetMonths() == ds2.GetMonths() && + ds1.GetTotalDays() == ds2.GetTotalDays(); +} + +inline WXDLLEXPORT bool operator!=(const wxDateSpan& ds1, + const wxDateSpan& ds2) +{ + return !(ds1 == ds2); +} + // arithmetics // -----------