shared - no read/write access

Manu turkeyman at gmail.com
Tue Mar 19 21:36:51 UTC 2019


On Tue, Mar 19, 2019 at 1:20 PM Jacob Carlborg via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On 2019-03-19 21:08, Manu wrote:
> > Last time we talked about shared, I think we all agreed on one thing;
> > shared should hot have read/write access to data members.
>
> Not exactly sure of what you're looking for but write access is already
> disable [1].
>
> > Does anyone know how to implement this? I would really like to try
> > some important experiments with shared if it worked.
>
> If it's only the read access that is left to disable I recommend looking
> at how the write access is disable and try to do the same for read. I
> suggest to do a project wide search for the error message for write
> operations, seems pretty unique. Then go from there.
>
> [1] https://run.dlang.io/is/ZJ5maE
>
> --
> /Jacob Carlborg


Erm, change `++` to `= 10`.
Read/write from a shared thing should be a compile error in every circumstance.


More information about the Digitalmars-d mailing list