Boost logo

Boost :

From: beatlebum1967 (beatlebum1967_at_[hidden])
Date: 2002-02-04 19:41:22


--- In boost_at_y..., "Peter Dimov" <pdimov_at_m...> wrote:
> From: "beatlebum1967" <beatlebum1967_at_y...>
> > > You need to use boost::bind. Replace the bind2nd() expression
with:
> > >
> > > boost::bind(&CSwarmDownloadManagerFileFragmentInfo::Test, _1,
val)
> > >
> > > mem_fn works with shared_ptr's, but bind2nd doesn't know
this. ;-)
> >
> > Thanks buddy! One question though, I could get the passed
parameter
> > to work with methods that expect references. Is there something
else
> > I need to do in this case?
>
> To pass 'val' by reference, you need
>
> boost::bind( &CSwarmDownloadManagerFileFragmentInfo::Test, _1,
> boost::ref(val) )

Thanks very much Peter! This idiom will greatly simplify my code
base. I really appreciate your help.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk