Michael Stahl wrote: > On 12/03/2009 13:36, Mathias Bauer wrote: >> Rainman Lee wrote: >> >>> Hi Andrew >>> I know that implicit conversions usually bring more side effects than >>> convenience. But it is not the reason that we should give all them up >>> I think ;) >>> There is no implicit conversion from std::string to const char*, >>> because if a string is destroyed, the pointer to its content will be >>> invalid. >> >> No, there indeed is no implicit conversion primarily for the reason >> mentioned by Andrew (at least the "inventor" of this class told me so >> many years ago): developers should not inadvertedly pass non-ascii >> character strings to a UniCode string ctor. Creating a UniCode string >> from a character string always needs an accompanying string encoding as >> parameter. > > if the inventor of OUString was indeed so conscientious, then i really > have to wonder...
No reason to wonder. Intending to do something does not necessarily mean that you succeed. :-) It seems that it wasn't his intention to prevent all implicit conversions (there still are three of them, one using a single sal_UniCode as you showed), he just wanted to control how character string constants are treated. Regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to "[email protected]". I use it for the OOo lists and only rarely read other mails sent to it. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
