I just got it! (invariant/const)

Jason House jason.james.house at gmail.com
Wed Apr 9 09:02:16 PDT 2008


Jason House Wrote:

> 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:
[Corrected example - Thanks george]

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



More information about the Digitalmars-d mailing list