pure-ifying my code
David Nadlinger
code at klickverbot.at
Sun Nov 17 02:53:57 PST 2013
On Sunday, 17 November 2013 at 10:33:12 UTC, Philippe Sigaud
wrote:
> But `popFront()` changes an internal state with visible,
> external
> effects: it changes `front` return value and in the end, it will
> affect `empty` return value.
> So no, I don't consider `popFront` to be pure.
That's actually not a reason for them to be impure (see e.g.
http://klickverbot.at/blog/2012/05/purity-in-d#pure_member_functions
for my attempt on explaining that).
David
More information about the Digitalmars-d-learn
mailing list