|
Boost Users : |
Subject: Re: [Boost-users] Help with a boost::lambda problem and boost::array?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-01-22 21:52:25
AMDG
Max wrote:
> I don't know why this version works
>
> std::vector<Real> vec(2);
> vec[0] = 1; vec[1] = 2;
> boost::function<Real (std::vector<Real>)> vec_f = _1[0]; //Returns
> the 0'th element.
> boost::function<Real (std::vector<Real>)> vec_f1 = _1[0] * _1[1];
>
> but this one doesn't.
>
> std::vector<Real> vec(2);
> vec[0] = 1; vec[1] = 2;
> boost::function<Real (const std::vector<Real>&)> vec_f = _1[0];
> //Returns the 0'th element.
> boost::function<Real (const std::vector<Real>&)> vec_f1 = _1[0] *
> _1[1];
>
The handling of const is wrong in
boost/lambda/detail/operator_return_type_traits.hpp
The containers start on line 894.
In Christ,
Steven Watanabe
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