C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::typeid_except ( Paper Attached )

From: Arthur O'Dwyer <arthur.j.odwyer_at_[hidden]>
Date: Fri, 1 Mar 2024 11:41:31 -0500
On Fri, Mar 1, 2024 at 7:18 AM Frederick Virchanza Gotham via Std-Proposals
<std-proposals_at_[hidden]> wrote:

> We should have access to the 'type_info' of any object that is thrown,
> even if it is caught inside a 'catch(...)' block. [...]
> http://www.virjacode.com/papers/typeid_except.htm


- Remove the default argument.
- Pass the exception_ptr by const&, for efficiency: we are only reading
it, not "sinking" it. (Compare P2927
<https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2927r1.html>.)
- What is the motivation for this facility? It doesn't seem useful to get a
typeid, because you can't do anything with a typeid. You can't even compare
the typeid to anything to learn e.g. whether the exception IS-A
std::exception. This doesn't seem useful at all, without further major
additions to std::type_info. If you think it *is* useful somehow, you
should put that in the paper; and if you *don't* think it's useful, then
you shouldn't waste our (or anyone's) time with it.

–Arthur

Received on 2024-03-01 16:41:44