Make wxFontBase::operator==() symmetric by taking wxFontBase
Taking wxFont here resulted in a potential ambiguity when comparing wxFont objects, at least according to clang 12 in C++20 mode. Avoid this by just taking wxFontBase here, as now the operator is fully symmetric, rather than exactly matching only (wxFontBase, wxFont) and matching (wxFont, wxFont) either directly or with reversed arguments order.
This commit is contained in:
@@ -395,8 +395,8 @@ public:
|
||||
#endif // wxUSE_PRIVATE_FONTS
|
||||
|
||||
// comparison
|
||||
bool operator==(const wxFont& font) const;
|
||||
bool operator!=(const wxFont& font) const { return !(*this == font); }
|
||||
bool operator==(const wxFontBase& font) const;
|
||||
bool operator!=(const wxFontBase& font) const { return !(*this == font); }
|
||||
|
||||
// accessors: get the font characteristics
|
||||
virtual int GetPointSize() const;
|
||||
|
Reference in New Issue
Block a user