Re: this() const

2012-04-22 Thread sclytrack
ested code) struct B { int [] _list; this( const int [] list) const { _list = list; //typeof(_list)=int [] //typeof(list) =const(int[]) } } Because of the const on the back of the constructor. Normally the typeof(_list) should be const(int[]) but assignable once, because we are in the constr

Re: this() const

2012-04-16 Thread sclytrack
On 04/15/2012 11:04 PM, Simon wrote: On 15/04/2012 21:07, Trass3r wrote: Am 15.04.2012, 21:20 Uhr, schrieb sclytrack : this( const size_t step) const { this.step = step; } Error: cannot modify const/immutable/inout expression this.step Is this the expected behavior? Thanks. Yep. No

Re: this() const

2012-04-15 Thread Jonathan M Davis
On Sunday, April 15, 2012 21:20:23 sclytrack wrote: > this( const size_t step) const > { > this.step = step; > } > > > Error: cannot modify const/immutable/inout expression this.step > > > Is this the expected behavior? Thanks.

Re: this() const

2012-04-15 Thread Simon
On 15/04/2012 21:07, Trass3r wrote: Am 15.04.2012, 21:20 Uhr, schrieb sclytrack : this( const size_t step) const { this.step = step; } Error: cannot modify const/immutable/inout expression this.step Is this the expected behavior? Thanks. Yep. No it's not: import std.stdio; s

Re: this() const

2012-04-15 Thread Trass3r
Am 15.04.2012, 21:20 Uhr, schrieb sclytrack : this( const size_t step) const { this.step = step; } Error: cannot modify const/immutable/inout expression this.step Is this the expected behavior? Thanks. Yep.

this() const

2012-04-15 Thread sclytrack
this( const size_t step) const { this.step = step; } Error: cannot modify const/immutable/inout expression this.step Is this the expected behavior? Thanks.