Skip to content

Commit a810c1b

Browse files
fix concept specialization
1 parent d258fe6 commit a810c1b

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

libcxx/include/__ranges/concepts.h

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,24 @@ concept __all_bidirectional = (bidirectional_range<__maybe_const<_Const, _Views>
181181
template <bool _Const, class... _Views>
182182
concept __all_forward = (forward_range<__maybe_const<_Const, _Views>> && ...);
183183

184-
template <bool _Const, class... _First, class _Tail>
184+
template <bool _Const, class _First, class... _Tail>
185+
struct __all_common_ignore_last {
186+
static constexpr bool value =
187+
common_range<__maybe_const<_Const, _First>> && __all_common_ignore_last<_Const, _Tail...>::value;
188+
};
189+
190+
template <bool _Const, class _Tail>
191+
struct __all_common_ignore_last<_Const, _Tail> {
192+
static constexpr bool value = true;
193+
};
194+
195+
template <bool _Const, class... _Rs>
185196
concept __concat_is_random_access =
186-
(__all_random_access<_Const, _First> && ... && __all_random_access<_Const, _Tail>) &&
187-
(common_range<__maybe_const<_Const, _First>> && ...);
197+
(__all_random_access<_Const, _Rs...>) && (__all_common_ignore_last<_Const, _Rs...>::value);
188198

189-
template <bool _Const, class... _First, class _Tail>
199+
template <bool _Const, class... _Rs>
190200
concept __concat_is_bidirectional =
191-
(__all_bidirectional<_Const, _First> && ... && __all_random_access<_Const, _Tail>) &&
192-
(common_range<__maybe_const<_Const, _First>> && ...);
201+
(__all_bidirectional<_Const, _Rs...>) && (__all_common_ignore_last<_Const, _Rs...>::value);
193202

194203
# endif // _LIBCPP_STD_VER >= 23
195204

0 commit comments

Comments
 (0)