Is it hard to make pointee data mutable?
E.g. if have:
--
struct RCString
{
private char[] data;
private @mutable int* counter;
}
--
So for optimiser (in case of immutable) this looks like
--
struct RCString
{
private char[] data;
private @mutable void* counter; // poin
On Sunday, 7 February 2016 at 14:00:24 UTC, Iakh wrote:
Explanations:
As far as "immutable" transitive:
--
immutable RCString str;
*str.counter++; // Impossible/error/undefined behavior(with const
cast)
--
Language defines immutable to do some optimizations based on true
constness of st