|
Boost Users : |
Subject: Re: [Boost-users] Help with a boost::lambda problem and boost::array?
From: Max (loadcom_at_[hidden])
Date: 2009-01-22 20:51:52
> >
> > I've tested with this, but didn't work, neither.
> >
> > typedef boost::array<double, 2> array_t; boost::function<double (const
> > array_t&)> 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<double, 2> array_t; boost::function<double (const
array_t&)> f
= lambda::bind(std::multiplies<double>(),
lambda::bind(&array_t::operator[], lambda::_1, 0),
lambda::bind(&array_t::operator[], lambda::_1, 1));
?
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