tardy v0.0.1 - Runtime polymorphism without inheritance

jmh530 john.michael.hall at gmail.com
Tue Jun 16 15:50:07 UTC 2020


On Tuesday, 16 June 2020 at 13:31:49 UTC, Atila Neves wrote:
> [snip]

Pretty cool, thanks for the fixups.

It may make for a good documentation example, in that it may help 
make clear that you need to pass the module in somehow when 
dealing with non-member functions (AFAICT). You could include a 
comment about how it would be different if it were split into 
separate files.

I have a few more questions...

In your original example, is there any issue if we then make 
transform a templated non-member function that is generic over 
types like Adder (maybe there is an enum hasAddableMember that is 
true for Adder and false for Plus1)?

Am I right that the shared static constructor in vtable means 
that there is one vtable for all the instances?

Are there any technical issues preventing Polymorphism from 
accepting a class in addition to an interface?


More information about the Digitalmars-d-announce mailing list