[STL] 一段代码中的list merge

      今天在阅读一段代码,代 码中用到了list merge函数。

 void AddModel(MatchIndex idx, const TwoFrameModel &model) {

          assert(idx.first < idx.second);


          if (Contains(idx))
               return;  // already set


          /* Add the model to the hash */
          m_models[idx.first][idx.second] = model;


         std::list tmp;
         tmp.push_back(idx.second);
         m_neighbors[idx.first].merge(tmp);


         // tmp.pop_back();
         tmp.clear();
         tmp.push_back(idx.first);
         m_neighbors[idx.second].merge(tmp);
    }

你可能感兴趣的:(STL)