
29 Jan
2009
29 Jan
'09
4:53 p.m.
On Thu, Jan 29, 2009 at 4:06 PM, MichaĆ Nowotka
Ok, i now I've corrected my method to:
double evaluate(const vector<double>& win_probabls) { return accumulate (win_probabls.begin(), win_probabls.end(), 0, lambda::_1 + lambda::bind(log, lambda::_2) ); }
what I'm doing wrong?
There is one thing - change the 0 in the accumulate to 0.0, otherwise the accumulator is typed as an integer. That's the source of the C4244 warning, and will also result in the wrong answer being returned. Stuart Dootson