shared - i need it to be useful

Walter Bright newshound2 at digitalmars.com
Sun Oct 21 09:58:18 UTC 2018


On 10/20/2018 11:08 AM, Nicholas Wilson wrote:
> You can if no-one else writes to it, which is the whole point of Manu's 
> proposal. Perhaps it should be const shared instead of shared but still.

There is no purpose whatsoever to data that can be neither read nor written. 
Shared data is only useful if, at some point, it is read/written, presumably by 
casting it to unshared in @trusted code. As soon as that is done, you've got a 
data race with the other existing unshared aliases.



More information about the Digitalmars-d mailing list