Boost logo

Boost :

From: Felipe Magno de Almeida (felipe.m.almeida_at_[hidden])
Date: 2005-09-14 03:52:45

On 9/13/05, Marcin Kalicinski <kalita_at_[hidden]> wrote:
> Hi All,


> 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!

Wow, I liked this.
I think ASSERT should be __assume when NDEBUG is defined.

> And the comparison is gone.
> cheers,
> Marcin

   Felipe Magno de Almeida
Developer from synergy and Computer Science student from State
University of Campinas(UNICAMP).
"There is no dark side of the moon really. Matter of fact it's all dark."

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