merge overloads

Synopses

Declared in <folly/container/Merge.h>

Merge two sorted ranges, preferring elements from the first range on ties.

template<
    class InputIt1,
    class InputIt2,
    class OutputIt>
OutputIt
merge(
    InputIt1 first1,
    InputIt1 last1,
    InputIt2 first2,
    InputIt2 last2,
    OutputIt d_first);

Merge two sorted ranges using a comparator, preferring the first range on ties.

template<
    class InputIt1,
    class InputIt2,
    class OutputIt,
    class Compare>
OutputIt
merge(
    InputIt1 first1,
    InputIt1 last1,
    InputIt2 first2,
    InputIt2 last2,
    OutputIt d_first,
    Compare comp);

Return Value

An output iterator past the last element written.

Parameters

Name

Description

first1

Iterator to the beginning of the first sorted range.

last1

Iterator past the end of the first sorted range.

first2

Iterator to the beginning of the second sorted range.

last2

Iterator past the end of the second sorted range.

d_first

Output iterator receiving the merged elements.

comp

Comparator returning true when its first argument orders before its second.

Created with MrDocs