Is std::vector copying the objects with a push_back?

After a lot of investigations with valgrind, I’ve made the conclusion that std::vector makes a copy of an object you want to push_back.

Is that really true ? A vector cannot keep a reference or a pointer of an object without a copy ?!

Thanks

8 Answers
8

Leave a Comment