C++ Logo

std-proposals

Advanced search

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

From: Tom Honermann <tom_at_[hidden]>
Date: Sun, 3 Mar 2024 13:04:22 -0500
Microsoft's C++ exception handling implementation is built on top of SEH
exceptions. When compiled in cl /EHa mode, a catch(...) handler will be
entered for SEH exceptions. In this case, there isn't really an
associated C++ type for the exception. See
https://learn.microsoft.com/en-us/cpp/cpp/exception-handling-differences?view=msvc-170.
This is obviously implementation-defined territory, but it might be
worth exploring some. I don't know what std::current_exception() returns
when called in these cases and it isn't convenient for me to check right
now. I'd be curious to learn what is done though.

Tom.

On 3/1/24 7:18 AM, Frederick Virchanza Gotham via Std-Proposals wrote:
> We should have access to the 'type_info' of any object that is thrown,
> even if it is caught inside a 'catch(...)' block. I first proposed
> this 14 months ago on this mailing list, and there were 22 replies in
> the original thread:
>
> https://lists.isocpp.org/std-proposals/2023/01/5400.php
>
> Most replies were in favour of having this new feature in C++26.
>
> I have written a paper in the format expected by the committee, with
> the headings:
> [ Introduction, Motivations, Impact on the standard, Impact on
> existing code, Design considerations, Proposed wording, References ]
>
> I intend for this paper to be allocated a Pxxxx number and for it to
> be put forward to the committee for a vote. My paper is attached to
> this email, and can also be accessed at:
>
> http://www.virjacode.com/papers/typeid_except.htm
>

Received on 2024-03-03 18:04:24