non-const reference to const instance of class

Zhenya zheny at list.ru
Wed Oct 10 10:02:31 PDT 2012


Hi!

I thought that this should compile:
class Foo{}

const(Foo) foo = new Foo;// the same that const Foo foo?
foo = new Foo;

but compiler say that foo is const reference and it can't modify 
it.
It is normally?If yes,how can I declare non-const reference to 
const instance of class?


More information about the Digitalmars-d-learn mailing list