Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LWG-3974 mdspan::operator[] should not copy OtherIndexTypes #4166

Closed
StephanTLavavej opened this issue Nov 12, 2023 · 0 comments · Fixed by #4214
Closed

LWG-3974 mdspan::operator[] should not copy OtherIndexTypes #4166

StephanTLavavej opened this issue Nov 12, 2023 · 0 comments · Fixed by #4214
Labels
fixed Something works now, yay! LWG Library Working Group issue mdspan C++23 mdspan

Comments

@StephanTLavavej
Copy link
Member

LWG-3974 mdspan::operator[] should not copy OtherIndexTypes

The accepted resolution says extents_type::index-cast while we use static_cast<index_type>:

STL/stl/inc/mdspan

Lines 1286 to 1291 in 46843b3

template <class _OtherIndexType, size_t... _Seq>
_NODISCARD constexpr reference _Multidimensional_subscript(
span<_OtherIndexType, rank()> _Indices, index_sequence<_Seq...>) const
noexcept(noexcept(_Access_impl(static_cast<index_type>(_STD as_const(_Indices[_Seq]))...))) {
return _Access_impl(static_cast<index_type>(_STD as_const(_Indices[_Seq]))...);
}

I'm 80% sure this is unobservable, but I'm filing this issue to double-check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed Something works now, yay! LWG Library Working Group issue mdspan C++23 mdspan
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant