On Saturday, 25 November 2017 at 21:51:41 UTC, Dave Jones wrote:
What does the "inout" after front() do here...
@property ref inout(T) front() inout
{
assert(_data.refCountedStore.isInitialized);
return _data._payload[0];
}
Cant seem to find an explanation in the docs or forums :(
ht
On Sunday, 26 November 2017 at 04:51:08 UTC, Adam D. Ruppe wrote:
On Sunday, 26 November 2017 at 01:35:01 UTC, Dave Jones wrote:
So it makes it a const/immutable/mutable method depending on
whether the instance it is called on is
const/immutable/mutable?
On the outside, yes.
So
@prope
On Sunday, 26 November 2017 at 01:35:01 UTC, Dave Jones wrote:
So it makes it a const/immutable/mutable method depending on
whether the instance it is called on is const/immutable/mutable?
On the outside, yes.
So
@property ref inout(int) front() inout {
return i++;
}
Would
On Saturday, 25 November 2017 at 21:59:54 UTC, Ali Çehreli wrote:
On 11/25/2017 01:51 PM, Dave Jones wrote:
> What does the "inout" after front() do here...
>
>
> @property ref inout(T) front() inout
> {
> assert(_data.refCountedStore.isInitialized);
> return _data._payload[0];
> }
>
>
On Saturday, 25 November 2017 at 21:51:41 UTC, Dave Jones wrote:
What does the "inout" after front() do here...
Applies the `inout` modifier to the hidden `this` variable inside
the function.
https://dlang.org/spec/function.html#inout-functions
It basically makes it const inside the functio
On 11/25/2017 01:51 PM, Dave Jones wrote:
> What does the "inout" after front() do here...
>
>
> @property ref inout(T) front() inout
> {
> assert(_data.refCountedStore.isInitialized);
> return _data._payload[0];
> }
>
> Cant seem to find an explanation in the docs or forums :(
It's for
What does the "inout" after front() do here...
@property ref inout(T) front() inout
{
assert(_data.refCountedStore.isInitialized);
return _data._payload[0];
}
Cant seem to find an explanation in the docs or forums :(