Can we not use scope(..) in a mixin template?

struct bar {}
bar* c_make() { return new bar(); }
void c_free(bar* b) { b = null; }

mixin template Foo() {
  auto b = c_make;
  scope(exit) if(b) c_free(b);
}

void main() {
  mixin Foo;
}

I get Error: Declaration expected, not '('

-Byron



Reply via email to