|
Boost Users : |
Subject: Re: [Boost-users] Using a shared_ptr in a boost::function definition?
From: Igor R (boost.lists_at_[hidden])
Date: 2009-05-04 09:08:03
> void setCompleteFunction(boost::function< void (int errorCode, const string
> &data, HeaderMapPtr headers) > f);
>
> I try to bind to it: -
>
> wc->setCompleteFunction(boost::bind(&NetworkEventHandler::receiveSkinDownloadResult,
> this, _1, _2, _3, wc,myFile, filename.str(), carId, crc, networkPlayerId));
The boost::function you have to pass as a parameter gets 3 parameters.
If you want to "delay" passing all the 3 params, you create the
following binder:
bind(&NetworkEventHandler::receiveSkinDownloadResult, this, _1, _2, _3);
If you want to bind some of params, you can do it like this:
bind(&NetworkEventHandler::receiveSkinDownloadResult, this,
knownErrorCore, _1, _2);
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