News for hackers. Stuff that matters.
Re:Immer is a library of persistent and immutable data struc... by munchbunny on Thursday September 12, 2019 @01:30PM (#20954059)
> What I have specifically is a class that provides a base set of operations and a subclass that lets you do some modifications

Your object isn't actually immutable, it just doesn't let you directly mutate it. That's a really important distinction.

That's a common pattern. In C++, rather than using a subclass for the mutator, use a different (friend) class. The semantics for implicit conversion between two different classes will allow you to accomplish what you are asking for with enforcing no changes from one interface but not the other.

Re:Immer is a library of persistent and immutable data struc... by saagarjha on Thursday September 12, 2019 @10:47PM (#20958733)
> In C++, rather than using a subclass for the mutator, use a different (friend) class.

Unfortunately I don't control this class :(