Re: is ref inout redundant in: ref inout(T) opIndex(size_t index)

2023-06-21 Thread Nick Treleaven via Digitalmars-d-learn
On Monday, 19 June 2023 at 18:19:18 UTC, mw wrote: 2) `inout T` alone Steve covered everything, though you might also like to read the inout spec: https://dlang.org/spec/const3.html#inout

Re: is ref inout redundant in: ref inout(T) opIndex(size_t index)

2023-06-19 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/19/23 2:19 PM, mw wrote: Hi, I just saw this line: https://github.com/dlang/dmd/blob/master/druntime/src/core/stdcpp/vector.d#LL66C5-L66C39 ``` 66:    ref inout(T) opIndex(size_t index) inout pure nothrow @safe @nogc   { return as_array[index]; } ``` I'm wondering if the `ref` and

is ref inout redundant in: ref inout(T) opIndex(size_t index)

2023-06-19 Thread mw via Digitalmars-d-learn
Hi, I just saw this line: https://github.com/dlang/dmd/blob/master/druntime/src/core/stdcpp/vector.d#LL66C5-L66C39 ``` 66:ref inout(T) opIndex(size_t index) inout pure nothrow @safe @nogc { return as_array[index]; } ``` I'm wondering if the `ref` and `inout` redundant here? They