splice

C/C++ Reference

splice
Syntax:
  #include <list>
  void splice( iterator pos, list& lst );
  void splice( iterator pos, list& lst, iterator del );
  void splice( iterator pos, list& lst, iterator start, iterator end );

The splice() function inserts lst at location pos. If specified, the element(s) at del or from start to end are removed.

splice() simply moves elements from one list to another, and doesn't actually do any copying or deleting. Because of this, splice() runs in constant time.

Related topics: