Re: this() const

2012-04-22 Thread sclytrack
On 04/16/2012 09:27 PM, sclytrack wrote: On 04/16/2012 08:15 PM, sclytrack wrote: const numbers = new int[2]; const c = const(AB)(a, 20, numbers); writeln(c); } Bye, bearophile That's exactly what I needed, thanks. Seems to be forwarded to the constructor if there is one. (untested code

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 it

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. const and immutable postblit const

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; struct foo

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.