abandon attempts to make wxAnyStrPtr behave as bool: user-defined logical operators don't short circuit silently breaking existing code so it is better to not provide them at all; instead simply return bool from the new versions taking wxString::const_iterator; advise to use the new versions in the new code and so in our own files
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59829 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -136,13 +136,5 @@ private:
|
||||
wxDECLARE_NO_ASSIGN_CLASS(wxAnyStrPtr);
|
||||
};
|
||||
|
||||
// at least for VC6 and VC7 these operators are needed too, otherwise boolean
|
||||
// expressions involving wxAnyStrPtr don't compile because of ambiguity between
|
||||
// built-in overloads of these operators for (bool, bool/char*/wchar_t*)
|
||||
inline bool operator||(const wxAnyStrPtr& p, bool v) { return (bool)p || v; }
|
||||
inline bool operator||(bool v, const wxAnyStrPtr& p) { return v || (bool)p; }
|
||||
inline bool operator&&(const wxAnyStrPtr& p, bool v) { return (bool)p && v; }
|
||||
inline bool operator&&(bool v, const wxAnyStrPtr& p) { return v && (bool)p; }
|
||||
|
||||
#endif // _WX_ANYSTR_H_
|
||||
|
||||
|
Reference in New Issue
Block a user