
1 Mar
2014
1 Mar
'14
11:44 a.m.
Andrey Semashev wrote:
Leaving the note about usefulness of this warning aside, you could work around it e.g. by using preprocessor tricks:
#define BOOST_ASSERTL(expr, level)\ BOOST_ASSERTL_ ## level(expr)
I'd thought of that. But it works only if level is a number token or a macro expanding to a number token, and the implementation can no longer not care what the levels are, it has to list them as BOOST_ASSERTL_0 and so on.
or template specialization:
#define BOOST_ASSERTL(expr, level)\ assert_impl< (level) <= BOOST_ASSERT_LEVEL >::do((expr), #expr, __FILE__, __LINE__)
This will still evaluate 'expr'.