linux dynamic library __gshared var

2024-01-07 Thread d007 via Digitalmars-d-learn
I just notice the __gshared is cross process shared. I want a var exits in one process, but shared for multi thread with atomic for __gshared library. how can I do this with d ?

Re: Generating custom toString for structs

2024-01-07 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 7 January 2024 at 09:49:36 UTC, Renato wrote: Is the above a "good" way to do this? It looks ok to me. There are some minor changes I would make, like using `typeof(this)` instead of `S` to refer to the type of the struct you're mixing it into, but the overall approach is fine.