Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2004-03-30 19:34:24


Anders Sundman <d00-asu_at_[hidden]> writes:

> Hi all!
>
> I'm using the lambda library to compute the sum of squared
> differences, but I have encountered a puzzling problem. I would
> really appreciate if someone could explain it to me.
>
> This doesn't compile:
>
> std::inner_product(i1, i1+x, i2, 0.0,
> (_1 + _2), (_1*_1)(_1 - _2));
>
> however, this does:
>
> std::inner_product(i1, i1+x, i2, 0.0,
> std::plus<double>(), (_1*_1)(_1 - _2));
                                ^^^^^^^^ ^

Doesn't seem right. Do you really mean to invoke the function call
operator on the result of _1*_1 ??

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net