[wx-dev] Re: #9672: wx 2.9 Ansi/Unicode Combi-wxString breaks compatibility with std::[w]string and introduces subtle errors

Robert Roebling robert at roebling.de
Wed Jul 2 06:04:24 PDT 2008



> ofstream::open(wxString) fails to compile on Visual Studio (because open 
> is overloaded there accepting char and wchar_t).
> 
> wxString::c_str() suddenly no longer returns char* or wchar_t*, but a 
> pointer to a wxWidgets datatype. This datatype has two implicit 
> conversions to char* and wchar_t*. This breaks template deduction 
> because it is no longer clear which conversion should be used.

Maybe we should only allow implicit conversion to char* if a special
compile flag has been set (instead of by default). Are your problems
solved if you remove the implicit conversions to "const char*" and to
"const unsigned char*" from class wxCStrData in wx/string.h ?

Removing subtle errors should have precedence over laziness when
converting from ANSI to Unicode.

  Robert




More information about the wx-dev mailing list