#include <iostream>
struct hoge {
};
int main(){
std::unique_ptr<hoge> a;
std::cout << a << std::endl; // a is empty
a.reset(new hoge());
std::cout << a << std::endl; // a is not empty
std::unique_ptr<hoge> b;
std::cout << b << std::endl; // b is empty
b = std::move(a);
// b = a; won't work.
// error: object of type ... cannot be assigned because its copy assignment operator is implicitly deleted
// note: copy assignment operator is implicitly deleted because ... has a user-declared move constructor
std::cout << a << std::endl; // a is empty
std::cout << b << std::endl; // b is not empty
}