Robert Clipsham:
> Why is this?

It's not a hard question. This code compiles:

class Foo {
    const(Foo) myFoo() const {
        return this;
    }
}
void main() {
    auto f = new Foo;
}

It's just in a const function the "this" is const, so if you want to return it, 
then you have to use a "const Foo" type, because it's not a mutable Foo :-)

Bye,
bearophile

Reply via email to