
29 May
2011
29 May
'11
12:26 a.m.
[Jeffrey Lee Hellrung, Jr.]
struct _boost_explicit_operator_bool_struct { int _dummy; int member; }; \
[STL]
You don't need two data members.
[Jeffrey Lee Hellrung, Jr.]
According to Andrey Semashev (to whom I credit the technique to, and should've cited in the above post), you do need two data members, as some compilers interpret a pointer-to-first-member as equal to 0 (i.e., convertible to false). I honestly don't know if such compilers exist or are technically allowed to do that...
That would be crazy nonconformant. And depressing if true. STL