Skip to content

Commit d231ea6

Browse files
update exposition only concepts for concat-is-random-access and concat-is-bidirectional
1 parent 18512df commit d231ea6

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

libcxx/include/__ranges/concat_view.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,31 +447,31 @@ class concat_view<_Views...>::__iterator : public __concat_view_iterator_categor
447447
}
448448

449449
_LIBCPP_HIDE_FROM_ABI friend constexpr bool operator<(const __iterator& __x, const __iterator& __y)
450-
requires(random_access_range<__maybe_const<_Const, _Views>> && ...)
450+
requires(__all_random_access<_Const, _Views> && ...)
451451
{
452452
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!__x.__it_.valueless_by_exception() && !__y.__it_.valueless_by_exception(),
453453
"Trying to compare a valueless iterator of concat_view.");
454454
return __x.__it_ < __y.__it_;
455455
}
456456

457457
_LIBCPP_HIDE_FROM_ABI friend constexpr bool operator>(const __iterator& __x, const __iterator& __y)
458-
requires(random_access_range<__maybe_const<_Const, _Views>> && ...)
458+
requires(__all_random_access<_Const, _Views> && ...)
459459
{
460460
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!__x.__it_.valueless_by_exception() && !__y.__it_.valueless_by_exception(),
461461
"Trying to compare a valueless iterator of concat_view.");
462462
return __x.__it_ > __y.__it_;
463463
}
464464

465465
_LIBCPP_HIDE_FROM_ABI friend constexpr bool operator<=(const __iterator& __x, const __iterator& __y)
466-
requires(random_access_range<__maybe_const<_Const, _Views>> && ...)
466+
requires(__all_random_access<_Const, _Views> && ...)
467467
{
468468
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!__x.__it_.valueless_by_exception() && !__y.__it_.valueless_by_exception(),
469469
"Trying to compare a valueless iterator of concat_view.");
470470
return __x.__it_ <= __y.__it_;
471471
}
472472

473473
_LIBCPP_HIDE_FROM_ABI friend constexpr bool operator>=(const __iterator& __x, const __iterator& __y)
474-
requires(random_access_range<__maybe_const<_Const, _Views>> && ...)
474+
requires(__all_random_access<_Const, _Views> && ...)
475475
{
476476
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!__x.__it_.valueless_by_exception() && !__y.__it_.valueless_by_exception(),
477477
"Trying to compare a valueless iterator of concat_view.");

libcxx/include/__ranges/concepts.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,6 @@ concept __concat_indirectly_readable =
165165
iterator_t<_Rs>> &&
166166
...);
167167

168-
template <bool _Const, class... _Rs>
169-
concept __concat_is_random_access =
170-
(random_access_range<__maybe_const<_Const, _Rs>> && ...) && (sized_range<__maybe_const<_Const, _Rs>> && ...);
171-
172-
template <bool _Const, class... _Rs>
173-
concept __concat_is_bidirectional =
174-
((bidirectional_range<__maybe_const<_Const, _Rs>> && ...) && (common_range<__maybe_const<_Const, _Rs>> && ...));
175-
176168
template <class... _Rs>
177169
concept __concatable = requires {
178170
typename __concat_reference_t<_Rs...>;
@@ -189,6 +181,16 @@ concept __all_bidirectional = (bidirectional_range<__maybe_const<_Const, _Views>
189181
template <bool _Const, class... _Views>
190182
concept __all_forward = (forward_range<__maybe_const<_Const, _Views>> && ...);
191183

184+
template <bool _Const, class... _First, class _Tail>
185+
concept __concat_is_random_access =
186+
(__all_random_access<_Const, _First> && ... && __all_random_access<_Const, _Tail>) &&
187+
(common_range<__maybe_const<_Const, _First>> && ...);
188+
189+
template <bool _Const, class... _First, class _Tail>
190+
concept __concat_is_bidirectional =
191+
(__all_bidirectional<_Const, _First> && ... && __all_random_access<_Const, _Tail>) &&
192+
(common_range<__maybe_const<_Const, _First>> && ...);
193+
192194
# endif // _LIBCPP_STD_VER >= 23
193195

194196
} // namespace ranges

0 commit comments

Comments
 (0)