Date: Thu, 14 Nov 2024 14:19:43 +0100
Combine it with "virtual" multiple inheritance and all bets are off..
// Robin
On Thu, Nov 14, 2024, 14:16 Egor via Std-Proposals <
std-proposals_at_[hidden]> wrote:
> If I'm not mistaken, multiple inheritance can cause the vtable to be at
> a non-zero offset on all compilers (if the first base isn't polymorphic).
>
> 14.11.2024 16:42, Frederick Virchanza Gotham via Std-Proposals пишет:
> > The C++ programming language is held back by the Microsoft compiler's
> > implementation of VTables. Every other C++ compiler places the pointer
> > to the VTable right at the beginning of the object, but the Microsoft
> > compiler sometimes places it elsewhere. This has the following
> > consequences:
> >
> > (1) Cannot use dynamic_cast on a void*
> >
> > Assuming that we have a void* pointer that points to a polymorphic
> > object, we would be able to use dynamic_cast on it to perform a
> > side-cast or down-cast (or to get the most-derived object).
> >
> > (2) Cannot get the type_info from a void*
> >
> > Assuming that we have a void* pointer that points to a polymorphic
> > object, we would be able to get its type_info.
> >
> > I think the committee should consider giving Microsoft a certain
> > amount of time to change this. I realise that the Standard doesn't
> > mention 'Microsoft' in its text but the committee could make the
> > decision that in C++36, the above two points are possible (which would
> > mean that MS have to change their ABI by then).
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
// Robin
On Thu, Nov 14, 2024, 14:16 Egor via Std-Proposals <
std-proposals_at_[hidden]> wrote:
> If I'm not mistaken, multiple inheritance can cause the vtable to be at
> a non-zero offset on all compilers (if the first base isn't polymorphic).
>
> 14.11.2024 16:42, Frederick Virchanza Gotham via Std-Proposals пишет:
> > The C++ programming language is held back by the Microsoft compiler's
> > implementation of VTables. Every other C++ compiler places the pointer
> > to the VTable right at the beginning of the object, but the Microsoft
> > compiler sometimes places it elsewhere. This has the following
> > consequences:
> >
> > (1) Cannot use dynamic_cast on a void*
> >
> > Assuming that we have a void* pointer that points to a polymorphic
> > object, we would be able to use dynamic_cast on it to perform a
> > side-cast or down-cast (or to get the most-derived object).
> >
> > (2) Cannot get the type_info from a void*
> >
> > Assuming that we have a void* pointer that points to a polymorphic
> > object, we would be able to get its type_info.
> >
> > I think the committee should consider giving Microsoft a certain
> > amount of time to change this. I realise that the Standard doesn't
> > mention 'Microsoft' in its text but the committee could make the
> > decision that in C++36, the above two points are possible (which would
> > mean that MS have to change their ABI by then).
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
Received on 2024-11-14 13:19:55