[Qt-interest] Using boost to bind function for QtConcurrent::run()

Cole, Derek dcole at integrity-apps.com
Tue Jul 12 16:29:33 CEST 2011


Hello,

I am trying to bind a function that requires more than 5 arguments, so that I can use it with QtConcurrent::run()

This line on its own compiles:

 boost::bind(&GDALDriver::CreateCopy,poNITFDriver, pszDstFilename, poDataset, FALSE,  papszOptions, pfnProgress, progMessage);

Where poNITFDriver is an instance of GDALDriver and has a CreateCopy method.

This line fails to compile:

    future = QtConcurrent::run( boost::bind(&GDALDriver::CreateCopy,poNITFDriver, pszDstFilename, poDataset, FALSE,  papszOptions, pfnProgress, progMessage));

with the error message:

error: no match for operator= in future = QtConcurrent::run(FunctionObject) [with FunctionObject = boost::_bi::bind_t<GDALDataset*, boost::_mfi::mf6<GDALDataset*, GDALDriver, const char*, GDALDataset*, int, char**, int (*)(double, const char*, void*), void*>, boost::_bi::list7<boost::_bi::value<GDALDriver*>, boost::_bi::value<const char*>, boost::_bi::value<GDALDataset*>, boost::_bi::value<bool>, boost::_bi::value<char**>, boost::_bi::value<int (*)(double, const char*, void*)>, boost::_bi::value<char*> > >]()

What am I doing wrong here?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110712/70f96c4b/attachment.html 


More information about the Qt-interest-old mailing list