And your void* may not point to something using a VTable at all... No, the standard will not enable this as "void *" is the old, unsafe, "C-way" of doing dynamic polymorphisms. Today, you either use runtime type-erasure (like inheritance with virtual functions or std:: variant) or templates for compile time polymorphisms. I don't understand why you would even _have_ a void* to something with a VTable, especially under circumstances where you _know_ that whatever void* is has a VTable...
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@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals