// implicit conversion to C string
operator wxCStrData() const { return c_str(); }
- // these operators conflict with operators for conversion to std::string,
- // so they must be disabled in STL build:
+ // the first two operators conflict with operators for conversion to
+ // std::string and they must be disabled in STL build; the next one only
+ // makes sense if conversions to char* are also defined and not defining it
+ // in STL build also helps us to get more clear error messages for the code
+ // which relies on implicit conversion to char* in STL build
#if !wxUSE_STL
operator const char*() const { return c_str(); }
operator const wchar_t*() const { return c_str(); }
-#endif
// implicit conversion to untyped pointer for compatibility with previous
// wxWidgets versions: this is the same as conversion to const char * so it
// may fail!
operator const void*() const { return c_str(); }
+#endif // wxUSE_STL
// identical to c_str(), for MFC compatibility
const wxCStrData GetData() const { return c_str(); }