Adding a new design constraint to D
Max Samukha
maxsamukha at gmail.com
Sat Jun 18 18:02:08 UTC 2022
On Saturday, 18 June 2022 at 08:04:55 UTC, FeepingCreature wrote:
> a function in a module is "on the same level" as a method in
> the class.
If it is on the same level, then I would expect 'foo' below to
lock the mutex and run the invariant check:
```d
synchronized class C
{
private int x;
private int y = 1;
invariant() { assert(y == x + 1); }
}
void foo(C c, int x)
{
c.x = x;
c.y = x + 1;
}
```
More information about the Digitalmars-d
mailing list