Appender cannot add struct with immutable members

Marco Leise Marco.Leise at gmx.de
Mon Mar 4 10:07:13 PST 2013


Am Mon, 04 Mar 2013 14:14:42 +0100
schrieb "Namespace" <rswhite4 at googlemail.com>:

> Is this intended behavior or just a bug / missing feature?
> http://dpaste.1azy.net/21f100d3
> 
> I ask because it would be very easy to solve, with memcpy / 
> memmove.
> http://dpaste.1azy.net/ac2b38e5 (line 192)

There are several issues with immutable/const fields in
structs. It seems this idea wasn't explored enough in the
early designs of immutable. Often you need to express that the
left-hand side of an assignment is 'fresh' and it doesn't
harm immutability if it is assigned to.

-- 
Marco



More information about the Digitalmars-d-learn mailing list