#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

class A
{
public:
    int* p;

    A() : p() {}

    A(int _) : p(new int(_)) {}

    A(const A& a) {
        p = new int(*a.p);
    }
    
    A& operator=(const A& a) {
        cout << "===\n";
        delete p;
        p = new int(*a.p);
        return *this;
    }
    

    virtual ~A() {
        delete p;
    }
};

void dump(const A& a)
{
    std::cout << *a.p << std::endl;
}

int main()
{
    std::vector<A> v;
    v.push_back(A(1));
    v.push_back(A(2));
    v.push_back(A(3));
    
    v.erase(v.begin());

    std::for_each(v.begin(), v.end(), dump);

    
}
