On Thursday, 26 May 2016 at 14:12:23 UTC, chmike wrote:
I couldn't find any information about this on the dlang web site.

What is the effect adding the immutable attribute to a class like this

immutable class MyClass { ... }

The compiler doesn't complain.
Will it add the immutable attribute to all members ?

auto mc = new MyClass;

typeof(mc.someFieldOrFun).stringof.writeln; says yes

and if you define opCall you need to use
auto mc = new immutable MyClass;

Reply via email to