"Andrej Mitrovic" wrote in message news:[email protected]...

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.

Yuck. We can always warn for a while on invariants not explicitly marked as const, if we're worried about breakage.

You should be able to use most of the language without using const, making invariants implicitly const was a bad idea.

Reply via email to