【发布时间】:2010-07-03 20:40:15
【问题描述】:
嗨,
template <typename T>
class testing
{
public:
template <typename R>
testing()
{
// constructor A
}
template <typename R>
testing(const R&)
{
// constructor B
}
};
调用构造函数A的语法是什么?
我需要在构造函数调用期间传递类型。有没有办法调用它?构造函数 B 是一种解决方法,因为我只需要知道类型而不是整个对象。
谢谢,
斯蒂芬
【问题讨论】:
-
抱歉重复,因为我不知道该搜索什么。感谢楼下各位的回复。
-
这就是搜索的问题:当您不知道限定问题的术语时,很难搜索...