就地数组上的QT并发映射()

就地数组上的QT并发映射(),qt,qtconcurrent,qvector,Qt,Qtconcurrent,Qvector,我有大量的浮子。 我想对其调用QtConcurrent::map(),并在适当的位置更改值 我可以在不复制阵列的情况下执行此操作吗? 似乎map()将QVector作为参数,我无法找到从数组中初始化QVector而不复制的方法。QtConcurrent也有带有STL风格迭代器的版本。为此,原始指针具有STL风格迭代器的属性 float x[] = {1.3f, 2.5f, 4.6f}; QFuture<void> f = QtConcurrent::map(x, x+3, [](fl

我有大量的浮子。 我想对其调用
QtConcurrent::map()
,并在适当的位置更改值

我可以在不复制阵列的情况下执行此操作吗?
似乎
map()
QVector
作为参数,我无法找到从数组中初始化
QVector
而不复制的方法。

QtConcurrent也有带有STL风格迭代器的版本。为此,原始指针具有STL风格迭代器的属性

float x[] = {1.3f, 2.5f, 4.6f};
QFuture<void> f = QtConcurrent::map(x, x+3, [](float & a) { a = 2*a; });
f.waitForFinished();
qDebug() << x[0] << x[1] << x[2];
2.6 5 9.2