Boost logo

Boost :

From: Ullrich Koethe (u.koethe_at_[hidden])
Date: 2001-11-14 12:15:40


David Abrahams wrote:
> > > > 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.
>

You are right, but any decent error reporting scheme will require
allocation of some ressources. It's a tradeoff between convenience and
safety, and I would probably vote on the convenience side.

Ulli

-- 
 ________________________________________________________________
|                                                                |
| Ullrich Koethe  Universität Hamburg / University of Hamburg    |
|                 FB Informatik / Dept. of Computer Science      |
|                 AB Kognitive Systeme / Cognitive Systems Group |
|                                                                |
| Phone: +49 (0)40 42883-2573                Vogt-Koelln-Str. 30 |
| Fax:   +49 (0)40 42883-2572                D - 22527 Hamburg   |
| Email: u.koethe_at_[hidden]               Germany             |
|        koethe_at_[hidden]                        |
| WWW:   http://kogs-www.informatik.uni-hamburg.de/~koethe/      |
|________________________________________________________________|

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