Allocate a string via the GC

Adam D Ruppe destructionator at gmail.com
Mon May 23 12:25:36 UTC 2022


On Monday, 23 May 2022 at 12:20:11 UTC, JG wrote:
> I am writing an interpreter and I needed access to a string via
> a pointer of type void*
>
> I ended up wrapping it in a struct since I needed another value
> anyway. Seems odd that one can't do it in a less unusual way.

OK yeah, that's the main use case I'd think of, and that's also 
exactly why I think doing the struct is the best thing anyway 
since you can bundle whatever you need in there instead of just a 
single value.


More information about the Digitalmars-d-learn mailing list