bug in purity validation

Timon Gehr timon.gehr at gmx.ch
Sun Jun 5 03:10:00 PDT 2011


Timon Gehr wrote:
> From bearophile's ported benchmark:
>
>     // Getters/Setters
>     pure nothrow SimpleLoop* parent() { return parent_; }
>     //...
>     pure nothrow void setParent(SimpleLoop* parent) {
>         parent_ = parent;
>         parent.addChildLoop(&this);
>     }
>     //...
>     SimpleLoop* parent_;
>
> Why does that compile? There is no way those functions can be pure.
>
> Timon

Ah, the implicit "this" parameter...

Timon


More information about the Digitalmars-d mailing list