On 04/08/2013 08:14 PM, Simen Kjaeraas wrote:
> Like others have stated, it's so you can do this:
>
> struct Foo {
> int a = 0;
> pure int bar( int n ) { // Weakly pure
> a += n;
> return a;
> }
> }
>
> pure int Baz( int n ) { // Strongly pure
> Foo foo;
> return foo.bar( n );
> }... one clear application of this being pseudo-random number generation, where you have a state variable together with a (pure) update function.
