On 3/14/14, Jakob Ovrum <[email protected]> wrote:
> Back in 2012, invariants were misguidedly made const by default
> without going through any review whatsoever, breaking a ton of
> code in the process[1].
How about a compromise based on Andrei's new final(bool) suggestion?
We could implement const(false) to allow overriding the default
behavior of invariants. E.g.:
class C
{
invariant() // const-by-default, as usual
{
}
invariant() const(false) // new feature
{
}
}
That way existing code stays safe.