Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-02-04 14:07:00


From: "beatlebum1967" <beatlebum1967_at_[hidden]>
> > 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) )


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