throw specs on Standard destructors
Nathan Myers
ncm-nospam@cantrip.org
Tue Dec 10 13:09:00 GMT 2002
On Tue, Dec 10, 2002 at 02:53:02PM -0600, Benjamin Kosnik wrote:
> >First, in any function so declared that itself called a function
> >which might throw something not listed, the compiler would have to
> >generate code to catch them and call terminate().
> >
> >Second, if it later became necessary to allow such a function
> >to throw an exception not listed, any code that depended on its
> >previous spec would be broken.
> >
> >Third, any code that depends on tight throw specs in libstdc++
> >would not be portable to other implementations.
>
> Sorry. I was talking just about destructors, which I believe is clearly
> implied in the standard. (see references to standard in first post).
I think the first and third points still hold. The first makes
writing the patch less straightforward than it might seem. The
third implies that any throw specs we do add (aside from extern "C"
declarations) might best be guarded by "#ifdef NDEBUG" so that users
like the original poster will not be fooled.
Nathan Myers
ncm-nospam@cantrip.org
More information about the Libstdc++
mailing list