Skip to content

Commit 083dccc

Browse files
Update libcxx/include/__ranges/concat_view.h
Co-authored-by: A. Jiang <[email protected]>
1 parent 7ebb240 commit 083dccc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

libcxx/include/__ranges/concat_view.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,12 @@ class concat_view<_Views...>::__iterator : public __concat_view_iterator_categor
289289

290290
template <typename _Func>
291291
_LIBCPP_HIDE_FROM_ABI constexpr auto __invoke_at_index(_Func&& __func) const {
292-
return [&__func, this]<std::size_t _Is>(this auto&& __self) {
293-
if (_Is == __it_.index()) {
292+
// TODO(GCC 16): Just capture `this` when GCC PR113563 and PR121008 are fixed.
293+
return [&__func, &__view_iter = *this]<std::size_t _Is>(this auto&& __self) {
294+
if (_Is == __view_iter.__it_.index()) {
294295
return __func.template operator()<_Is>();
295-
} if constexpr (_Is + 1 < sizeof...(_Views)) {
296+
}
297+
if constexpr (_Is + 1 < sizeof...(_Views)) {
296298
return __self.template operator()<_Is + 1>();
297299
}
298300
__builtin_unreachable();

0 commit comments

Comments
 (0)