Boost logo

Boost :

From: Felipe Magno de Almeida (felipe.m.almeida_at_[hidden])
Date: 2005-09-19 14:50:38

On 9/19/05, Rob Stewart <stewart_at_[hidden]> wrote:
> From: "Marcin Kalicinski" <kalita_at_[hidden]>
> >
> > I think we should rather base on NDEBUG macro, the same that determines the
> > behavior of assert. The whole change then boils down to adding these 6 lines
> > at the end of assert.hpp:
> >
> > #include <boost/config.hpp>
> > #if defined(BOOST_MSVC) && defined(NDEBUG)
> > # define BOOST_ASSUME(e) { BOOST_ASSERT(e); if (e); else __assume(0); }
> Interesting. I'd have thought that calling __assume(0) was
> useless, but it tells the optimizer that the else clause won't
> occur. I wonder if that will work at all or as well as
> BOOST_ASSERT(e); __assume(e);.

I think it works exactly(seeing documentation and some tests)
What a __assume(0) means that the assertion is always false, which
means that that place cant be executed... I think __assume should
replace assert exactly as is.

> There's a real problem with your solution, however: you evaluate
> the expression twice. Won't the simpler, more direct form work?
> --
> Rob Stewart stewart_at_[hidden]
> Software Engineer
> Susquehanna International Group, LLP using std::disclaimer;
> _______________________________________________
> Unsubscribe & other changes:

   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