#include <iostream>
#include <memory>
using namespace std;

class CMother
{
private:
	void _CommonStuff()
	{
		cout << "work common to children" << endl;
	}
	
	virtual bool _Compute() = 0;
public:
	bool Compute()
	{
		_CommonStuff();
		_Compute();
	}
};

class C1 : public CMother
{
private:
	virtual bool _Compute() override
	{
		cout << "work specific to C1" << endl;
		
		return true;
	}
};

class C2 : public CMother
{
private:
	virtual bool _Compute() override
	{
		cout << "work specific to C2" << endl;
		
		return true;
	}
};

int main() {
	
	unique_ptr<CMother> c1(new C1);
	unique_ptr<CMother> c2(new C2);
	
	c1->Compute();
	c2->Compute();
	
	return 0;
}