On Sunday, 21 October 2018 at 18:45:15 UTC, Walter Bright wrote:
I'd like to add that if the compiler can prove that a T* points to a unique T, then it can be implicitly cast to shared(T)*. And it does so, like the result of .dup can be so converted.

This can be achieved by using the unique struct and enforce the uniqueness at compile time.

https://github.com/dlang/phobos/blob/master/std/typecons.d#L130

Reply via email to