次の Qt コードがありますnext()
。私はコードを調べましたがQtConcurrent
、なぜ失敗したのかは明らかではありません。
namespace {
std::tuple<QString, std::exception_ptr> test( const int& data ) {
return std::make_tuple( QString(), std::exception_ptr() );
}
}
void
start() {
QVector<int> downloadList;
downloadList.push_back( 1 );
downloadList.push_back( 2 );
auto future = QtConcurrent::mapped( downloadList, test );
QFutureIterator<std::tuple<QString, std::exception_ptr>> it( future );
while( it.hasNext() ) {
auto& tuple = it.next();
}
}
失敗するポイントは次のとおりです。
const T *pointer() const
{
if (mapIterator.value().isVector())
-> return &(reinterpret_cast<const QVector<T> *>(mapIterator.value().result)->at(m_vectorIndex));
else
return reinterpret_cast<const T *>(mapIterator.value().result);
}
アップデート:
の同じクラッシュQFuture::const_iterator
。
ノート:
私がGDBを信じることができれば、this
でQVector::at
ある0x0
。mapIterator.value().result
それから私はすでに であると仮定しますnullptr
、なぜ、私にはわかりません。