On 2012-11-11 10:04, Jack Applegame wrote:
I'm trying creating template for intrusive double-linked list:

mixin template node() {
   static if(is(this == struct))
     alias typeof(this)* E;
   else
     alias typeof(this) E;
   E prev, next;
}
class A {
   mixin node L1;
   mixin node L2;
}

This won't work. The "node" template doesn't evaluate to a type and you wouldn't use it as a mixin if it did.

But compiler doesn't compile that whith error:
"this is not in a class or struct scope|"
in line with
"alias typeof(this) E;"




--
/Jacob Carlborg

Reply via email to