3#ifndef TETL_ALGORITHM_SET_DIFFERENCE_HPP
4#define TETL_ALGORITHM_SET_DIFFERENCE_HPP
18template <
typename InputIt1,
typename InputIt2,
typename OutputIt,
typename Compare>
20set_difference(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination, Compare comp)
23 while (first1 != last1) {
24 if (first2 == last2) {
25 return etl::copy(first1, last1, destination);
28 if (comp(*first1, *first2)) {
29 *destination++ = *first1++;
31 if (not comp(*first2, *first1)) {
40template <
typename InputIt1,
typename InputIt2,
typename OutputIt>
41constexpr auto set_difference(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_difference(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination, Compare comp) -> OutputIt
Copies the elements from the sorted range [first1, last1) which are not found in the sorted range [fi...
Definition set_difference.hpp:20
Definition adjacent_find.hpp:8
Function object for performing comparisons. Unless specialised, invokes operator< on type T....
Definition less.hpp:14