Boost logo

Boost :

Subject: Re: [boost] [safebool] Can we generalize it and put it into utilities?
From: Eugene Wee (crystalrecursion_at_[hidden])
Date: 2009-03-31 22:10:28


Hi,

On Wed, Apr 1, 2009 at 6:20 AM, Vladimir Batov
<vladimir.batov_at_[hidden]>wrote:

> 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.

Regards,
Eugene Wee


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk