
22 Sep
2005
22 Sep
'05
12:37 a.m.
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). By the way, that might work well for smart pointers; why don't shared_ptr and friends use this idiom?
No, the whole point of
g = 0;
was to get you out of having to find a name for this thing.
:)