Make wxTimeSpan::operator-() const
Due to an oversight, it wasn't declared as const, making it impossible to subtract from a const wxTimeSpan object. Fix this and add a unit test verifying that this compiles and works as expected. Closes #17583.
This commit is contained in:
@@ -1210,7 +1210,7 @@ public:
|
||||
inline wxTimeSpan& Subtract(const wxTimeSpan& diff);
|
||||
// subtract another timespan
|
||||
wxTimeSpan& operator-=(const wxTimeSpan& diff) { return Subtract(diff); }
|
||||
inline wxTimeSpan operator-(const wxTimeSpan& ts)
|
||||
inline wxTimeSpan operator-(const wxTimeSpan& ts) const
|
||||
{
|
||||
return wxTimeSpan(GetValue() - ts.GetValue());
|
||||
}
|
||||
|
Reference in New Issue
Block a user