Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-09-21 20:38:22


Ariel Badichi <abadichi_at_[hidden]> writes:

> David Abrahams wrote:
>>>>it's easy to arrange that only a literal zero works there.
>>>
>>>How?
>>
>>
>> Allow assignment only from a private member pointer type. It's
>> similar to the operator safe_bool idiom.
>
> I thought you might mean that. That allows more than a literal zero,
> though (e.g., 5 * 5 - 25).

Yikes! I didn't know that. Too bad!

> By the way, that might work well for smart
> pointers; why don't shared_ptr and friends use this idiom?

Maybe because it allows more than a literal zero?

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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