I just got it! (invariant/const)
guslay
guslay at gmail.com
Wed Apr 9 11:02:55 PDT 2008
Steven Schveighoffer Wrote:
> AFAIK, C.getX() is equivalent to int getX(C this).
>
> i.e. you can't change the this pointer to point to something else during the
> function.
>
> I don't see why it's not pure. I'm questioning the assertion that pure
> functions MUST take invariant reference types. They can take mutable ones
> as long as they do not reference mutable data within the type. It's the
> same reason you will be able to pass strings to a pure function. A string
> is mutable, but the data it points to is not.
>
> -Steve
>
I can't think of a counter-example, you might be correct.
More information about the Digitalmars-d
mailing list