Boost logo

Boost :

From: Emil Dotchevski (emil_at_[hidden])
Date: 2008-07-28 20:21:07

On Mon, Jul 28, 2008 at 4:43 PM, David Abrahams <dave_at_[hidden]> wrote:
> on Mon Jul 28 2008, "Emil Dotchevski" <> wrote:
>> On Mon, Jul 28, 2008 at 3:47 PM, David Abrahams <dave_at_[hidden]> wrote:
>>> on Mon Jul 28 2008, "Emil Dotchevski" <> wrote:
>>>> Any opinions on adding a new category in libs/libraries.htm, Error
>>>> Reporting, containing static_assert and the exception lib?
>>> I have a small objection. Or maybe not-so-small.
>>> Assertions are for precondition violations -- they detect programming
>>> errors. Exceptions are for failure to satisfy postconditions. They're
>>> really very different.
>> Since we don't have a category for detecting and reporting failures,
>> it seems a good idea to create one. I'm all for a better name for it,
>> of course.
>> The problem is that the exception lib doesn't belong in any of the
>> existing categories, except maybe the Miscellaneous category. :)
> Well, maybe that's where it belongs. static assert and Boost.Test are
> in the category of something like "program validation and testing" and
> don't belong in the same category as something designed for dealing with
> resource exhaustion and other essentially non-preventable and
> (hopefully) recoverable conditions.

Yes, exceptions are used to enforce postconditions, but this doesn't
contradict the view that exceptions are used to report failures (to
meet postconditions). There are different kinds of failures, but
despite the differences there is some commonality between asserts,
static asserts, exceptions, signals, std::cerr, logging, abort(),
exit(), etc. Naming a category "error reporting" seems to capture
that, and it seems more descriptive than "miscellaneous" (and from
that point of view static assert would belong to both "error
reporting" and "program validation and testing".)

Emil Dotchevski
Reverge Studios, Inc.

Boost list run by bdawes at, gregod at, cpdaniel at, john at