To help LDC/GDC

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Apr 9 05:54:45 PDT 2013


On 4/9/13 3:56 AM, Manu wrote:
> Are you saying the example above is not actually valid code?
>
> struct Foo {
>      int a = 0;
>      pure int bar( int n ) { // Weakly pure
>          a += n;
>          return a;
>      }
> }
>
> That's not pure. Call it twice with the same args, you'll different
> answers.

The values reachable from "this" are different in the two calls.

Andrei


More information about the Digitalmars-d mailing list