Dynamic templated virtuals - I still often want them
Arafel
er.krali at gmail.com
Thu Jul 23 08:51:15 UTC 2020
On 23/7/20 10:46, Arafel wrote:
>
> ```
>
> TypeInfo_Class[string] rtIntrospection;
>
> class Base {
> shared static this (this This) {
> rtIntrospection[This.stringof] = This.classinfo;
> }
> }
>
> class Derived : Base { } // The entry is added automatically
> ```
Sorry, there's a missing set of parentheses there, it should of course be:
```
TypeInfo_Class[string] rtIntrospection;
class Base {
shared static this (this This)() {
rtIntrospection[This.stringof] = This.classinfo;
}
}
class Derived : Base { } // The entry is added automatically
```
More information about the Digitalmars-d
mailing list