我的代码是:
std::vector<double> Vec;
template<typename T>
void GetObj(VARIANT &vtProp)
{
CComSafeArray<T> SafeArray;
SafeArray.Attach(vtProp.parray);
ULONG Count = SafeArray.GetCount();
Vec.resize(Count);
for(ULONG Index = 0; Index < Count; Index++)
{
Vec[Index] = SafeArray[Index];
}
}
编译时出现以下错误:
error C2783: 'void __cdecl GetObj(struct tagVARIANT &)' : could not deduce template argument for 'T'
请建议我正确的答案