D Lang'99 & Its future

bauss jj_1337 at live.dk
Wed Feb 9 10:21:33 UTC 2022


On Wednesday, 9 February 2022 at 08:38:00 UTC, Martin 
Tschierschke wrote:
> On Tuesday, 8 February 2022 at 18:28:21 UTC, H. S. Teoh wrote:
>
>>
>> In latest dmd git HEAD, you need to annotate this function 
>> with `return`, because it escapes a reference to `this`. :-)
>>
> Sorry, I am to stupid, where do you have to "annotate return"?

I believe it would be like this:

```d
ref string toString() return
{
   return bits;
}
```

Someone can correct me if I'm wrong, but I believe this is what 
he's referring to in the spec:

https://dlang.org/spec/function.html#return-ref-parameters


More information about the Digitalmars-d mailing list