How to "dispose of" a string when using @live analysis?

Renato Athaydes renato at athaydes.com
Sat Aug 30 13:41:18 UTC 2025


On Friday, 29 August 2025 at 19:28:05 UTC, Kagamin wrote:
> Docs suggest `scope`
> ```
> scope s = "foo bar";
> ```

Ah, `scope` is not inferred with `auto`, and if a variable is not 
`scope`, then it must be disposed of somehow when using `@live`!?

That bit of information was not clear to me from the docs.

Thanks Dukc for the `leak` hint, even if I don't use that (as you 
said, I don't need that for GC-allocated memory or "static" 
literals) it's illuminating to understand how that can be done.


More information about the Digitalmars-d-learn mailing list