D-ark corners - algorithms, ranges, and auto ref - best practices guides.

Aliak something at something.com
Wed Jul 24 17:58:10 UTC 2019


On Wednesday, 24 July 2019 at 13:40:10 UTC, Timon Gehr wrote:
> On 24.07.19 09:18, aliak wrote:
>> On Tuesday, 23 July 2019 at 15:40:42 UTC, Timon Gehr wrote:
>>> On 23.07.19 15:51, aliak wrote:
>>>>
>>>> (Side note: the specification for return ref - 
>>>> https://dlang.org/spec/function.html#return-ref-parameters - 
>>>> says that "inout ref parameters imply the return 
>>>> attribute.", but I got corruption with "ref inout(T) front() 
>>>> inout {...}". Is that a bug with inout?)
>>>
>>> I think in this case the specification is at fault. It's 
>>> perfectly fine (and useful) to have an `inout` function that 
>>> returns `void`.
>> 
>> Void would not be a ref so return would not be inferred 
>> (according to the spec)?
>
> No? The spec says that inout ref parameters imply the return 
> attribute.

Ah right! Parameters.


More information about the Digitalmars-d mailing list