Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <typename It1, typename It2, typename Out>
- Out mystd::set_difference(It1 first1, It1 last1,
- It2 first2, It2 last2, Out out) {
- while (first1 != last1) {
- if (first2 == last2) {
- return std::copy(first1, last1, out);
- }
- if (*first1 < *first2) {
- *out++ = *first1++;
- } else {
- if (*first2 >= *first1) {
- ++first1;
- }
- ++first2;
- }
- }
- return out;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement