我有以下的模板类如何与出默认的构造函数另一个类
template <typename threadFuncParamT >
class ThreadPool
{
// number of threads to be launced initially and added to thread pool.
ThreadPool(pThreadFunc pFunction, RtsInt16_t minThreads, RtsInt16_t maxThreads, RtsInt16_t maxExecCount);
};
现在我想用另一个类
struct myStruct
//...
};
class MyClass
{
private:
ThreadPool<myStruct *> pool;
};
我的问题是对象如何创建创建模板类ThreadPool
与MyClass构造函数中的构造函数参数,因为我没有默认的构造函数?
尽管你最近编辑过,你的问题仍然不清楚,因为你仍然没有解释你指的是缺少默认构造函数的类。这就是为什么我必须回答我看到的两种可能性。 – sbi