
"Scott McMurray" <me22.ca+boost@gmail.com> wrote in message news:fa28b9251003011306k77a61047l4e0236ebbd6d8dc3@mail.gmail.com...
Is there a reason it can't just always look at operator!?
I've been using a macro like this, since I don't need the workarounds:
#define OPERATOR_SAFE_BOOL(for_type) \ typedef bool (for_type::*unspecified_bool_type)() const; \ operator unspecified_bool_type() const { \ return !*this ? 0 : &for_type::operator!; \ }
This forces classes to have operator! and it still suffers from efficiency issues outlined in the first post... -- "What Huxley teaches is that in the age of advanced technology, spiritual devastation is more likely to come from an enemy with a smiling face than from one whose countenance exudes suspicion and hate." Neil Postman