D1.5 anyone?
Walter Bright
newshound2 at digitalmars.com
Wed Apr 12 05:10:36 UTC 2023
Consider the following:
shared int* p;
With transitive shared, that makes p and *p both shared. If I'm understanding
your post, you propose changing things so p is shared and *p is not shared.
The issue with that is *p loses what thread it belongs to, and will then (to be
thread safe) have to be synchronized.
I agree it is likely easier to write programs this way, but I suspect it will be
a lot harder to write correct programs, and the compiler will be unable to help
with that.
I have thought about head const (aka final) many times, but didn't come to any
conclusions.
More information about the Digitalmars-d
mailing list