Does D have too many features?

Jacob Carlborg doob at me.com
Mon Apr 30 04:00:00 PDT 2012


On 2012-04-30 12:29, Manu wrote:
> On 30 April 2012 10:39, Jacob Carlborg <doob at me.com
>     That's the only thing I used the with-statement for.
>
>
> That's the only thing I was aware it did ;) .. are there other uses?

You can use it to access members without a receiver as well:

class Foo
{
     int x;
     int y;
}

auto foo = new Foo;

with (foo)
{
     x = 3;
     y = 4;
}

http://dlang.org/statement.html#WithStatement

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list