Skip to content

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

@StephanTLavavej

Description

@StephanTLavavej

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    LWGLibrary Working Group issuefixedSomething works now, yay!mdspanC++23 mdspan

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions