I write C ++ code that controls a bunch of vectors that change in size and therefore are constantly redistributed.
I would like to get a "pointer" to these vectors, which remains valid even after the redistribution of the vector. In particular, I just want these “pointers” to remember which vector they are pointing to, and the index they are pointing to. When I cast them using the standard (* ptr) syntax, I just want them to do an obvious search.
Obviously, the actual pointers will not be valid after the redistribution, and I understand that iterators are not valid after the redistribution. Also note that I don't care if elements are inserted in front of my objects, so these “pointers” really don't need to remember anything except the vector and index.
Now I could easily write such a class myself. Has anyone (Boost? STL?) Done this for me already?
Change . The answers do not affect my question. I asked if this functionality is any standard library. Do I accept the answer as no?
source
share