About Immutable struct members and arrays.

Jack Applegame via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jan 7 00:16:32 PST 2016


On Thursday, 7 January 2016 at 00:19:12 UTC, anonymous wrote:
> On 06.01.2016 23:04, Jack Applegame wrote:
>
>>      move(bar, arr[0]);       // ok
>
> I consider it a bug that this compiles. You're overwriting 
> immutable data, which shouldn't be possible (without casting). 
> https://issues.dlang.org/show_bug.cgi?id=15315
>
I think it isn't a bug. I'm not overwriting immutable data, I'm 
replacing old data with a new constructed one. I want to destruct 
old data and fill uninitialized raw memory with a new constructed 
one.


More information about the Digitalmars-d-learn mailing list