On 21/03/10 00:18, bearophile wrote:
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

Now you say it, that does seem obvious, thank you :)

Reply via email to