double sum = std::accumulate(
values.begin(),
values.end(),
0.f,
[&](float sum, float x){ return diffSquaredSum(sum,x);}
);
bind
is only rarely useful. Prefer lambdas, they are easier to write and read.
You could instead get fancy with binding, but why?