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

Timon Gehr timon.gehr at gmx.ch
Wed Jul 24 13:40:10 UTC 2019


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.


More information about the Digitalmars-d mailing list