Replace all Partition object copy assignment (#759726)
Copy assignment of Partition objects is now only performed in a few places in the Operation and OperationResizeMove classes when updating the displayed PartitionVector. (From Refresh_Visual() when each operation is visually applied to the display_partitions vector; the new_partition from the operation is copy assigned over the top of the relevant existing partition in the display_partitions vector). In general polymorphic copy assignment is complicated [1], and is now unnecessary given the above limited use. All that is needed is a way to polymorphically replace one Partition object with another in a PartitionVector. First, prevent further use of Partition object copy assignment by providing a private declaration and no implementation, so the compiler enforces this. Second implement and use PartitionVector method replace_at() which replaces a pointer to one Partition object with another at the specified index in the PartitionVector. [1] The Assignment Operator Revisited [Section:] Virtual assignment http://icu-project.org/docs/papers/cpp_report/the_assignment_operator_revisited.html Bug 759726 - Implement Partition object polymorphism
parent
4a6cbcd0
Please register or sign in to comment