C++ (Qt)QtConcurrent::mapped(vector, &MyClass::MyMethod, arg)
C++ (Qt)#include <QtCore/QtConcurrentMap>#include <functional> QString MyClass::myMethod(int arg){...}...QtConcurrent::mapped(vector, std::bind1st(std::mem_fun(&MyClass::myMethod), this));
C++ (Qt)QtConcurrent::mapped(vector, std::bind1st(std::mem_fun(&MyClass::myMethod), this));
C++ (Qt)#include <QtConcurrentMap>#include <functional>#include "mainwindow.h"#include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow){ ui->setupUi(this); QVector<int> test; test << 1 << 2 << 3; QtConcurrent::mapped(test, std::bind1st(std::mem_fun(&MainWindow::myMethod), this));} int MainWindow::myMethod(int i){ qDebug() << i; return i;}
2 1 3
C++ (Qt)#include <QtConcurrentMap>#include <tr1/functional> ...QtConcurrent::mapped(test, std::tr1::bind(&MainWindow::myMethod, this, std::tr1::placeholders::_1));
C++ (Qt)int MainWindow::myMethod(int &i)