Boost logo

Boost :

From: Simon Buchan (simon_at_[hidden])
Date: 2005-09-14 22:47:40

Marcin Kalicinski wrote:
> Hi All,
> Have you considered modifying BOOST_ASSERT to use __assume on MSVC?
> Briefly speaking __assume(expr) is a hint for optimizer that 'expr'
> evaluates to nonzero. It can help optimize the code. Standalone use of
> __assume is not recommended because compiler does not check if the
> assumption is correct, and if it isn't the program is ill formed. But it
> fits perfectly in ASSERT macro. This way putting many ASSERTs will not only
> help to verify the code - it will also help the optimizer. Wow!
I don't get it, isn't the point of assert that it DOES check them? Or
did you mean something like GCC's __builtin_expect?

Boost list run by bdawes at, gregod at, cpdaniel at, john at