merge [C++ Reference]
Keywords: stl,list,merge
Date: 2009-10-10T08:23:31-0700

## merge

Syntax:

        #include <list>
        void merge( list& other );
        void merge( list& other, BinPred compfunction );

The function merge() merges all elements of `other` into `*this`, making `other` empty. The resulting list is ordered with respect to the < operator. If compfunction is specified, then it is used as the comparison function for the lists instead of <.

merge() runs in linear time.

Related Topics: List operators, insert, splice