Boost logo

Boost Users :

Subject: Re: [Boost-users] [Bind][Lambda] Processing containers of pointers
From: Peter Dimov (pdimov_at_[hidden])
Date: 2010-03-24 12:49:42


Robert Jones wrote:
> On Wed, Mar 24, 2010 at 11:39 AM, Peter Dimov <pdimov_at_[hidden]> wrote:
>
>> Robert Jones wrote:
>>
>>> Hi All
>>>
>>> I believe boost.bind has the capability to look through pointers and
>>> smart
>>> pointers to
>>> transparently process the pointed-to objects. Does boost.lambda.bind
>>> also
>>> have this
>>> capability?
>>>
>>
>> No, but you should be able to use bind( &A::f, *_1 ) for that.
>
> Which I imagine passes by value?

It should pass by reference.

You could also use bind( mem_fn( &A::f ), _1 ), if you like that better.
This is what boost::bind does under the hood, more or less.


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