Boost logo

Boost :

Subject: Re: [boost] The noexcept Specifier & Block
From: Peter Dimov (pdimov_at_[hidden])
Date: 2009-04-17 16:39:18

Alexander Terekhov:

> Avoiding unwinding for unexpected exceptions, for example.

The reason the standard specifies calling unexpected() at the exception spec
point is conceptually sound (but practically not that useful). Consider

void f()
    throw X();

void g() throw(Y)

void h() throw(Z)

If unexpected() is always invoked at the throw point, there is no way for an
exception to escape this call stack. If it's invoked at the exception
specification points, it can, in principle, first throw a Y, then a Z. The
primary purpose of unexpected(), as originally envisaged (I presume), is
exception translation.

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