[rtsan] Remove mkfifoat interceptor (#116997)
[llvm-project.git] / libcxx / include / __cxx03 / __algorithm / ranges_set_symmetric_difference.h
blob50ec574fcc301ba1709c10ce81f3cd8d93c44429
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef _LIBCPP___ALGORITHM_RANGES_SET_SYMMETRIC_DIFFERENCE_H
10 #define _LIBCPP___ALGORITHM_RANGES_SET_SYMMETRIC_DIFFERENCE_H
12 #include <__cxx03/__algorithm/in_in_out_result.h>
13 #include <__cxx03/__algorithm/iterator_operations.h>
14 #include <__cxx03/__algorithm/make_projected.h>
15 #include <__cxx03/__algorithm/set_symmetric_difference.h>
16 #include <__cxx03/__config>
17 #include <__cxx03/__functional/identity.h>
18 #include <__cxx03/__functional/invoke.h>
19 #include <__cxx03/__functional/ranges_operations.h>
20 #include <__cxx03/__iterator/concepts.h>
21 #include <__cxx03/__iterator/mergeable.h>
22 #include <__cxx03/__ranges/access.h>
23 #include <__cxx03/__ranges/concepts.h>
24 #include <__cxx03/__ranges/dangling.h>
25 #include <__cxx03/__utility/move.h>
27 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
28 # pragma GCC system_header
29 #endif
31 _LIBCPP_PUSH_MACROS
32 #include <__cxx03/__undef_macros>
34 #if _LIBCPP_STD_VER >= 20
36 _LIBCPP_BEGIN_NAMESPACE_STD
38 namespace ranges {
40 template <class _InIter1, class _InIter2, class _OutIter>
41 using set_symmetric_difference_result = in_in_out_result<_InIter1, _InIter2, _OutIter>;
43 namespace __set_symmetric_difference {
45 struct __fn {
46 template <input_iterator _InIter1,
47 sentinel_for<_InIter1> _Sent1,
48 input_iterator _InIter2,
49 sentinel_for<_InIter2> _Sent2,
50 weakly_incrementable _OutIter,
51 class _Comp = ranges::less,
52 class _Proj1 = identity,
53 class _Proj2 = identity>
54 requires mergeable<_InIter1, _InIter2, _OutIter, _Comp, _Proj1, _Proj2>
55 _LIBCPP_HIDE_FROM_ABI constexpr set_symmetric_difference_result<_InIter1, _InIter2, _OutIter> operator()(
56 _InIter1 __first1,
57 _Sent1 __last1,
58 _InIter2 __first2,
59 _Sent2 __last2,
60 _OutIter __result,
61 _Comp __comp = {},
62 _Proj1 __proj1 = {},
63 _Proj2 __proj2 = {}) const {
64 auto __ret = std::__set_symmetric_difference<_RangeAlgPolicy>(
65 std::move(__first1),
66 std::move(__last1),
67 std::move(__first2),
68 std::move(__last2),
69 std::move(__result),
70 ranges::__make_projected_comp(__comp, __proj1, __proj2));
71 return {std::move(__ret.__in1_), std::move(__ret.__in2_), std::move(__ret.__out_)};
74 template <input_range _Range1,
75 input_range _Range2,
76 weakly_incrementable _OutIter,
77 class _Comp = ranges::less,
78 class _Proj1 = identity,
79 class _Proj2 = identity>
80 requires mergeable<iterator_t<_Range1>, iterator_t<_Range2>, _OutIter, _Comp, _Proj1, _Proj2>
81 _LIBCPP_HIDE_FROM_ABI constexpr set_symmetric_difference_result<borrowed_iterator_t<_Range1>,
82 borrowed_iterator_t<_Range2>,
83 _OutIter>
84 operator()(_Range1&& __range1,
85 _Range2&& __range2,
86 _OutIter __result,
87 _Comp __comp = {},
88 _Proj1 __proj1 = {},
89 _Proj2 __proj2 = {}) const {
90 auto __ret = std::__set_symmetric_difference<_RangeAlgPolicy>(
91 ranges::begin(__range1),
92 ranges::end(__range1),
93 ranges::begin(__range2),
94 ranges::end(__range2),
95 std::move(__result),
96 ranges::__make_projected_comp(__comp, __proj1, __proj2));
97 return {std::move(__ret.__in1_), std::move(__ret.__in2_), std::move(__ret.__out_)};
101 } // namespace __set_symmetric_difference
103 inline namespace __cpo {
104 inline constexpr auto set_symmetric_difference = __set_symmetric_difference::__fn{};
105 } // namespace __cpo
106 } // namespace ranges
108 _LIBCPP_END_NAMESPACE_STD
110 #endif // _LIBCPP_STD_VER >= 20
112 _LIBCPP_POP_MACROS
114 #endif // _LIBCPP___ALGORITHM_RANGES_SET_SYMMETRIC_DIFFERENCE_H