4#ifndef TETL_ALGORITHM_SET_DIFFERENCE_HPP
5#define TETL_ALGORITHM_SET_DIFFERENCE_HPP
7#include <etl/_algorithm/copy.hpp>
8#include <etl/_functional/less.hpp>
19template <
typename InputIt1,
typename InputIt2,
typename OutputIt,
typename Compare>
21set_difference(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination, Compare comp)
24 while (first1 != last1) {
25 if (first2 == last2) {
26 return etl::copy(first1, last1, destination);
29 if (comp(*first1, *first2)) {
30 *destination++ = *first1++;
32 if (
not comp(*first2, *first1)) {
41template <
typename InputIt1,
typename InputIt2,
typename OutputIt>
42constexpr auto set_difference(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination)
45 return etl::set_difference(first1, last1, first2, last2, destination,
etl::
less());
constexpr auto set_difference(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt destination) -> OutputIt
Copies the elements from the sorted range [first1, last1) which are not found in the sorted range [fi...
Definition set_difference.hpp:42
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:21
Definition adjacent_find.hpp:9
Function object for performing comparisons. Unless specialised, invokes operator< on type T....
Definition less.hpp:15