
On 9/21/05, Peter Dimov <pdimov@mmltd.net> wrote:
Excuse me for my jumping late into the thread, but what are the situations where one would want to use a BOOST_ASSERT with __assume instead of assert?
__assume on MSVC passes hints to the compiler for optimization, it assumes the expression is always true. So that a function like this: int f(int x) { __assume(x == 0) return x; } is optimized by the compiler and just returns 0, without checking for x. It really seems an interesting opportunity for using already assertions for optimizations. The original thread is "BOOST_ASSERT and __assume on MSVC" -- Felipe Magno de Almeida Developer from synergy and Computer Science student from State University of Campinas(UNICAMP). Unicamp: http://www.ic.unicamp.br Synergy: http://www.synergy.com.br "There is no dark side of the moon really. Matter of fact it's all dark."