Template class with function pointer