set_union [C++ Reference]
Keywords: stl,algorithm,set_union
Date: 2009-10-09T02:03:03-0700

[[set_union]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- fr
- it
- jp
- pl
- ru
- tr

## set_union

Syntax:

        #include <algorithm>
        output_iterator set_union( input_iterator start1, input_iterator end1, input_iterator2 start2, input_iterator2 end2, output_iterator result );
        output_iterator set_union( input_iterator start1, input_iterator end1, input_iterator2 start2, input_iterator2 end2, output_iterator result, StrictWeakOrdering cmp );

The set_union() algorithm computes the sorted union of the two sorted ranges [start1,end1) and [start2,end2) and stores it starting at result.

The return value of set_union() is an iterator to the end of the union range.

set_union() runs in linear time.

Related Topics: includes, merge, set_difference, set_intersection, set_symmetric_difference

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •