Hi all!
I get the following error while trying to compile this code
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_numeric.h:116: error: must use .* or ->* to call pointer-to-member function in `__binary_op (...)'
I am quite stunned because I've used before in a similar way
Can any body give me a hint?
Thank you in advance!
int main(void)
{
// things happening
std::vector< std::vector<double> > values(3, std::vector<double>());
// fill values in values vector
doIt(values);
}
void doIt(const std::vector< std::vector<double> > &values )
{
// things happening
double e = sqrt(std::accumulate(values[0].begin(), values[0].end(), 0.0, accumSq))/values[0].size();
// things happening
}
double accumSq(double sum_so_far, double x)
{
return sum_so_far + x*x;
}