On Wed, 12 Nov 2008 11:37:33 +0100, Christian Hartung <[EMAIL PROTECTED]> wrote:

Currently the right way to do this is:

template foo(T)
{
     int opApply(int delegate(ref T) dg)
     {
         // code
     }
}

class bar(T)
{
     mixin foo!(T);
}

void main()
{
     auto b = new bar!(int);
     foreach(qux; b)
     {
     }
}


Ah, but that does not give me the named mixin.

Consider

class Tree(T)
{
        mixin Traverse!(Stack) depthfirst;
        mixin Traverse!(Queue) breadthfirst;
}

--
Simen

Reply via email to