Boost logo

Boost :

From: Darren Cook (darren_at_[hidden])
Date: 2005-10-04 18:28:58


> If that is the behavior of __assume(false), or at least given
> that it is a reasonable interpretation of what it could do, then
> including __assume() in BOOST_ASSERT() seems a little dangerous.

Which brings up back to the start of this thread :-). But what I've not
understood is why the assert macro cannot just define the use of assume
when not using asserts (i.e. in the release version), i.e.

#if USE_ASSERTS
  #define BOOST_ASSERT(x) assert(x)
#else
  #if OKAY_TO_USE_ASSUME
    #define BOOST_ASSERT(x) __assume(x)
  #else
    #define BOOST_ASSERT(x) ((void)0)
  #endif
#endif

I think it is fair to assume people don't have assert(false) in code
that is ready for release - it is just used temporarily during
debugging. But just to be sure OKAY_TO_USE_ASSUME should be off by default.

Darren


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk