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
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
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.
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
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 size_t step) const
{
this.step = step;
}
Error: cannot modify const/immutable/inout expression this.step
Is this the expected behavior? Thanks.