Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:13:11

0001 //===----------------------------------------------------------------------===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef _LIBCPP___ALGORITHM_RANGES_SET_SYMMETRIC_DIFFERENCE_H
0010 #define _LIBCPP___ALGORITHM_RANGES_SET_SYMMETRIC_DIFFERENCE_H
0011 
0012 #include <__algorithm/in_in_out_result.h>
0013 #include <__algorithm/make_projected.h>
0014 #include <__algorithm/set_symmetric_difference.h>
0015 #include <__config>
0016 #include <__functional/identity.h>
0017 #include <__functional/invoke.h>
0018 #include <__functional/ranges_operations.h>
0019 #include <__iterator/concepts.h>
0020 #include <__iterator/mergeable.h>
0021 #include <__ranges/access.h>
0022 #include <__ranges/concepts.h>
0023 #include <__ranges/dangling.h>
0024 #include <__utility/move.h>
0025 
0026 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0027 #  pragma GCC system_header
0028 #endif
0029 
0030 _LIBCPP_PUSH_MACROS
0031 #include <__undef_macros>
0032 
0033 #if _LIBCPP_STD_VER >= 20
0034 
0035 _LIBCPP_BEGIN_NAMESPACE_STD
0036 
0037 namespace ranges {
0038 
0039 template <class _InIter1, class _InIter2, class _OutIter>
0040 using set_symmetric_difference_result = in_in_out_result<_InIter1, _InIter2, _OutIter>;
0041 
0042 struct __set_symmetric_difference {
0043   template <input_iterator _InIter1,
0044             sentinel_for<_InIter1> _Sent1,
0045             input_iterator _InIter2,
0046             sentinel_for<_InIter2> _Sent2,
0047             weakly_incrementable _OutIter,
0048             class _Comp  = ranges::less,
0049             class _Proj1 = identity,
0050             class _Proj2 = identity>
0051     requires mergeable<_InIter1, _InIter2, _OutIter, _Comp, _Proj1, _Proj2>
0052   _LIBCPP_HIDE_FROM_ABI constexpr set_symmetric_difference_result<_InIter1, _InIter2, _OutIter> operator()(
0053       _InIter1 __first1,
0054       _Sent1 __last1,
0055       _InIter2 __first2,
0056       _Sent2 __last2,
0057       _OutIter __result,
0058       _Comp __comp   = {},
0059       _Proj1 __proj1 = {},
0060       _Proj2 __proj2 = {}) const {
0061     auto __ret = std::__set_symmetric_difference(
0062         std::move(__first1),
0063         std::move(__last1),
0064         std::move(__first2),
0065         std::move(__last2),
0066         std::move(__result),
0067         ranges::__make_projected_comp(__comp, __proj1, __proj2));
0068     return {std::move(__ret.__in1_), std::move(__ret.__in2_), std::move(__ret.__out_)};
0069   }
0070 
0071   template <input_range _Range1,
0072             input_range _Range2,
0073             weakly_incrementable _OutIter,
0074             class _Comp  = ranges::less,
0075             class _Proj1 = identity,
0076             class _Proj2 = identity>
0077     requires mergeable<iterator_t<_Range1>, iterator_t<_Range2>, _OutIter, _Comp, _Proj1, _Proj2>
0078   _LIBCPP_HIDE_FROM_ABI constexpr set_symmetric_difference_result<borrowed_iterator_t<_Range1>,
0079                                                                   borrowed_iterator_t<_Range2>,
0080                                                                   _OutIter>
0081   operator()(_Range1&& __range1,
0082              _Range2&& __range2,
0083              _OutIter __result,
0084              _Comp __comp   = {},
0085              _Proj1 __proj1 = {},
0086              _Proj2 __proj2 = {}) const {
0087     auto __ret = std::__set_symmetric_difference(
0088         ranges::begin(__range1),
0089         ranges::end(__range1),
0090         ranges::begin(__range2),
0091         ranges::end(__range2),
0092         std::move(__result),
0093         ranges::__make_projected_comp(__comp, __proj1, __proj2));
0094     return {std::move(__ret.__in1_), std::move(__ret.__in2_), std::move(__ret.__out_)};
0095   }
0096 };
0097 
0098 inline namespace __cpo {
0099 inline constexpr auto set_symmetric_difference = __set_symmetric_difference{};
0100 } // namespace __cpo
0101 } // namespace ranges
0102 
0103 _LIBCPP_END_NAMESPACE_STD
0104 
0105 #endif // _LIBCPP_STD_VER >= 20
0106 
0107 _LIBCPP_POP_MACROS
0108 
0109 #endif // _LIBCPP___ALGORITHM_RANGES_SET_SYMMETRIC_DIFFERENCE_H