On Apr 15, 2012 4:30 AM, "Joseph Rushton Wakeling" <
joseph.wakel...@webdrake.net> wrote:
> ... the compiler accepts it.  Whether that's because it's acceptably
pure, or because the compiler just doesn't detect this case of impurity, is
another matter.  The int k is certainly mutable from outside the scope of
the function, so AFAICS it _should_ be disallowed.

As far as I understand pure includes the "hidden this parameter"  so it is
pure if when you call it on the same structure with the same arguments you
always get the same results.  Although that seams pretty useless in the
optimization standpoint because the function can modify it's own object
between calls.

Reply via email to