A question about purity

Kagamin spam at here.lot
Tue Sep 13 06:01:06 PDT 2011


bearophile Wrote:

> So, let's change the situation a bit. If the struct Foo is the only thing present in a module (to avoid someone to touch its private members), and the y field is "private static" only foo2 is able to touch it. In this case isn't foo2 weakly pure?

Weakly pure function causes side effect with a lifetime limited to enclosing pure function, changing static data causes side effect which escapes enclosing pure function.


More information about the Digitalmars-d-learn mailing list