1
我有以下的模板类:C++模板类:错误:没有匹配函数调用
template <typename T> class ResourcePool {
inline void return_resource(T& instance) {
/* do something */
};
};
然后,在我的主要功能,我做的:
ResoucePool<int> pool;
pool.return_resource(5);
我得到以下错误:
error: no matching function for call to `ResourcePool<int>::return_resource(int)`
任何想法我做错了什么?