#include <iostream>
using namespace std;

class Foo;
class Bar;
class Hoge;

class Foo
{
public:
	void func() { cout << "func!" << endl; }
	Foo(int v) { cout << v << endl; }
	Foo() {}
};

class Bar : public Foo
{
public:
	Bar() {}
	Bar(int v) : Foo(v) {}
};

class Hoge
{
public:
	void func() { cout << "Hoge!" << endl; }
};

template <class T>
void call_func(T& t) {
	t.func();
}

int main() {
	Foo foo;
	Bar bar;
	Hoge hoge;
	
	foo.func();
	bar.func();
	hoge.func();
	
	call_func(foo);
	call_func(bar);
	call_func(hoge);
	
	return 0;
}