#include <iostream>
#include <memory>

using namespace std;

class Goo {
public:
	~Goo() { cout << "dest " << reinterpret_cast<long>(this) << endl; }
};

//chcemy dac mozliwosc kopiowania, kopia jest kopią płytką składowej g_
class Foo {
public:
	Foo() : g_(new Goo) {}
	Foo(const Foo& f) {}
	~Foo() {}
private:
	unique_ptr<Goo> g_;
};

//chcemy dać możliwość kopiowania!
class Foo2 {
public:
	Foo2() : g_(new Goo) {}
	Foo2(const Foo2& f) : g_(f.g_) {}
	~Foo2() {}
private:
	shared_ptr<Goo> g_;
};


int main() {
	Foo2 f1 ,f2;
	Foo2 f3 = f1;
    return 0;
}
