Keeping a mutable reference to a struct with immutable members
pineapple via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun May 29 11:52:36 PDT 2016
I found another post on this subject and the advice there was
"don't put const members in your structs" -
http://forum.dlang.org/thread/m87ln2$idv$1@digitalmars.com
This doesn't work out so well when the templated struct is
referring to what happens to be a const array.
I thought I could get it done with pointers, but then I realized
my data was going out-of-scope. I tried using `Unqual!T
thing_i_need_to_reassign_sometimes` where T was immutable but
that didn't solve anything, either.
What's the best way to handle something like this?
More information about the Digitalmars-d-learn
mailing list