xref: /freebsd-src/contrib/llvm-project/libcxx/include/__iterator/mergeable.h (revision cb14a3fe5122c879eae1fb480ed7ce82a699ddb6)
181ad6265SDimitry Andric // -*- C++ -*-
281ad6265SDimitry Andric //===----------------------------------------------------------------------===//
381ad6265SDimitry Andric //
481ad6265SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
581ad6265SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
681ad6265SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
781ad6265SDimitry Andric //
881ad6265SDimitry Andric //===----------------------------------------------------------------------===//
981ad6265SDimitry Andric 
1081ad6265SDimitry Andric #ifndef _LIBCPP___ITERATOR_MERGEABLE_H
1181ad6265SDimitry Andric #define _LIBCPP___ITERATOR_MERGEABLE_H
1281ad6265SDimitry Andric 
1381ad6265SDimitry Andric #include <__config>
1481ad6265SDimitry Andric #include <__functional/identity.h>
1581ad6265SDimitry Andric #include <__functional/ranges_operations.h>
1681ad6265SDimitry Andric #include <__iterator/concepts.h>
1781ad6265SDimitry Andric #include <__iterator/projected.h>
1881ad6265SDimitry Andric 
1981ad6265SDimitry Andric #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
2081ad6265SDimitry Andric #  pragma GCC system_header
2181ad6265SDimitry Andric #endif
2281ad6265SDimitry Andric 
2381ad6265SDimitry Andric _LIBCPP_BEGIN_NAMESPACE_STD
2481ad6265SDimitry Andric 
2506c3fb27SDimitry Andric #if _LIBCPP_STD_VER >= 20
2681ad6265SDimitry Andric 
27*cb14a3feSDimitry Andric template <class _Input1,
28*cb14a3feSDimitry Andric           class _Input2,
29*cb14a3feSDimitry Andric           class _Output,
30*cb14a3feSDimitry Andric           class _Comp  = ranges::less,
31*cb14a3feSDimitry Andric           class _Proj1 = identity,
32*cb14a3feSDimitry Andric           class _Proj2 = identity>
3381ad6265SDimitry Andric concept mergeable =
34*cb14a3feSDimitry Andric     input_iterator<_Input1> && input_iterator<_Input2> && weakly_incrementable<_Output> &&
35*cb14a3feSDimitry Andric     indirectly_copyable<_Input1, _Output> && indirectly_copyable<_Input2, _Output> &&
3681ad6265SDimitry Andric     indirect_strict_weak_order<_Comp, projected<_Input1, _Proj1>, projected<_Input2, _Proj2>>;
3781ad6265SDimitry Andric 
3806c3fb27SDimitry Andric #endif // _LIBCPP_STD_VER >= 20
3981ad6265SDimitry Andric 
4081ad6265SDimitry Andric _LIBCPP_END_NAMESPACE_STD
4181ad6265SDimitry Andric 
4281ad6265SDimitry Andric #endif // _LIBCPP___ITERATOR_MERGEABLE_H
43