On Sunday, 8 August 2021 at 11:36:51 UTC, FeepingCreature wrote:
You can make a field set function like so:
```
struct S
{
private int x_;
int x(int value) { return this.x_ = value; }
int x() { return this.x_; }
}
```
This will then run invariants.
(boilerplate can automate that for
On Sunday, 8 August 2021 at 11:30:41 UTC, james.p.leblanc wrote:
Hello,
With structs, I understand that "invariant checking" is called
(from dlang tour):
It's called after the constructor has run and before the
destructor is called.
It's called before entering a member function
Hello,
With structs, I understand that "invariant checking" is called
(from dlang tour):
It's called after the constructor has run and before the
destructor is called.
It's called before entering a member function
invariant() is called after exiting a member function.
But, is