Sujet : Re: We have a new standard!
De : Muttley (at) *nospam* DastardlyHQ.org
Groupes : comp.lang.c++Date : 03. Jan 2025, 17:09:39
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vl9243$3vkvl$1@dont-email.me>
References : 1 2 3 4 5 6 7
On Fri, 03 Jan 2025 10:50:51 -0500
Sam <
sam@email-scan.com> wibbled:
Paavo Helde writes:
Here's a free clue. Define "function X throws exception Y" if it throws that
exception (and it doesn't catch it itself), or if it calls function Z that's
declared (in Z's throw specifier) as throwing that exception. The compiler
has all the information needed to know which exception can be thrown out of
that function.
>
This is not C. This is C++. The compiler has the signature of every function
called by code.
It needs more than that when function pointers are involved. It cannot
necessarily know at compile time which function will be assigned to the
pointer so how is it supposed to know if the exception sig is valid? Unless
you're suggesting also have an exception sig for function pointers which would
probably break a whole load of code and make life difficult for zero gain.