Template:cpp/container/splice

Transfers elements from one list to another.

No elements are copied or moved, only the internal pointers of the list nodes are re-pointed. The behavior is undefined if. No iterators or references become invalidated, the iterators to moved elements remain valid, but now refer into, not into.

@1,2@ Transfers all elements from into. The elements are inserted before the element pointed to by. The container becomes empty after the operation. The behavior is undefined if refers to the same object as.

@3,4@ Transfers the element pointed to by from  into. The element is inserted before the element pointed to by.

@5,6@ Transfers the elements in the range from  into. The elements are inserted before the element pointed to by. The behavior is undefined if is an iterator in the range.

Return value
(none)

Exceptions
Throws nothing.

Complexity
1-4) Constant.

5,6) Constant if refers to the same object as, otherwise linear in.