
29 Oct
2007
29 Oct
'07
5:04 p.m.
Steven Watanabe wrote:
template<class T> void use_variable(const T&) {}
#if ENABLE_ASSERT #define BOOST_ASSERT(x) normal implementation #else #define BOOST_ASSERT(x) use_variable(x) #endif
Looks good to me :-)
@Peter: You are listed as the author of assert.hpp, do you think this could be done? Or will this disable the compilers optimizer, so he can do away with the return value?
Roland aka speedsnail
This doesn't seem to do what you want. BOOST_ASSERT( this_takes_time() ); // breaking change The introduction of BOOST_VERIFY with a similar implementation would probably be best. #if ENABLE_ASSERT #define BOOST_VERIFY(x) BOOST_ASSERT(x) #else #define BOOST_VERIFY(x) ((void)(x)) #endif