On 30/05/19 11:40, Mutz, Marc wrote: > 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.
But that happens only if you detach; otherwise the performance should be comparable to std::list. That detaching has a high cost is a known fact. Ciao, Alberto -- http://www.mardy.it - Geek in un lingua international _______________________________________________ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development