The following code should really work: import core.atomic; void main() { uint num; atomicOp!"+="(num, 1U); // Works atomicOp!"+="(num, 1); // Doesn't work because 1 is an int, not a uint. }
This was apparently fixed at some point a while back, because it works in 2.054.