C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Allow conversion of memfunc pointers to func pointers

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Wed, 24 Jan 2024 12:33:15 +0000
On Tue, Jan 23, 2024 at 9:05 PM Thiago Macieira wrote:

>
> void const *get_polymorphic_facilitator(type_info const &ti)
> {
> auto ti2 = dynamic_cast<abi::__vmi_class_type_info2 *>(&ti);
> return t2 ? t2->vtable : nullptr;
> }
>
> Second, even that is not necessary, because __vmi_class_type_info has a
> flags
> field, so the ABI could dedicate another bit to indicating whether this
> one has
> the extra field at the end.
>


This is a good idea . . . and I was almost about to ditch my idea of
editing the source code for the GNU linker in favour of your idea, but your
solution has one drawback:

    - - - Objective files and static archives need to be recompiled - - -

If I only edit the linker, then big projects only need to be re-linked. No
need to recompile all the object files, nor the static libraries.

Here's where I am so far on editing the GNU linker:


https://github.com/bminor/binutils-gdb/compare/f11786a1951932217d348f3739e8deb31975a355...healytpk:linker-vtable:master

(The code for managing the list of symbol strings is thrown together and
probably contains a bug for some corner cases, I'll fix/replace it before
finalising)

Received on 2024-01-24 12:33:29