On 2019-05-30 10:23, Alberto Mardegan wrote:
It's not clear to me why splice() cannot be implemented: it would just mean that the list data would detach as in all other non-const methods. Or am I missing something?
You're passing two iterators. In order to implement slice(), you'd need to iterate over the list, counting the items, then detach, find the new two iterators, then do the slice(). That makes an O(M) operation into an O(2N) operation, M being the number of sliced entries (it was O(1) in C++98), N the size of the list.
_______________________________________________ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development