Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-04-26 16:44:07


"Edward Diener" <eddielee_at_[hidden]> writes:

>> I browsed the article (I confess to not having read everything, so
>> please correct any misapprehensions). My sense is that the technique
>> is oriented towards detecting programmer errors and responding via an
>> exception.
>
> I don't think ENFORCE is oriented toward that at all. There's no orientation
> involved other than to throw an exception based on a condition. I agree with
> you that direct programming errors should generally not throw exceptions but
> should ASSERT so that the programmer can fix the error. However I don't
> think ENFORCE has anything to do with this debate about when to ASSERT and
> when to throw exceptions. Perhaps the examples give the impression which you
> have

I think so.

> but I think the problem is just choosing better examples in which
> one would want to throw an exception and not a technical issue as to
> the benefits of using ENFORCE in order to simplify exception
> throwing.

Can you show me a better example? This is not a challenge. Really,
if this ENFORCE idea is a useful one I want to understand it.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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