▲ | humanrebar 3 days ago | |||||||
You can implement that in C++ code, no language extensions required, by using type erasure and a pointer semantic type with at least one constructor templated on the type of the object being pointed to. | ||||||||
▲ | kazinator 3 days ago | parent [-] | |||||||
A signature pointer type knows nothing about the types it is legally pointing to; moreover, those types know nothing about the signature.
(Not sure if these member functions need to be virtual? I would have to dig up the Signatures docs.)This feature was removed because the implementation was becoming hard to maintain, or some reason like that. You can see it's pretty crazy from a C++ point of view, because c->recv(...) can be called through this pointer and it has to work for absolutely any object whose class conforms to the signature. And classes don't know they are conforming to any signature; nothing is declared in them for that. C++ polymorphism normally depends on declaration relationships through which implementation details like vtable positions can be inferred. | ||||||||
|