On Wed, 30 Mar 2011 14:07:51 +0200, Magnus Lie Hetland <[email protected]> wrote:

A while ago, I wrote something like this:

void C(alias foo)() {
    void bar() {
        foo();
    }
    bar();
}

void B(T)(uint x=2) {
    uint foo() {
        return x;
    }
    C!foo();
}

Also, aside from the erratic DMD behavior, I'm guessing my code might be invalid, and shouldn't have worked in the first place. After all, x is a run-time argument, and is part of foo, which functions as a compile-time argument. I mean, the set-up *could* work (and, in fact, generally seems to do so), but it might be a bit problematic?

Don't worry, that's supposed to work.



--
Simen

Reply via email to