14 Mar
2013
14 Mar
'13
6:30 p.m.
bool do_something_with_a_Testable() { Testable t; [...] // return t; doesn't work return !!t; }
That's the whole point: the convertion is explicit so you can't "return t" and expect an implicit conversion, you need a static_cast if that's what you *really* want to do: bool do_something_with_a_Testable() { Testable t; [...] return static_cast<bool>(t); } Which IMO much better expresses what you're trying to do anyway, John.