#include <iostream>
#include <string>

using namespace std;


class Movable {
public:
    Movable(const string& name) : m_name(name) { }
    Movable(const Movable& rhs) {
        cout << "Copy constructed from " << rhs.m_name << endl;
    }
    
    Movable(Movable&& rhs) {
        cout << "Move constructed from " << rhs.m_name << endl;
    }
    
    Movable& operator = (const Movable& rhs) {
        cout << "Copy assigned from " << rhs.m_name << endl;
    }
    
    Movable& operator = (Movable&& rhs) {
        cout << "Move assigned from " << rhs.m_name << endl;
    }

private:
    string m_name;
};


int main() {
    Movable obj1("obj1");
    Movable obj2(std::move(obj1));
    obj2 = std::move(obj1);     // For demostration only
    
    const Movable cObj("cObj");
    Movable tObj(std::move(cObj));
    tObj = std::move(cObj);     // For demonstration only
}