Dynamic templated virtuals - I still often want them
Arafel
er.krali at gmail.com
Thu Jul 23 10:27:14 UTC 2020
On 23/7/20 12:18, Arafel wrote:
>
> And in fact, now that I think about it, it can't possibly work at
> compile time. Consider:
>
> ```
> Base b = uniform(0,2) ? new Base() : new Derived();
> ```
Forget it, I misunderstood the proposal, I'm feeling dumber and dumber
now :-/
So the function would be instantiated again for each implementing class.
It would be really cool and I like it, but I've got the feeling that
it's just working around the fact that there is no proper RT
introspection yet.
If you could do RT introspection the same way you can do it at compile
time (for instance access to the individual fields), this wouldn't be
needed.
More information about the Digitalmars-d
mailing list