How can I get the position where my object was actually inserted?
using namespace std;
list[...].method(); // I do not have the key
v is your vector, the following will give you the position (that is, the index):
v.push_back(object); size_t pos = v.size() - 1;
Or you can look at the
size() before calling
push_back(). Then you won't need to subtract one.