Implement wxDateTime::Is{EqualTo,{Earlier,Later}Than}() in terms of operators
Avoid duplicating the same code, even if it's trivial, in both places. Notice that these functions are implemented in terms of operators and not vice versa because we have no functions corresponding to operator<=() or operator>=().
This commit is contained in:
parent
d47efc42ff
commit
fda904ea77
@ -1768,23 +1768,17 @@ inline wxDateTime wxDateTime::GetYearDay(wxDateTime_t yday) const
|
||||
|
||||
inline bool wxDateTime::IsEqualTo(const wxDateTime& datetime) const
|
||||
{
|
||||
wxASSERT_MSG( IsValid() && datetime.IsValid(), wxT("invalid wxDateTime"));
|
||||
|
||||
return m_time == datetime.m_time;
|
||||
return *this == datetime;
|
||||
}
|
||||
|
||||
inline bool wxDateTime::IsEarlierThan(const wxDateTime& datetime) const
|
||||
{
|
||||
wxASSERT_MSG( IsValid() && datetime.IsValid(), wxT("invalid wxDateTime"));
|
||||
|
||||
return m_time < datetime.m_time;
|
||||
return *this < datetime;
|
||||
}
|
||||
|
||||
inline bool wxDateTime::IsLaterThan(const wxDateTime& datetime) const
|
||||
{
|
||||
wxASSERT_MSG( IsValid() && datetime.IsValid(), wxT("invalid wxDateTime"));
|
||||
|
||||
return m_time > datetime.m_time;
|
||||
return *this > datetime;
|
||||
}
|
||||
|
||||
inline bool wxDateTime::IsStrictlyBetween(const wxDateTime& t1,
|
||||
|
Loading…
Reference in New Issue
Block a user