[dmd-beta] std.format scheduled changes

Bernard Helyer b.helyer at gmail.com
Wed Aug 1 16:08:13 PDT 2012


I think we need a range interface if people want to open
multiple boxes at once.

On Thu, 2 Aug 2012, Andrej Mitrovic wrote:

> 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);
> }
> _______________________________________________
> dmd-beta mailing list
> dmd-beta at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>


More information about the dmd-beta mailing list