From 3b62433a3f097f73a23a69477322360aedb112ea Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 6 Jan 2024 23:02:45 +0100 Subject: [PATCH] Hide overloaded wxTimeSpan and wxDateSpan operator*() Define them in these classes scope instead of at the global scope. --- include/wx/datetime.h | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/include/wx/datetime.h b/include/wx/datetime.h index 6e39ce424b..4f9d5cfab9 100644 --- a/include/wx/datetime.h +++ b/include/wx/datetime.h @@ -1278,6 +1278,8 @@ public: return wxTimeSpan(*this).Multiply(n); } + friend WXDLLIMPEXP_BASE wxTimeSpan operator*(int n, const wxTimeSpan& ts); + // return this timespan with opposite sign wxTimeSpan Negate() const { return wxTimeSpan(-GetValue()); } // negate the value of the timespan @@ -1531,6 +1533,7 @@ public: { return wxDateSpan(*this).Multiply(n); } + friend WXDLLIMPEXP_BASE wxDateSpan operator*(int n, const wxDateSpan& ds); // ds1 == d2 if and only if for every wxDateTime t t + ds1 == t + ds2 inline bool operator==(const wxDateSpan& ds) const @@ -2243,22 +2246,6 @@ inline wxDateSpan wxDateSpan::Subtract(const wxDateSpan& other) const #undef MODIFY_AND_RETURN -// ============================================================================ -// binary operators -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxTimeSpan operators -// ---------------------------------------------------------------------------- - -wxTimeSpan WXDLLIMPEXP_BASE operator*(int n, const wxTimeSpan& ts); - -// ---------------------------------------------------------------------------- -// wxDateSpan -// ---------------------------------------------------------------------------- - -wxDateSpan WXDLLIMPEXP_BASE operator*(int n, const wxDateSpan& ds); - // ============================================================================ // other helper functions // ============================================================================