[dmd-beta] std.format scheduled changes

Andrej Mitrovic andrej.mitrovich at gmail.com
Wed Aug 1 15:59:22 PDT 2012


On 8/2/12, Andrej Mitrovic <andrej.mitrovich at gmail.com> wrote:
> Make it 'auto' and it might just work. :p

struct box
{
    T opCast(T : bool)()
    {
        static T state;
        state = !state;
        return state;
    }

    static auto open()
    {
        return typeof(this)();
    }
}

void main()
{
    auto alive = box.open();
    assert(alive && !alive);
}


More information about the dmd-beta mailing list