mergeable.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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, class _Input2, class _Output,
  22. class _Comp = ranges::less, class _Proj1 = identity, class _Proj2 = identity>
  23. concept mergeable =
  24. input_iterator<_Input1> &&
  25. input_iterator<_Input2> &&
  26. weakly_incrementable<_Output> &&
  27. indirectly_copyable<_Input1, _Output> &&
  28. indirectly_copyable<_Input2, _Output> &&
  29. indirect_strict_weak_order<_Comp, projected<_Input1, _Proj1>, projected<_Input2, _Proj2>>;
  30. #endif // _LIBCPP_STD_VER >= 20
  31. _LIBCPP_END_NAMESPACE_STD
  32. #endif // _LIBCPP___ITERATOR_MERGEABLE_H