3#ifndef TETL_ALGORITHM_SET_UNION_HPP
4#define TETL_ALGORITHM_SET_UNION_HPP
18template <
typename InputIt1,
typename InputIt2,
typename OutputIt,
typename Compare>
20set_union(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination, Compare comp)
23 for (; first1 != last1; ++destination) {
24 if (first2 == last2) {
25 return etl::copy(first1, last1, destination);
27 if (comp(*first2, *first1)) {
28 *destination = *first2++;
32 *destination = *first1;
33 if (not comp(*first1, *first2)) {
38 return etl::copy(first2, last2, destination);
41template <
typename InputIt1,
typename InputIt2,
typename OutputIt>
42constexpr auto set_union(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination)
constexpr auto copy(InputIt first, InputIt last, OutputIt destination) -> OutputIt
Copies the elements in the range, defined by [first, last), to another range beginning at destination...
Definition copy.hpp:18
constexpr auto set_union(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination, Compare comp) -> OutputIt
Constructs a sorted union beginning at destination consisting of the set of elements present in one o...
Definition set_union.hpp:20
Definition adjacent_find.hpp:8
Function object for performing comparisons. Unless specialised, invokes operator< on type T....
Definition less.hpp:14