【发布时间】:2015-07-19 02:26:47
【问题描述】:
我有以下代码:
template<class TDataType> class PassData
{
public:
PassData(int Id,
const Kratos::Variable<TDataType>& rVariable,
const TDataType& Value) : mId(Id),
mVariable(rVariable),
mValue(Value){}
void SetProperties()
{
mpModeler->SetProperties(mId, mVariable, mValue);
}
int mId;
Kratos::Variable<TDataType> mVariable;
TDataType mValue;
};
...
template<class TDataType>
void SetProperties(IndexType PropertiesId,
const Variable<TDataType>& rVariable,
double* value,int size)
{
std::vector<double> v;
for (int i = 0; i < size; i++)v.push_back(value[i]);
PassData<std::vector<double>> S = PassData<std::vector<double>>(PropertiesId, rVariable,v);
S.SetProperties();
}
编译时出现如下错误:
Error 7 error C2665: 'Kratos::PassData<std::vector<double,std::allocator<_Ty>>>::PassData' : none of the 2 overloads could convert all the argument types
Error 8 error C2512: 'Kratos::PassData<std::vector<double,std::allocator<_Ty>>>' : no appropriate default constructor available
谁能帮我看看?
谢谢,
唐老鸭
【问题讨论】:
标签: c++ constructor arguments converter