From e51b17a1f9de88035fa051fbac8b074f507e775d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 9 Nov 2004 19:35:33 +0000 Subject: [PATCH] don't define comparison operators for wxString and wx[W]CharBuffer when wxUSE_STL == 1 neither git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30401 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/string.h | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/include/wx/string.h b/include/wx/string.h index ff2e4d2ceb..db9a54b8b3 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -1433,14 +1433,6 @@ inline bool operator>=(const wxString& s1, const wxChar * s2) inline bool operator>=(const wxChar * s1, const wxString& s2) { return s2.Cmp(s1) <= 0; } -#endif // !wxUSE_STL - -// comparison with char -inline bool operator==(wxChar c, const wxString& s) { return s.IsSameAs(c); } -inline bool operator==(const wxString& s, wxChar c) { return s.IsSameAs(c); } -inline bool operator!=(wxChar c, const wxString& s) { return !s.IsSameAs(c); } -inline bool operator!=(const wxString& s, wxChar c) { return !s.IsSameAs(c); } - #if wxUSE_UNICODE inline bool operator==(const wxString& s1, const wxWCharBuffer& s2) { return (s1.Cmp((const wchar_t *)s2) == 0); } @@ -1461,16 +1453,12 @@ inline bool operator!=(const wxCharBuffer& s1, const wxString& s2) { return (s2.Cmp((const char *)s1) != 0); } #endif // wxUSE_UNICODE/!wxUSE_UNICODE -#if !wxUSE_STL - wxString WXDLLIMPEXP_BASE operator+(const wxString& string1, const wxString& string2); wxString WXDLLIMPEXP_BASE operator+(const wxString& string, wxChar ch); wxString WXDLLIMPEXP_BASE operator+(wxChar ch, const wxString& string); wxString WXDLLIMPEXP_BASE operator+(const wxString& string, const wxChar *psz); wxString WXDLLIMPEXP_BASE operator+(const wxChar *psz, const wxString& string); -#endif // !wxUSE_STL - #if wxUSE_UNICODE inline wxString operator+(const wxString& string, const wxWCharBuffer& buf) { return string + (const wchar_t *)buf; } @@ -1483,6 +1471,15 @@ inline wxString operator+(const wxCharBuffer& buf, const wxString& string) { return (const char *)buf + string; } #endif // wxUSE_UNICODE/!wxUSE_UNICODE +#endif // !wxUSE_STL + +// comparison with char (those are not defined by std::[w]string and so should +// be always available) +inline bool operator==(wxChar c, const wxString& s) { return s.IsSameAs(c); } +inline bool operator==(const wxString& s, wxChar c) { return s.IsSameAs(c); } +inline bool operator!=(wxChar c, const wxString& s) { return !s.IsSameAs(c); } +inline bool operator!=(const wxString& s, wxChar c) { return !s.IsSameAs(c); } + // --------------------------------------------------------------------------- // Implementation only from here until the end of file // ---------------------------------------------------------------------------