Re: inout functions

2012-08-24 Thread Kagamin
Well, it may be also a way to ensure the function doesn't modify the struct.

Re: inout functions

2012-08-23 Thread Piotr Szturmaj
Timon Gehr wrote: On 08/24/2012 12:14 AM, Piotr Szturmaj wrote: Hi, I found this code of std.range.iota's Result struct: @property inout(Value) front() inout { assert(!empty); return current; } What's the purpose of inout on parameterless functions? It is a method of a struct, ther

Re: inout functions

2012-08-23 Thread Timon Gehr
On 08/24/2012 12:14 AM, Piotr Szturmaj wrote: Hi, I found this code of std.range.iota's Result struct: @property inout(Value) front() inout { assert(!empty); return current; } What's the purpose of inout on parameterless functions? It is a method of a struct, therefore it is not par