diff --git a/include/wx/string.h b/include/wx/string.h index 888a1faaf4..56ef478ee8 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -168,9 +168,6 @@ inline int Stricmp(const char *psz1, const char *psz2) #if wxUSE_STL -// return an empty wxString (doesn't make much sense with wxUSE_STL == 1) -inline const wxString wxGetEmptyString() { wxString(); } - #include "wx/beforestd.h" #include #include "wx/afterstd.h" @@ -192,9 +189,6 @@ inline const wxString wxGetEmptyString() { wxString(); } #else // if !wxUSE_STL -// return an empty wxString -inline const wxString& wxGetEmptyString() { return *(wxString *)&wxEmptyString; } - #ifndef HAVE_STD_STRING_COMPARE #define HAVE_STD_STRING_COMPARE #endif @@ -1291,6 +1285,17 @@ public: #include "wx/arrstr.h" #endif +#if wxUSE_STL + // return an empty wxString (not very useful with wxUSE_STL == 1) + inline const wxString wxGetEmptyString() { wxString(); } +#else // !wxUSE_STL + // return an empty wxString (more efficient than wxString() here) + inline const wxString& wxGetEmptyString() + { + return *(wxString *)&wxEmptyString; + } +#endif // wxUSE_STL/!wxUSE_STL + // ---------------------------------------------------------------------------- // wxStringBuffer: a tiny class allowing to get a writable pointer into string // ----------------------------------------------------------------------------