Hello,

ich habe a pure method bar() in a class Foo:

class Foo {
        int i = 0;
        
        void bar() pure {
            i++;
        }       
}

main() {
        auto foo = new Foo();
        foo.bar()       
}

The pure method bar changes the inst var i. Nevertheless, the
code above compiles and runs which I find confusing. I assumed
that changing an inst var by a pure function is considered
creating a side efect. But the compiler has no problems with this.

Am I getting something wrong here? Thanks for any hints.
Regards, Bienlein

Reply via email to