例如
template<class D, Function>
struct A
{
void foo()
{
D d;
int i = Function(d);
// Here function can be a free function: int fun(D& d)
// or member function: int D::fun()
// or function object:
}
};
如何设置模板参数以灵活选择不同类型的功能?代码可以更改,只要允许灵活性就可以了。谢谢