C++ Logo


Advanced search

Re: [std-proposals] std-proposals] Use the exception system to check for bases at runtime

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Wed, 3 Apr 2024 00:55:57 +0100
On Tue, Apr 2, 2024 at 6:03 PM Phil Endecott wrote:
> Please see my thread from last year with subject "Get base class from std::any":
> https://lists.isocpp.org/std-proposals/2023/03/6082.php
> I agree that this would be a useful feature to have in the language.

Before I go any further with this, I have to see if it can be
implemented with the Microsoft compiler. Because if I can get it
working with Microsoft, then I'll have the top 4 compilers. I see that
Microsoft's implementation of 'exception_ptr' is just a pair of void*
pointers, but I don't know what they're supposed to point to (I tried
pointing one, and both, of them to the type_info, but it doesn't work
when I rethrow it).

>From the Visual Studio 2022 header files, I can see that Microsoft's
implementation of 'make_exception_ptr' calls a function
"__ExceptionPtrCopyException". I need to see what that function does
in order to figure out how to manipulate an 'exception_ptr'. I think
the implementation of '__ExceptionPtrCopyException' might be
proprietary though. Does anyone have the source code for it? If not
then I'll disassemble it and try figure out what the assembler's
doing. Hopefully it's less than 20 instructions just setting the
values of those two pointers.

Received on 2024-04-02 23:56:09