Sunday, September 15, 2013

stl splice function

Splice Functions

Linked lists have the advantage that you can remove and insert elements at any position in constant time. If you move elements from one container to another, this advantage doubles in that you only need to redirect some internal pointers (figure below)

Figure : Splice Operations to Change the Order of List Elements

To support this ability, lists provide not only remove() but also additional modifying member functions to change the order of and relink elements and ranges. You can call these operations to move elements inside a single list or between two lists, provided the lists have the same type the table below lists these functions.

Figure : Special Modifying Operations for Lists

See Also:

No comments:

Post a Comment