【发布时间】:2015-03-07 22:52:58
【问题描述】:
我用qhash的qhash写了一个函数,如下图:
void scanOccurenceOnAllSequence(QString motif, QString chkMotif, qint32 offset, QString cell, QHash <QString, QHash <QString, QHash<qint32, qint32> > > *motifByCell2seq, QList<QString> *peakSequence){
qint32 peakSequenceNumber = peakSequence->size();
for(qint32 si=0; si < peakSequenceNumber; si++){
if( motifByCell2seq->value(motif).value(cell).contains(si) || motifByCell2seq->value(motif).value(cell).contains(si) ){
continue;
}
bool flag = checkMotifOccurence(motif,chkMotif,peakSequence->at(si),offset);
if(flag){
motifByCell2seq->value(motif).value(cell).insert(si,1);
}
}
}
但是,这一行有一个错误:
motifByCell2seq->value(motif).value(cell).insert(si,1);
错误是:
错误:将 'const QHash' 作为 'QHash::iterator QHash::insert(const Key&, const T&) [with Key = int; 的 'this' 参数传递T = int]' 丢弃限定符 [-fpermissive] motifByCell2seq->value(motif).value(cell).insert(si,1);
即使我把这行改成下面的,还是有错误
motifByCell2seq[motif][cell].insert(si,1);
你能帮我找出问题吗?
【问题讨论】: