|
|
|
|
|
by Kranar
1829 days ago
|
|
The concept behind this is reference stability, and if you need a collection that has stable references, you must introduce a level of indirection, that is, instead of a vector<T>, you use a vector<unique_ptr<T>> and then you can take references as follows: auto& r = *some_vector[0];
|
|