|
Boost Users : |
Subject: Re: [Boost-users] Help with a boost::lambda problem and boost::array?
From: Max (loadcom_at_[hidden])
Date: 2009-01-21 20:10:10
Hello Rob,
Without testing, I don't think your version will get things better.
B/Rgds
Max
From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Robert Jones
Sent: Thursday, January 22, 2009 6:20 AM
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] Help with a boost::lambda problem and
boost::array?
On Wed, Jan 21, 2009 at 9:34 PM, <jesseperla_at_[hidden]> wrote:
Does anyone have an idea why the following doesn't compile:
using lambda::_1;
using lambda::_2;
boost::function<double (const boost::array<double, 2>&)> f =
lambda::ret<double>(_1[0] * _1[1]);
I'm not sure about this, but you might try
boost::function<double (const boost::array<double, 2>&)> f =
lambda::ret<double>( var(_1)[0]*var(_1)[1] );
Also, I don't know if you need the ret<double> bit.
Cheers
Rob.
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