This patch simplifies the constraints on the constructors from arrays by removing the redundant checks that element_type and value_type are convertible to element_type. The incorrect uses of __adl_data in those constructors are removed as well (they should use std::data not std::ranges::data, and the former doesn't use ADL).
The range/container constructors are now constrained to exclude all specializations of std::span, not just the current instantiation. The range constructor now also checks s subset of the contiguous_range requirements.
All relevant constructor constraints now use the _Require helper in order to short circuit and avoid unnecessary instantiations after the first failed constraint.
A new constructor supports initialization from different specializations of std::span
- include/bits/range_access.h (__adl_to_address): Remove.
- include/std/span (__is_base_derived_safe_convertible_v): Replace with span::__is_compatible. (__is_std_array_v): Replace with __is_std_array class template and partial specializations. (__is_std_array, __is_std_span): New class templates and partial specializations. (span::__is_compatible): New alias template for SFINAE constraints. (span::span(element_type (&)[N])): Remove redundant constraints. Do not use __adl_data to obtain a pointer. (span::span(array
a1823cbbcbd Improve constraints for std::span constructors
libstdc++-v3/ChangeLog | 34 +++++
libstdc++-v3/include/bits/range_access.h | 7 -
libstdc++-v3/include/std/span | 214 +++++++++++++++++--------------
3 files changed, 155 insertions(+), 100 deletions(-)