Improve the ergonomics of core.atomic

Denis Feklushkin feklushkin.denis at gmail.com
Fri Oct 2 02:10:17 UTC 2020


On Thursday, 1 October 2020 at 13:27:46 UTC, IGotD- wrote:

(Probably)

> atomicOp!"+="(v1, v2);

This is atomic CPU instruction call.

>
> This is nice for casual atomic operations but ugly and a pain 
> for many atomic operations.
>
> Why hasn't D just like C++ an atomic type. In C++ you simply 
> declare.
>
> std::atomic<int> var;

(Probably) this template isn't provides ability to use var by 
non-atomic instructions.



More information about the Digitalmars-d mailing list