-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Closed
Labels
hardeningIssues related to the hardening effortIssues related to the hardening effortlibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Milestone
Description
There is iterator support for std::string_view
and std::span
, but not the corresponding containers. It'd be cool to extend it to that.
I don't know why they weren't added there, but I have a guess. Was it because you're allowed to push_back
on a std::string
or std::vector
, up to capacity()
, without invalidating iterators? And then I guess std::vector
's promise of pointer stability after move means the iterator can't just retain a pointer back to the parent container.
In that case, perhaps the wrapped iterator could be sized based on the capacity, rather than the length? It's a weaker check than is ideal, but at least it means you can't run off the end of the allocation.
Metadata
Metadata
Assignees
Labels
hardeningIssues related to the hardening effortIssues related to the hardening effortlibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.