blob: ba55e54280de1e09230f217f66548faea2331525 [file] [log] [blame]
// REQUIRED_ARGS:
shared struct S
{
int x = 0;
int opUnary(string s)() if (s == "++")
{
import core.atomic : atomicOp;
return atomicOp!"+="(x, 1);
}
}
shared class C
{
int x = 0;
int opUnary(string s)() if (s == "++")
{
import core.atomic : atomicOp;
return atomicOp!"+="(x, 1);
}
}
void main()
{
S s;
s++;
shared(C) c = new C();
c++;
}