mergeable.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // -*- C++ -*-
  2. //===----------------------------------------------------------------------===//
  3. //
  4. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  5. // See https://llvm.org/LICENSE.txt for license information.
  6. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #ifndef _LIBCPP___ITERATOR_MERGEABLE_H
  10. #define _LIBCPP___ITERATOR_MERGEABLE_H
  11. #include <__config>
  12. #include <__functional/identity.h>
  13. #include <__functional/ranges_operations.h>
  14. #include <__iterator/concepts.h>
  15. #include <__iterator/projected.h>
  16. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  17. # pragma GCC system_header
  18. #endif
  19. _LIBCPP_BEGIN_NAMESPACE_STD
  20. #if _LIBCPP_STD_VER >= 20
  21. template <class _Input1,
  22. class _Input2,
  23. class _Output,
  24. class _Comp = ranges::less,
  25. class _Proj1 = identity,
  26. class _Proj2 = identity>
  27. concept mergeable =
  28. input_iterator<_Input1> && input_iterator<_Input2> && weakly_incrementable<_Output> &&
  29. indirectly_copyable<_Input1, _Output> && indirectly_copyable<_Input2, _Output> &&
  30. indirect_strict_weak_order<_Comp, projected<_Input1, _Proj1>, projected<_Input2, _Proj2>>;
  31. #endif // _LIBCPP_STD_VER >= 20
  32. _LIBCPP_END_NAMESPACE_STD
  33. #endif // _LIBCPP___ITERATOR_MERGEABLE_H