Inner function overload bug?

Andrej Mitrovic andrej.mitrovich at gmail.com
Tue Jan 8 16:53:07 PST 2013


On 1/9/13, bearophile <bearophileHUGS at lycos.com> wrote:
> If you define an inner static struct, its static methods can call
> each other freely.

You can also use a mixin template:

mixin template S()
{
    void test(ref int x) { x = test(); }
    int test() { return 1; }
}

void main()
{
    mixin S;

    int x;
    test(x);
    assert(x == 1);
}


More information about the Digitalmars-d-learn mailing list