
23 Apr
2010
23 Apr
'10
6:28 a.m.
Andrey Semashev wrote:
I think such a tool would be useful. But I found it more convenient to express explicit operator bool through operator!. This allows the check to be arbitrarily complex, and the approach adds to compatibility with some compilers. See here:
Can you explain why the dummy struct has *two* data members? Is it because some compilers interpret a pointer-to-member-object to the first data member of a class as convertible to false? Thanks, - Jeff