diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -106,6 +106,8 @@ # define _LIBCPP_ABI_OPTIMIZED_FUNCTION // All the regex constants must be distinct and nonzero. # define _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO +// Use raw pointers, not wrapped ones, for std::span's iterator type. +# define _LIBCPP_ABI_SPAN_POINTER_ITERATORS // Re-worked external template instantiations for std::string with a focus on // performance and fast-path inlining. # define _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION diff --git a/libcxx/include/span b/libcxx/include/span --- a/libcxx/include/span +++ b/libcxx/include/span @@ -200,7 +200,11 @@ using const_pointer = const _Tp *; using reference = _Tp &; using const_reference = const _Tp &; - using iterator = __wrap_iter; +#if (_LIBCPP_DEBUG == 2) || defined(_LIBCPP_ABI_SPAN_POINTER_ITERATORS) + using iterator = pointer; +#else + using iterator = __wrap_iter; +#endif using reverse_iterator = _VSTD::reverse_iterator; static constexpr size_type extent = _Extent; @@ -375,7 +379,11 @@ using const_pointer = const _Tp *; using reference = _Tp &; using const_reference = const _Tp &; - using iterator = __wrap_iter; +#if (_LIBCPP_DEBUG == 2) || defined(_LIBCPP_ABI_SPAN_POINTER_ITERATORS) + using iterator = pointer; +#else + using iterator = __wrap_iter; +#endif using reverse_iterator = _VSTD::reverse_iterator; static constexpr size_type extent = dynamic_extent;