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

aliak something at something.com
Wed Jul 24 07:18:12 UTC 2019


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)?


More information about the Digitalmars-d mailing list