Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 2000-07-25 15:40:18

Reid Sweatman wrote:

>I'm gonna admit I'm dumb and ask for clarification here. I understand
>issues surrounding empty throw specifications, and the problem with
>exception specifications and inlining. But I'm unclear on whether you
>someone earlier in the thread) are maintaining that non-empty
>should *never* be used? Or do you mean only when the function is as
>and time-critical as in smart_ptr?

No, I don't think people are saying they should never be used.

If the functions aren't inline and time-critical, and if the maintenance
problems caused when an exception gets added to the list somewhere down the
line are not a worry, then maybe they might make some sense. So non-empty
exception-specs would probably make more sense in application specific code
that in general purpose templates, I guess. But not too huge an app, or
maintenance is a problem.

Others have also commented that exception-specs are like const; use
consistently or not at all. With const there is a clear benefit which far
outweighs the cost. The trade-off is not as clear for
exception-specs. That's probably why you don't seem them used a great


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