const-typed class does not have const members

2011-01-21 Thread Sean Eskapp
The following code yields results as commented. import std.stdio; class A { int b; } void main() { const A a = new A; writeln(typeof(a).stringof); // const(A) writeln(typeof(a.b).stringof); // const(int) writeln((const A).stringof); // const(A)

Re: const-typed class does not have const members

2011-01-21 Thread Ali Çehreli
Sean Eskapp wrote: The following code yields results as commented. import std.stdio; class A { int b; } void main() { const A a = new A; writeln(typeof(a).stringof); // const(A) writeln(typeof(a.b).stringof); // const(int) writeln((const A).stringof); // const(A)