David Abrahams wrote:
> "Andrei Alexandrescu" <[EMAIL PROTECTED]> writes:
>
>> By the way, I believe what would be more interesting for Boost is the
>> recent article (http://www.cuj.com/experts/2106/alexandr.htm),
>> written by Petru Marginean and myself. (Warning - the article has
>> recently been
>> updated.)
>>
>> We have good experience in reducing source code size by using
>> enforcements. There are a number of interesting techniques used out
>> there, and I believe ENFORCE would be quite useful as a Boost
>> library.
>
> 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, 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.



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to