class A { int value = 12; void updateValue() { value = 13; } }class B { const A a; this() { a = new A();a.updateValue(); // error: mutable method is not callable using const object} }
Hello, is there way to declare read only field for class type
with ability to call inner non constant methods? i.e.:
- Readonly field for class type Andrey via Digitalmars-d-learn
- Re: Readonly field for class t... Simen Kjærås via Digitalmars-d-learn
- Re: Readonly field for class t... Mike Parker via Digitalmars-d-learn
- Re: Readonly field for cla... Mike Parker via Digitalmars-d-learn
- Re: Readonly field for... Seb via Digitalmars-d-learn
- Re: Readonly field... Seb via Digitalmars-d-learn
- Re: Readonly field... Seb via Digitalmars-d-learn
- Re: Readonly field for class t... Ali Çehreli via Digitalmars-d-learn