Question about boost::multi_index::random_access splice()

It appears that when calling splice() for a random_access index in a multi_index container, the splice calls a copy constructor. This is apparently by design (since the documentation says that it will do an insert) but why was this chosen? Is there another method to move an item from one container to another without having to call the copy constructor? Or can the code be changed to do splice the same way that std::list does? Michael Watkins _________________________________________________________________ Quick access to your favorite MSN content and Windows Live with Internet Explorer 8. http://ie8.msn.com/microsoft/internet-explorer-8/en-us/ie8.aspx?ocid=B037MSN...

Michael Watkins <condenser <at> hotmail.com> writes:
It appears that when calling splice() for a random_access index in a multi_index container, the splice calls a copy constructor. This is apparently by design (since the documentation says that it will do an insert) but why was this chosen? Is there another method to move an item from one container to another without having to call the copy constructor? Or can the code be changed to do splice the same way that std::list does?
Sorry, there is currently no way to have actual moving of nodes between multi_index_containers. This design decision was made basically in order to minimize the number of primitive operations (see http://tinyurl.com/cshbfz ) that each index has to implement. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
participants (2)
-
Joaquin M Lopez Munoz
-
Michael Watkins