
Eugene Wee <crystalrecursion <at> gmail.com> writes:
I glanced over "explicit conversion operators" in C++0x. It did not struck me as relevant to safe_bool. Care to elaborate?
It is relevant since you can say, define an explicit conversion function to convert to bool, and yet avoid the very problems with say, also allowing implicit conversion to int, that the safe bool idiom is used to avoid. In other words, it is a language feature directly designed to replace the safe bool idiom, and more.
Ah, my bad, I was damn looking at something completely else. :-( Now I found the relevant section (12.3.2. Conversion functions) and see that adding 'explicit' seem to fix all the problems we are now trying to solve with safe_bool. Thanks for setting me straight. Problem solved then... well, it is being taken care of, anyway. Sorry for all the noise. Thanks, V.