DIP 1016--ref T accepts r-values--Formal Assessment

Paul Backus snarwin at gmail.com
Mon Feb 4 20:08:39 UTC 2019


On Monday, 4 February 2019 at 18:35:37 UTC, bitwise wrote:
> On Monday, 4 February 2019 at 18:32:56 UTC, Dominikus Dittes 
> Scherkl wrote:
>> I don't understand this.
>> What does "(return)?" mean? Is this valid D syntax? What do I 
>> miss?
>
> I meant for that to be interpreted like a Regular expression, 
> denoting conditional presence of the return statement. I'm not 
> sure what the proper notation would be to express such a thing.

It's actually fine to leave the `return` there 
unconditionally--you're allowed to return an expression of type 
`void` from a function.

Example: https://run.dlang.io/is/tnSGN4


More information about the Digitalmars-d-announce mailing list