Template:cpp/container/merge

The function does nothing if refers to the same object as.

Otherwise, merges two sorted lists into one. The lists should be sorted into ascending order. No elements are copied, and the container becomes empty after the merge. No iterators or references become invalidated, except that the iterators of moved elements now refer into, not into. The first version uses to compare the elements, the second version uses the given comparison function.

This operation is stable: for equivalent elements in the two lists, the elements from shall always precede the elements from, and the order of equivalent elements of  and  does not change.

If, the behavior is undefined.

Return value
(none)

Exceptions
If an exception is thrown, this function has no effect (strong exception guarantee), except if the exception comes from a comparison.

Complexity
If refers to the same object as, no comparisons are performed.

Otherwise, given and  as  and  respectively: @1@ at most comparisons using @2@ at most comparisons using

Example
{{#switch: {{{1|}}}
 * list=

Defect reports
}}