struct S {
int i;
void fun() {
// Works fine
outside!(() => i);
// staticInside cannot access frame of function S.fun
staticInside!(() => i);
}
static void staticInside(alias fn)() {
fn();
}
}
void outside(alias fn)() {
fn();
}
Since static member functions should be equivalent to free functions, the above clearly should compile, but as indicated by comments, it does not.
Comment #1 by robert.schadek — 2024-12-13T19:09:12Z