[Bug libstdc++/123901] Consider optimizing std::regex matching algos to convert [first,last) to a std::basic_string and match on that

tkaminsk at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Feb 5 14:20:31 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123901

--- Comment #5 from Tomasz Kamiński <tkaminsk at gcc dot gnu.org> ---
> We could still consider lowering all contiguous iterators to const CharT* pointers, so that we share the same instantiations for std::string::iterator and std::string::const_iterator, and char* and const char*, and iterators into vectors and spans. That wouldn't perform any allocations and wouldn't have any effect on non-contiguous iterators (like your rope use case).

Yes. FWIW this is what I did for the formatting ranges as strings, for all
contingous ranges. I have even included one that are not-sized, and must be
iterated twice (not relevant for pre-C++20 iterators).


More information about the Gcc-bugs mailing list