Idea to verify virtual/final methods

bearophile bearophileHUGS at lycos.com
Tue Jun 4 03:45:07 PDT 2013


Jacob Carlborg:

> struct virtual {} // the UDA
>
> class Foo
> {
>     void a () {} // static assert, not declared as @virtual
>     @virtual void b () {} // ok
>     @virtual final void c () {} // static assert, declared as 
> final and @virtual
>     final d () {} // ok
> }
>
> checkVirtual!(Foo);

Is it possible to also write:

checkVirtual!myModuleName;

And verify all the classes in a module?

Bye,
bearophile


More information about the Digitalmars-d mailing list