== Quote from div0 (d...@users.sourceforge.net)'s article
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> strtr wrote:
> > Or more to the point:
> >
> > Can (Class) template mixin functions be devirtualized by the compiler or do 
> > I (as
> > optimization) need to manually copy paste the boiler plate code?
> You can just wrap the mixin in a final block:
> import std.stdio;
> template bar(T) {
>       void test(T t) {
>               writefln("t: %s", t);
>       }
> }
> class foo {
>       final {
>               mixin bar!(int);
>       }
> }
> int main(){
>       scope f = new foo;
>       f.test(3);
>       return 0;
> }

Is that different from making all functions within the template final?

Reply via email to