STL containers are inevitable to implement sequential or linked data collection. To improve efficiency of programs, I often consider to refer their elements by using the pointer(or reference).
As you know, std::vector entails transfer of entire memory domains when calling push_back has no capacity, which makes troubles in permanent safe reference.
Is permanency of memory address of each element in STL containers determined in the specification of the C++ standard? (Or does their behavior differ in library's implementations?)
> Is permanency of memory address of each element in STL containers determined
> in the specification of the C++ standard?
Yes.
For example,
vector push_back:
If the new size() is greater than capacity() then all iterators and references (including the past-the-end iterator) are invalidated. Otherwise only the past-the-end iterator is invalidated. https://en.cppreference.com/w/cpp/container/vector/push_back