|
|
|
|
|
by smelterdemon
3171 days ago
|
|
>the "vtable" (the dictionary of functions) being passed around isn't virtual and is provided per type, not per instance. This might be nitpicking but vtables in C++ are created per type with instances having a pointer to it. |
|
Although the language does not offer a builtin syntax for it, in C++ is also common to attach the 'vtable' to the 'handle' (a smart pointer or deep copying envelope), in the case of type erased wrappers (std::function, std::any, etc).