Do vector.emplace_back() and vector.push_back() do the same thing?
问题 So I was trying to add integers onto the back of my vector and mistakenly thought push_back() added the new data onto the front of the vector (aka vector[0]). I did a test in Xcode and tested push_back() against emplace_back() and got the same results. I thought they were different, but this makes me think that maybe they do the same thing. If this is so, why does vector have the different methods? Here's my code in case I was doing: #include <vector> #include <iostream> using namespace std ;