QtConcurrent::map segmentation fault
问题 When I have been trying to implement "parallel for" using QtConcurrent::map: QFuture<void> parForAsync(size_t n, std::function<void (size_t)> Op) { size_t nThreads = static_cast<size_t>(QThreadPool::globalInstance()->maxThreadCount()); size_t nn = n/nThreads + 1; using Sequence = QVector<std::function<void()>>; Sequence vFuns; for(size_t i = 0; i < n; i+=nn) { size_t firstIdx = i, lastIdx = i + nn > n ? n : i + nn; vFuns.push_back([=]()->void { for(size_t i = firstIdx; i < lastIdx; ++i) { Op