Date: Thu, 14 Nov 2024 11:42:14 +0000
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).
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).
Received on 2024-11-14 11:42:26