object will die out of this scope, this is correct. No, vector doesn't and couldn't affect its lifetime. push_back actually copies object into the vector. To avoid this, you can use C++11's emplace_back which allows to construct Foo in-place: