
21 Sep
2005
21 Sep
'05
11:08 p.m.
Ariel Badichi <abadichi@bezeqint.net> writes:
David Abrahams wrote:
Another thought:
g = 0;
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 don't love it, but maybe it will get your ideas flowing.
Something like:
g = guard::inactive; g = guard::active;
or maybe
g = guard::dismissed; g = !guard::dismissed; (ugh)
?
No, the whole point of g = 0; was to get you out of having to find a name for this thing.
Overloading operators here may be a bit counter-intuitive.
Maybe so. I have no strong opinion on the matter. -- Dave Abrahams Boost Consulting www.boost-consulting.com