diff options
author | Hui Xie <hui.xie1990@gmail.com> | 2022-07-11 23:39:59 +0100 |
---|---|---|
committer | Hui Xie <hui.xie1990@gmail.com> | 2022-07-13 21:24:32 +0100 |
commit | a5c0638dec838fe4c8189d3c72c251c9030f9605 (patch) | |
tree | 4bdf378502373683aebba99cb89b69a228aebe7f /libcxx/include/algorithm | |
parent | 04c681d195647bc111e067726b0b1bf6025971ce (diff) | |
download | llvm-a5c0638dec838fe4c8189d3c72c251c9030f9605.zip llvm-a5c0638dec838fe4c8189d3c72c251c9030f9605.tar.gz llvm-a5c0638dec838fe4c8189d3c72c251c9030f9605.tar.bz2 |
[libc++][ranges] implement `std::ranges::set_symmetric_difference`
[libc++][ranges] implement `std::ranges::set_symmetric_difference`
Differential Revision: https://reviews.llvm.org/D129520
Diffstat (limited to 'libcxx/include/algorithm')
-rw-r--r-- | libcxx/include/algorithm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm index 18d8ef3..f616a03 100644 --- a/libcxx/include/algorithm +++ b/libcxx/include/algorithm @@ -692,6 +692,26 @@ namespace ranges { ranges::find_end(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 + template<class I1, class I2, class O> + using set_symmetric_difference_result = in_in_out_result<I1, I2, O>; // since C++20 + + template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2, + weakly_incrementable O, class Comp = ranges::less, + class Proj1 = identity, class Proj2 = identity> + requires mergeable<I1, I2, O, Comp, Proj1, Proj2> + constexpr set_symmetric_difference_result<I1, I2, O> + set_symmetric_difference(I1 first1, S1 last1, I2 first2, S2 last2, O result, + Comp comp = {}, Proj1 proj1 = {}, + Proj2 proj2 = {}); // since C++20 + + template<input_range R1, input_range R2, weakly_incrementable O, + class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> + requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2> + constexpr set_symmetric_difference_result<borrowed_iterator_t<R1>, + borrowed_iterator_t<R2>, O> + set_symmetric_difference(R1&& r1, R2&& r2, O result, Comp comp = {}, + Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 + } constexpr bool // constexpr in C++20 @@ -1472,6 +1492,7 @@ template <class BidirectionalIterator, class Compare> #include <__algorithm/ranges_search_n.h> #include <__algorithm/ranges_set_difference.h> #include <__algorithm/ranges_set_intersection.h> +#include <__algorithm/ranges_set_symmetric_difference.h> #include <__algorithm/ranges_sort.h> #include <__algorithm/ranges_sort_heap.h> #include <__algorithm/ranges_stable_sort.h> |