Help with a boost::lambda problem and boost::array?

Does anyone have an idea why the following doesn't compile:
using lambda::_1;
using lambda::_2;
boost::function

On Wed, Jan 21, 2009 at 9:34 PM,
Does anyone have an idea why the following doesn't compile: using lambda::_1; using lambda::_2; boost::function
&)> f = lambda::ret<double>(_1[0] * _1[1]);
I'm not sure about this, but you might try
boost::function

Hello Rob,
Without testing, I don't think your version will get things better.
B/Rgds
Max
From: boost-users-bounces@lists.boost.org
[mailto:boost-users-bounces@lists.boost.org] On Behalf Of Robert Jones
Sent: Thursday, January 22, 2009 6:20 AM
To: boost-users@lists.boost.org
Subject: Re: [Boost-users] Help with a boost::lambda problem and
boost::array?
On Wed, Jan 21, 2009 at 9:34 PM,

Hello jesse
I've tested with this, but didn't work, neither.
typedef boost::array

AMDG Max wrote:
Hello jesse
I've tested with this, but didn't work, neither.
typedef boost::array
array_t; boost::function f = lambda::bind(std::multiplies<double>(), lambda::bind(&array_t::operator[] const, lambda::_1, 0), lambda::bind(&array_t::operator[] const, lambda::_1, 1)); why?
Because this: &array_t::operator[] const is not legal syntax. In Christ, Steven Watanabe

I've tested with this, but didn't work, neither.
typedef boost::array
array_t; boost::function f = lambda::bind(std::multiplies<double>(), lambda::bind(&array_t::operator[] const, lambda::_1, 0), lambda::bind(&array_t::operator[] const, lambda::_1, 1)); why?
Because this:
&array_t::operator[] const
is not legal syntax.
In Christ, Steven Watanabe
Thanks.
Then how about
typedef boost::array

AMDG jesseperla@gmail.com wrote:
Does anyone have an idea why the following doesn't compile: using lambda::_1; using lambda::_2; boost::function
&)> f = lambda::ret<double>(_1[0] * _1[1]);
It probably fails because Boost.Lambda doesn't know how to find the return type of the subscript operator for boost::array. In Christ, Steven Watanabe

Is there a solution?
Does anyone have an idea why the following doesn't compile: using lambda::_1; using lambda::_2; boost::function
&)> f = lambda::ret<double>(_1[0] * _1[1]); It probably fails because Boost.Lambda doesn't know how to find the return type of the subscript operator for boost::array.
In Christ, Steven Watanabe

Is there a solution?
Does anyone have an idea why the following doesn't compile: using lambda::_1; using lambda::_2; boost::function
&)> f = lambda::ret<double>(_1[0] * _1[1]); It probably fails because Boost.Lambda doesn't know how to find the return type of the subscript operator for boost::array.
In Christ, Steven Watanabe
Let me answer my question:
the 'bind' version that works well:
typedef boost::array
participants (5)
-
jesseperla@gmail.com
-
loadcom@sina.com
-
Max
-
Robert Jones
-
Steven Watanabe