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. 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. Would be grateful to know all problems about it ;) Thank you!
Not able to enumerate all possible problems, because there have been so many specific problems.
For example, what happens when you define a conversion from a pointer to a boolean? Comparing two pointers might convert to a boolean, which are then compared. (see http://www.open-std.org/JTC1/sc22/wg21/docs/papers/2004/n1592.pdf)
I have seen methods that require a type as an argument. An argument of the wrong type is then automatically converted to match the argument. This might be what you desire, and perhaps not.
-- Andrew Pitonyak My Macro Document: http://www.pitonyak.org/AndrewMacro.odt My Book: http://www.hentzenwerke.com/catalog/oome.htm Info: http://www.pitonyak.org/oo.php See Also: http://documentation.openoffice.org/HOW_TO/index.html --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
