On 2010-02-14 16:31:29 -0500, Walter Bright <[email protected]> said:

Right now, mixins are defined and used as:

    template foo(T) { declarations... }

    mixin foo!(int) handle;

The proposal is to switch it around:

    mixin template foo(T) { declarations... }

    foo!(int) handle;

to follow the notion that mixin templates are very different from regular templates, and that should be reflected in their definition rather than use.

What do you think?

Me likes it. :-)

To me it was confusing at first that templates could be used both way. I've rarely seen a template that is meant to be and not to be mixed-in at the same time, so this will make things clearer (and also enforce) how a particular template is meant to be used. And I won't say no to reducing the clutter at the usage point.

I only hope you can still use it without the 'handle' part. :-)


--
Michel Fortin
[email protected]
http://michelf.com/

Reply via email to