Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-11-14 08:02:24


----- Original Message -----
From: <Msk_at_[hidden]>

> --- In boost_at_y..., Ullrich Koethe <u.koethe_at_c...> wrote:
> > Ullrich Koethe wrote:
> > >
> > > If I'm not mistaken, a similar mechanism is already part of the
> proposed
> > > version 2 of the test tools library. Please check it out in the
> boost
> > > files section.
> > >
> >
> > Oops, forgot to quote the reference:
> >
> > Msk_at_X... wrote:
> > >
> > > if( num_widgets > max_widgets )
> > > {
> > > throw logic_error(
> > > BOOST_ERROR_MESSAGE << "num_widgets = " <<
> > > num_widgets << " is greater than maxwidgets = " <<
> > > max_widgets );
> > > }
> > >
<snip>
> our programmers can write simple statements like:
>
> VERIFY( p!=0, "no widget supplied" );
> VERIFY( p->m_status==normal,
> "abnormal widget, state = " << p->m_status );

My 2 cents: I worry a little about any error detection mechanism that
requires the allocation of resources. In particular, this streaming
interface looks on the surface like it could throw an exception before the
intended error is reported.

-Dave


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