Copy constructor of CodeEditor::Position doesn't copy maintenance state. Why?


Title says it all. What’s the design decision behind this? (I assume there is one because the comment of the copy constructor explicitely states this behaviour).

It makes usage of containers that use the copy constructor very unintuitive:

Array<CodeDocument::Position> positionList;
CodeDocument::Position pos(whatever);

positionList.getLast().isPositionMaintained(); // <- false.

I can imagine it has something to do with not cluttering the ListenerList of the CodeDocument, but can we at least have move semantics that allow this?

positions.getReference(0).isPositionMaintained(); // <- true

The other option I see here is to use a OwnedArray<CodeDocument::Position> and create them on the heap to prevent copying, but this is rather ugly.