immutable method not callable using argument types () - doesn't make sense

2012-03-27 Thread Daniel Donnelly
I have: [code] module A; module A; interface B { public: immutable B dup(); } class A : B { public: this() {} this(in char[] field) { this.field = field.dup; }

immutable method not callable using argument types () - doesn't make sense

2012-03-27 Thread Daniel Donnelly
I have: [code] module A; interface B { public: immutable B dup(); } class A : B { public: this() {} this(in char[] field) { this.field = field.dup; } immutable A dup()

Re: immutable method not callable using argument types () - doesn't make sense

2012-03-27 Thread Daniel Donnelly
The two solutions are: inout(A) dup() inout { ... } A dup() const { ... } I'm using the latter. Basically all I need is to copy any object: const, immut-, or mutable.