Well...
Actually, return from boost::bind is a function object(functor) and QtConcurrent::map() accept such functor's. Boost is heavy, complex library, so I'm personally prefer not to use it when I can. So, take a look on documentation on functor's - maybe you can live without the boost.
But if you have to...
you use boost:bind() to transform your function to a function that takes only one argument and pass result to QtConcurrent::map():
void doSomething
(QString &filename,
int value
) {
}
void doSomething(QString &filename, int value)
{
}
To copy to clipboard, switch view to plain text mode
QList<QStrings> list = ...
QFuture<void> future = QtConcurrent::map(list, boost::bind(doSomething, 10));
QList<QStrings> list = ...
QFuture<void> future = QtConcurrent::map(list, boost::bind(doSomething, 10));
To copy to clipboard, switch view to plain text mode
Bookmarks