I knew this has been asked quite a lot, and I have seen many explanations quoting "emplace_back construct in place, push_back() construct and copy". Some posts asked why emplace_back calls the copy constructor because they did not reserve the memory for the vector.
But for the below case, I cannot figure out what emplace_back() achieve more than push_back(). Some answer says "you need to implement a move constructor for emplace_back() to work" But push_back() can also utilize the move constructor. So what is the difference
#include <iostream>
#include <vector>
using namespace std;
 
class Int{
    public:
    int* p;
    Int(int x): p(new int(x)) {cout<<"constructor called for "<<*p<<endl;}
    Int(const Int& x): p(new int(*(x.p))) {cout<<"copy constructor called for "<<*p<<endl;}
    ~Int(){
        if (p!= nullptr) {cout<<"destructor called for "<<*p<<endl;}
        else{cout<<"destructor called for null ptr"<<endl;}   
        delete p; 
    }
    
    Int(Int&& x): p(x.p) {
        x.p = nullptr; 
        cout<<"move constructor called for "<<*p<<endl;  // move constructor, remove to test emplace_back()
        }
};
int main(){
    vector<Int> v;
    v.reserve(1);
    v.emplace_back(Int(1));  // can switch to push_back()
    // v.push_back(Int(1));
    cout<<"end program"<<endl;
}
For me, it seems both methods call copy constructor without move constructor, and calls move constructor if there is one.