xref: /freebsd-src/contrib/llvm-project/libcxx/include/__algorithm/in_in_result.h (revision b3edf4467982447620505a28fc82e38a414c07dc)
104eeddc0SDimitry Andric // -*- C++ -*-
204eeddc0SDimitry Andric //===----------------------------------------------------------------------===//
304eeddc0SDimitry Andric //
404eeddc0SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
504eeddc0SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
604eeddc0SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
704eeddc0SDimitry Andric //
804eeddc0SDimitry Andric //===----------------------------------------------------------------------===//
904eeddc0SDimitry Andric 
1004eeddc0SDimitry Andric #ifndef _LIBCPP___ALGORITHM_IN_IN_RESULT_H
1104eeddc0SDimitry Andric #define _LIBCPP___ALGORITHM_IN_IN_RESULT_H
1204eeddc0SDimitry Andric 
1304eeddc0SDimitry Andric #include <__concepts/convertible_to.h>
1404eeddc0SDimitry Andric #include <__config>
1504eeddc0SDimitry Andric #include <__utility/move.h>
1604eeddc0SDimitry Andric 
171838bd0fSDimitry Andric #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
181838bd0fSDimitry Andric #  pragma GCC system_header
191838bd0fSDimitry Andric #endif
201838bd0fSDimitry Andric 
21*b3edf446SDimitry Andric _LIBCPP_PUSH_MACROS
22*b3edf446SDimitry Andric #include <__undef_macros>
23*b3edf446SDimitry Andric 
2404eeddc0SDimitry Andric _LIBCPP_BEGIN_NAMESPACE_STD
2504eeddc0SDimitry Andric 
2606c3fb27SDimitry Andric #if _LIBCPP_STD_VER >= 20
2704eeddc0SDimitry Andric 
2804eeddc0SDimitry Andric namespace ranges {
291838bd0fSDimitry Andric 
3081ad6265SDimitry Andric template <class _InIter1, class _InIter2>
3104eeddc0SDimitry Andric struct in_in_result {
3281ad6265SDimitry Andric   _LIBCPP_NO_UNIQUE_ADDRESS _InIter1 in1;
3381ad6265SDimitry Andric   _LIBCPP_NO_UNIQUE_ADDRESS _InIter2 in2;
3404eeddc0SDimitry Andric 
3581ad6265SDimitry Andric   template <class _InIter3, class _InIter4>
3681ad6265SDimitry Andric     requires convertible_to<const _InIter1&, _InIter3> && convertible_to<const _InIter2&, _InIter4>
in_in_resultin_in_result37cb14a3feSDimitry Andric   _LIBCPP_HIDE_FROM_ABI constexpr operator in_in_result<_InIter3, _InIter4>() const& {
3804eeddc0SDimitry Andric     return {in1, in2};
3904eeddc0SDimitry Andric   }
4004eeddc0SDimitry Andric 
4181ad6265SDimitry Andric   template <class _InIter3, class _InIter4>
4281ad6265SDimitry Andric     requires convertible_to<_InIter1, _InIter3> && convertible_to<_InIter2, _InIter4>
in_in_resultin_in_result43cb14a3feSDimitry Andric   _LIBCPP_HIDE_FROM_ABI constexpr operator in_in_result<_InIter3, _InIter4>() && {
4481ad6265SDimitry Andric     return {std::move(in1), std::move(in2)};
4581ad6265SDimitry Andric   }
4604eeddc0SDimitry Andric };
471838bd0fSDimitry Andric 
4804eeddc0SDimitry Andric } // namespace ranges
4904eeddc0SDimitry Andric 
5006c3fb27SDimitry Andric #endif // _LIBCPP_STD_VER >= 20
5104eeddc0SDimitry Andric 
5204eeddc0SDimitry Andric _LIBCPP_END_NAMESPACE_STD
5304eeddc0SDimitry Andric 
54*b3edf446SDimitry Andric _LIBCPP_POP_MACROS
55*b3edf446SDimitry Andric 
5604eeddc0SDimitry Andric #endif // _LIBCPP___ALGORITHM_IN_IN_RESULT_H
57