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.

> Fortunately, we don't have to consider during reference conversions.
> The only thing I am not very sure is whether there are some
> ambiguities that may be introduced by this implicit reference
> conversion.

Currently I also fail to see a potential problem for the case you
described. But of course absence of evidence is no evidence of absence. :-)

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]

Reply via email to