c++ - argument convert in class -


i have following code:

    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;             (int = 0; < size; i++)v.push_back(value[i]);             passdata<std::vector<double>> s = passdata<std::vector<double>>(propertiesid, rvariable,v);             s.setproperties();         } 

the following errors displayed when compiling:

error   7   error c2665: 'kratos::passdata<std::vector<double,std::allocator<_ty>>>::passdata' : none of 2 overloads convert argument types    error   8   error c2512: 'kratos::passdata<std::vector<double,std::allocator<_ty>>>' : no appropriate default constructor available 

could me take @ it?

thanks,

tang laoya

you have constructor

passdata(int id, const kratos::variable<tdatatype>& rvariable, const datatype& value) 

then create passdata object this

passdata<std::vector<double>>(propertiesid, rvariable,v);  

where propertiesid of type indextype (?)

rvariable of type const variable& (it's ok)

v of type std::vector (?)


Comments