no matching function for call to object map(*it);

2019-09-03 09:36发布

I am trying to make a call to a function multiple times but parallelize them using QtConcurrent::mapped

But I am not able to over come the error:

error: no matching function for call to object of type 'addWrapper'
        *result = map(*it);
                  ^~~

The code is as follows:

struct addWrapper {
    loadbook *instance;
    typedef QString result_type;
    addWrapper(loadbook *lBook) : instance(lBook) {}
    QString operator()(QString &item) {
        instance->decrypt->decryptFile(item,'A');
    }
};

addWrapper wrapper(this);

QFuture<QString> returnContent = QtConcurrent::mapped(fileList,wrapper);

0条回答
登录 后发表回答