Boost logo

Boost Users :

Subject: Re: [Boost-users] Help with a boost::lambda problem and boost::array?
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2009-01-21 17:19:39


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