VisualD: Error disabling access to shared memory objects
Imperatorn
johan_forsberg_86 at hotmail.com
Tue Sep 29 22:16:55 UTC 2020
On Monday, 28 September 2020 at 22:10:58 UTC, Nuno Leiria wrote:
> If I enable "disable access to shared memory objects (DMD
> 2.088+)" then this simple example doesn't compile:
>
> void main()
> {
> string line;
> while ((line = stdin.readln()) !is null)
> write(line);
> }
>
> It fails with the error:
>
> C:\D\dmd-2.094.0\windows\bin\..\..\src\phobos\std\stdio.d-mixin-4874(4874): Error: direct access to shared `stdin` is not allowed, see `core.atomic`
>
> Can anyone explain why?
Well, stdin is shared. And you have said you don't want to allow
it.
More information about the Digitalmars-d-ide
mailing list