On 8/2/12, Andrej Mitrovic <[email protected]> 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);
}
_______________________________________________
dmd-beta mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-beta

Reply via email to