需要获取 void 或 int 的 Cpp 模板函子

Cpp templates functor that need get void or int

本文关键字:Cpp int 获取 void      更新时间:2023-10-16

如何创建一个 void 或 int 的函子(在模板中(

template <class T>
Int TEMP::operator()(T s)
{
    ...
}

谢谢

可能是不使用模板:

template<class T> int TEMP<T>::operator()(int s)
{
    ...
}
template<class T> int TEMP<T>::operator()()
{
    ...
}