mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 23:25:24 +02:00
This patch changes the implementation of operator[], to follow similar pattern as at, where we normalize argument types and forward to single overload. The conversion now uses __mdspan::__index_type_cast, instead of static_assert. This introduces asserts assuring that conversion is is value preserving. Finally, __is_multi_index is implemented as local lambda, avoiding the need to create a local array with copies of the arguments. libstdc++-v3/ChangeLog: * include/std/mdspan (__mdspan::__is_multi_index): Removed, replaced with local lambda in mdspan::operator[]. (__mdspan::operator[]): Implement in terms of single overload accepting index_type. Use __mdspan::__index_type_cast for type conversion. Reviewed-by: Jonathan Wakely <jwakely@redhat.com> Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>