[ create a new paste ] login | about

Link: http://codepad.org/isjE5LKn    [ raw code | output | fork ]

C++, pasted on Mar 8:
#include <iostream>

template <class T> struct Hoge
{
	void func(void)
	{
		std::cout << "Hoge<T>::func" << std::endl;
	}
};

template <class T> struct Hoge< Hoge<T> >
{
	void func(void)
	{
		std::cout << "Hoge< Hoge<T> >::func" << std::endl;
	}
};

int main(void)
{
	Hoge<int>().func();

	Hoge< Hoge<int> >().func();

	return 0;
}


Output:
1
2
Hoge<T>::func
Hoge< Hoge<T> >::func


Create a new paste based on this one


Comments: