Become a fan of Slashdot on Facebook


Forgot your password?

Comment Re:Oh god so what? (Score 1) 193

Good luck with your typedefs:

template<typename Range>
double mean(const Range& range)
  double sum = 0.0; int count = 0;
  for(auto& v : range) {
    sum += v;
  return sum/count;

Be careful when a loop exits to the same place from side and bottom.