const attribute makes whole element const?

Namespace rswhite4 at googlemail.com
Sun Sep 9 08:09:23 PDT 2012


On Saturday, 8 September 2012 at 23:18:14 UTC, Timon Gehr wrote:
> On 09/09/2012 01:16 AM, Namespace wrote:
>> Why fail this code?
>> without "const" on "Name" it works fine.
>>
>> http://dpaste.dzfl.pl/9fa0986a
>
> const fields cannot be written to. This includes the case when 
> the
> entire struct is written to at once.

But i assign the const attribute in the ctor. So this behaviour 
doesn't make any sense...


More information about the Digitalmars-d-learn mailing list