I just got it! (invariant/const)

Jason House jason.james.house at gmail.com
Wed Apr 9 06:14:20 PDT 2008


Janice Caron Wrote:

> On 09/04/2008, Jason House <jason.james.house at gmail.com> wrote:
> > The strange thing is that pure functions can't call invariant member functions of their invariant data.
> 
> I don't think that's correct.
> 
> [example showing misinterpretation of what I'm talking about]

Consider this example:

class D{
  void invMemberFunc() invariant; // not pure
}

class C{
  int f(invariant D) invariant pure{
    D.invMemberFunc(); // illegal
  }
}




More information about the Digitalmars-d mailing list