#include <iostream>
using namespace std;

// - templateexample.h
template<typename T> class Example
{
	public:
		Example(){}
		int doWork() {return 42;}
};
// ---------------------------

// - templatespecialization.h
//#include "templateexample.h"
template<> class Example<int>
{
	public:
		Example() : a(0), b(1), c(2), d(3) {} 
		int doWork() {return a+b+c+d;}
		
	private:
		int a;
		int b;
		int c;
		int d;
};
// ---------------------------

// - a.h ---------------------
// #include templateexample.h
class A
{
	public:
		Example<int> returnSmallExample();
};
// - a.cpp -------------------
Example<int> A::returnSmallExample() {return Example<int>();}
// ---------------------------

// - main.cpp ---------------
// #include "a.h"
// #include "templatespecialization.h"
int main()
{
	A a;
	Example<int> test = a.returnSmallExample();
	std::cout<<test.doWork()<<std::endl;
}