How to cast `shared` away reliably

Kagamin spam at here.lot
Thu Feb 12 14:41:09 UTC 2026


unqualified -> qualified conversion is lossy, so you can't revert 
it. When human writes concurrent code unshared type is implicitly 
known not from shared type, but from business logic being 
implemented. So you should parameterize your code by unshared 
type T, then `shared(T)` is shared storage, then you cast 
`shared(T)` to `T` to remove `shared`.


More information about the Digitalmars-d mailing list