#include <iostream>
#include <vector>

using namespace std;

class Test {
public:
    Test()             { cout << "Test()\n"; }
    Test(int x):val_(x){ cout << "Test(" << x << ")\n"; }
    Test(const Test& t):val_(t.val_) { cout << "Test(const Test& " << t.val_ << ")\n"; }
    Test(Test&&t)      :val_(t.val_) { t.val_ = 0; cout << "Test(const Test&& " << t.val_ << ")\n"; }
    Test& operator = (const Test& t)  {
        cout << "Test& operator = (const Test& " << t.val_ <<")\n";
        val_ = t.val_;
        return *this;}
    Test& operator = (Test&& t) {
        cout << "Test& operator = (const Test&&" << t.val_ <<")\n";
        val_ = t.val_; t.val_ = 0;
        return *this;}
    ~Test()           { cout << "~Test(" << val_ <<")\n"; }
    int val() const { return val_; }
private:
    int val_ = 0;
};


int main(int argc, char * argv[])
{
    vector<Test> t;
    t.reserve(20);

    for(int i = 0; i < 20; ++i)
    {
        t.emplace_back(i);
    }
}
