It's worse than I thought
Sönke Ludwig
ludwig at informatik_dot_uni-luebeck.de
Mon Dec 3 08:49:25 PST 2007
Sönke Ludwig schrieb:
> PS: on a side note, I found that invariantness is lost in a few
> situations, when a const modifier is applied. Unfortunately I don't have
> an example at hand, will post one if I'm hitting it again.
Okay one example is this:
invariant class C {}
class D {
C c;
const C getC(){ return c; } // error
}
gives:
Error: cannot implicitly convert expression (this.c) of type const(C) to
invariant(C)
More information about the Digitalmars-d
mailing list