We need a typesystem-sanctioned way to cast qualifiers away
deadalnix via Digitalmars-d
digitalmars-d at puremagic.com
Fri Jun 19 17:18:48 PDT 2015
That's only one aspect of the problem? the other side of the coin
is that you'd like the qualifier to turtle down your collection.
Right now,
const(Collection!T) is different from
const(Collection!(const(T))) .
Back to your problem, the only I see to write that in a way the
compiler won't bite you later is to get a reference to the field
(refcount of allocator) cast the qualifier of that reference, and
then manipulating it.
Everything need to go through the casted reference. If you drop
it and get it back again, the compiler may assume thing you don't
want it to assume.
More information about the Digitalmars-d
mailing list