<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/78805>78805</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
_LIBCPP_ABI_BOUNDED_ITERATORS support for std::string and std::vector
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
davidben
</td>
</tr>
</table>
<pre>
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.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0U82O4zYMfhr5QmxgKz8eH3zIzGyAAEV3sZ2ix4CWmFg7iiRIVNL06QvZM7PNontJLJEi-f0QUzInR9SL9aNYP1eYefSx13gxeiBXDV7f-peRIoFJYJgiso-Qcgg-Mhx9BLGpE2ux3IrlNnE07nS4GLqKTQ3o9H04oBObWsgnGDKD8ww8EigfI6XgnTbuBMo7RuMopgXsWchWw1ByvAX2QH8zOQ2Gy4FH5IWon0W9nX_3oL0TsmV4df4K1_FWGtzgSpHme9SadLmM9D7GHka8ECCcMqW0gL-wIIWBFOZEcPNZyDYSoLX-Wh77AirkNB4GVK8FqHeA_0PEFLpn6EKKfXwjIYe3YgoDKsM3IR-E7N6iV8OjzwzGXdAajVzYeZcgieUOtm6C4mA_z_6rTm2CEP3ZJAJ_hOCNY4qQGAdjDd8Aj-V89heCM6FLkyofYiucqfueE0OkIg7gR5VCwawFQcBIjn8oeK-Nm_QChWmiPlAcMcy9rhFDIP2fnj7bSfdk_iENAybSheXJLh9kPUHEImUpPMcsuROPhZvJOgkQroSvFEGNVAYticXJmtC-GwAZLGHiovqM_-bzB-yYHfjjcSpfrOfnz-IGhWy8W1S6X-pu2WFFfdPW67Zed8u2GvvjsGw6tW4fqMXNSnYDDp3CmtpmPTRH1VWml7Vc1U3TyWUjm3axkU2HK1oP7ZFWLa3EqqYzGruw9nJe-HiqTEqZ-vbhoV5XFgey6X13Y1-SPg35lMSqtiZx-vGMDVvqD7_tH5--fj1sH_eHxy9__v78-fmwf_n8bfvy5dsfd1v9k5OnVf7JWlWOth-ZQyq3cifk7mR4zMNC-bOQu9L77e9TiP47KRZyN82fhNxNEP4NAAD__2tvfjE">