c++ - could not deduce template argument for 'T' -


my code :

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];     } } 

while compilation got error below:

error c2783: 'void __cdecl getobj(struct tagvariant &)' : not deduce template argument 't' 

kindly suggest me correct answer

there nothing in function template's signature allows compiler deduce template type, need explicit:

getobj<theactualtype>(arg); 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

html - Repeat image to extend header to fill screen -

javascript - Backbone.js getting target attribute -