I am trying to combine different number of vector<double>
variables into a vector< vector<double> >
. I try to use cstdarg
library. It throws out
error: cannot receive objects of non-trivially-copyable type ‘class myvectortype’ through ‘...’;
where
typedef vector< double > myvectortype; typedef vector< myvectortype > datavectortype;
Here is the definition of the function
datavectortype ExtractData::GetPixelData(int num, ...)
{
datavectortype data_temp;
va_list arguments;
va_start (arguments, num);
for(int i = 0; i<num; i++)
{
data_temp.push_back(va_arg ( arguments, myvectortype));
}
va_end ( arguments );
return data_temp;
}
What could be done to fix this, thanks.