The following code should compile:
mixin("ref int") f() { static int x; return x; }
This would allow sidestepping the thorny issue of returning a value or a reference depending on a compile-time condition. Same goes about parameters, e.g. this should work too:
void f(mixin("ref int") x) { }
Comment #1 by 2korden — 2009-01-28T03:04:09Z
Do you mean that the following should be allowed, too?
class Foo
{
void bar() mixin("const")
{
}
}
Comment #2 by robert.schadek — 2024-12-13T17:49:22Z