diff --git a/include/string b/include/string index 57624c7..6550f5b 100644 --- a/include/string +++ b/include/string @@ -730,9 +730,14 @@ public: "[allocator.requirements] states that rebinding an allocator to the same type should result in the " "original allocator"); +#if _YNDX_LIBCPP_MAKE_STRING_ITERATOR_POINTERS == 1 + typedef pointer iterator; + typedef const_pointer const_iterator; +#else // TODO: Implement iterator bounds checking without requiring the global database. typedef __wrap_iter iterator; typedef __wrap_iter const_iterator; +#endif typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; @@ -1131,6 +1136,7 @@ public: #endif _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string& operator=(value_type __c); +#ifndef _YNDX_LIBCPP_MAKE_STRING_ITERATOR_POINTERS == 1 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator begin() _NOEXCEPT {return __make_iterator(__get_pointer());} @@ -1143,6 +1149,22 @@ public: _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator end() const _NOEXCEPT {return __make_const_iterator(__get_pointer() + size());} +#else + // It is necessary to keep the list of constructors matching the one above it. + // Made to support pointer iterators + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 + iterator begin() _NOEXCEPT + {return iterator(__get_pointer());} + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 + const_iterator begin() const _NOEXCEPT + {return const_iterator(__get_pointer());} + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 + iterator end() _NOEXCEPT + {return iterator(__get_pointer() + size());} + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 + const_iterator end() const _NOEXCEPT + {return const_iterator(__get_pointer() + size());} +#endif // _YNDX_LIBCPP_MAKE_STRING_ITERATOR_POINTERS == 1 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reverse_iterator rbegin() _NOEXCEPT