Get VTable pointer as a constant

Johan Engelen via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Apr 7 13:43:04 PDT 2016


I am trying to get the vtable pointer as a constant (!).
I've found
   auto vptr = typeid(A).vtbl.ptr
gets me the pointer, but because TypeInfo is not immutable 
(another forum thread), this will read the pointer from memory 
instead of loading a direct value.

Does anybody know how to get the class's vtable pointer without 
doing a memory read?

Thanks!
   Johan


More information about the Digitalmars-d-learn mailing list