
Would it be possible to extract operator_bool.hpp into a reusable macro,
something like:
#include<boost/utility/operator_bool.hpp> struct some { BOOST_EXPLICIT_OPERATOR_BOOL( m_value != 0; )
int m_value; };
What do you think?
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:
Usage example:
struct some { BOOST_LOG_OPERATOR_UNSPECIFIED_BOOL() bool operator! () const { return m_value == 0; }
int m_value; }; _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Nice! Maybe you could move the macro from log/detail into log/utility? There's already many small things in your utility folder IIRC, this one would make a good addition. Thanks, Christian