[libcxx-commits] [libcxx] [libc++] Move __concatable into __ranges/join_with_view.h (PR #149464)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Jul 18 00:01:15 PDT 2025
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/149464
There is no reason to put `__concatable` into `__ranges/concepts.h`, since it's a `join_with_view`-specific concept.
>From ce554b4953428441370733c4e81d5cfb446f1631 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Fri, 18 Jul 2025 09:00:22 +0200
Subject: [PATCH] [libc++] Move __concatable into __ranges/join_with_view.h
---
libcxx/include/__ranges/concepts.h | 41 ------------------------------
1 file changed, 41 deletions(-)
diff --git a/libcxx/include/__ranges/concepts.h b/libcxx/include/__ranges/concepts.h
index bf75fe8a6fef4..aec85a28f19f7 100644
--- a/libcxx/include/__ranges/concepts.h
+++ b/libcxx/include/__ranges/concepts.h
@@ -10,9 +10,7 @@
#ifndef _LIBCPP___RANGES_CONCEPTS_H
#define _LIBCPP___RANGES_CONCEPTS_H
-#include <__concepts/common_reference_with.h>
#include <__concepts/constructible.h>
-#include <__concepts/convertible_to.h>
#include <__concepts/movable.h>
#include <__concepts/same_as.h>
#include <__config>
@@ -20,15 +18,12 @@
#include <__iterator/incrementable_traits.h>
#include <__iterator/iter_move.h>
#include <__iterator/iterator_traits.h>
-#include <__iterator/readable_traits.h>
#include <__ranges/access.h>
#include <__ranges/data.h>
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/enable_view.h>
#include <__ranges/size.h>
#include <__type_traits/add_pointer.h>
-#include <__type_traits/common_reference.h>
-#include <__type_traits/common_type.h>
#include <__type_traits/is_reference.h>
#include <__type_traits/remove_cvref.h>
#include <__type_traits/remove_reference.h>
@@ -137,42 +132,6 @@ concept viewable_range =
(is_lvalue_reference_v<_Tp> ||
(movable<remove_reference_t<_Tp>> && !__is_std_initializer_list<remove_cvref_t<_Tp>>))));
-# if _LIBCPP_STD_VER >= 23
-
-template <class... _Rs>
-using __concat_reference_t _LIBCPP_NODEBUG = common_reference_t<range_reference_t<_Rs>...>;
-
-template <class... _Rs>
-using __concat_value_t _LIBCPP_NODEBUG = common_type_t<range_value_t<_Rs>...>;
-
-template <class... _Rs>
-using __concat_rvalue_reference_t _LIBCPP_NODEBUG = common_reference_t<range_rvalue_reference_t<_Rs>...>;
-
-template <class _Ref, class _RRef, class _It>
-concept __concat_indirectly_readable_impl = requires(const _It __it) {
- { *__it } -> convertible_to<_Ref>;
- { ranges::iter_move(__it) } -> convertible_to<_RRef>;
-};
-
-template <class... _Rs>
-concept __concat_indirectly_readable =
- common_reference_with<__concat_reference_t<_Rs...>&&, __concat_value_t<_Rs...>&> &&
- common_reference_with<__concat_reference_t<_Rs...>&&, __concat_rvalue_reference_t<_Rs...>&&> &&
- common_reference_with<__concat_rvalue_reference_t<_Rs...>&&, const __concat_value_t<_Rs...>&> &&
- (__concat_indirectly_readable_impl<__concat_reference_t<_Rs...>,
- __concat_rvalue_reference_t<_Rs...>,
- iterator_t<_Rs>> &&
- ...);
-
-template <class... _Rs>
-concept __concatable = requires {
- typename __concat_reference_t<_Rs...>;
- typename __concat_value_t<_Rs...>;
- typename __concat_rvalue_reference_t<_Rs...>;
-} && __concat_indirectly_readable<_Rs...>;
-
-# endif // _LIBCPP_STD_VER >= 23
-
} // namespace ranges
#endif // _LIBCPP_STD_VER >= 20
More information about the libcxx-commits
mailing list