// study template
#include <iostream>
template<typename T>
class TFoo{
private:
T val_;
public:
TFoo(){ std::cout << "TFoo" << std::endl; }
};
typedef TFoo<int> Foo;
class Hoge{
public:
Hoge(){ std::cout << "Hoge" << std::endl; }
};
class Factory{
public:
template<typename T>
TFoo<T> create(){ return TFoo<T>(); }
Foo create(){ return Foo(); }
};
int main (int argc, char * const argv[]) {
Factory fac;
TFoo<Hoge> hoge = fac.create<Hoge>();
Foo foo = fac.create();
return 0;
}