Standard C++ Library Class Reference
Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
set_union
 Algorithm
Summary
Basic set operation for sorted sequences.
Contents
Synopsis● 
Description● 
Complexity● 
Example● 
Warning● 
See Also● 
Synopsis
#include <algorithm>
template <class InputIterator1, class InputIterator2, class OutputIterator>
OutputIterator 
set_union (InputIterator1 first1, InputIterator1 last1,
 InputIterator2 first2, InputIterator2 last2,
 OutputIterator result);
template <class InputIterator1, class InputIterator2, 
 class OutputIterator, class Compare>
OutputIterator 
set_union (InputIterator1 first1, InputIterator1 last1,
 InputIterator2 first2, InputIterator2 last2,
 OutputIterator result, Compare comp);
Description
The set_union algorithm constructs a sorted union of the elements from the two ranges. It returns the end of the
constructed range. set_union is stable, that is, if an element is present in both ranges, the one from the first
range is copied. The result of of set_union is undefined if the result range overlaps with either of the original
ranges. Note that set_union does not merge the two sorted sequences. If an element is present in both










