I have a generic function:
void ImageAlbum::ExpressButtonPressed(
boost::function<
void (
thumb::PhotoPrintThumbnail*,
thumb::PhotoPrintFormat,
thumb::PhotoPrintQuantity
)
> memberToCall
) {
...
BOOST_FOREACH(thumb::PhotoPrintThumbnail *pThumbnail, m_thumbs.GetSelected()) {
memberToCall(
pThumbnail,
m_expressSel.GetSelectedFormat(),
m_expressSel.GetSelectedQuantity()
);
}
...
}
I can successfully call:
ExpressButtonPressed(boost::bind(&thumb::PhotoPrintThumbnail::AddQuantity, _1, _2, _3));
Then, instead of adding a quantity of a certain format to a thumbnail, I need to replace them all with a single format. More precise, with a list of 1 element, like that:
ExpressButtonPressed(
boost::lambda::bind(
&thumb::PhotoPrintThumbnail::SetFormats,
_1,
boost::lambda::bind(
boost::lambda::constructor<thumb::PhotoPrintThumbnail::LoadedFormats>(),
1,
boost::lambda::bind(
boost::lambda::constructor<thumb::PhotoPrintThumbnail::LoadedFormat>(),
_2,
_3
)
)
)
);
Which results in "boost/lambda/detail/actions.hpp(96) : error C2665: 'boost::lambda::function_adaptor::apply' : none of the 2 overloads could convert all the argument types".
What am I doing wrong here?
BTW
class PhotoPrintThumbnail {
public:
...
typedef std::pair<PhotoPrintFormat, PhotoPrintQuantity> LoadedFormat;
typedef std::list<LoadedFormat> LoadedFormats;
void SetFormats(const LoadedFormats &formats);