c_cpp std :: map和std :: set

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp std :: map和std :: set相关的知识,希望对你有一定的参考价值。

// checking for duplicates
std::set<label> controlPointSet;
auto ret = controlPointSet.insert(p);
if(ret2.second != true)
{
    // p is a duplicate
}

// checking if already in other set
auto ret = boundaryPointSet.find(p);
if(ret != boundaryPointSet.end())
{
  // p is in boundaryPointSet
}

// checking if alread in map
auto iter = interiorPatchPointGlobalLocalMap.find(i_global);
if(iter != interiorPatchPointGlobalLocalMap.end())
{
    // the key i_global is in the map
    // access the corresponding value:
    label i_interior_local = iter->second;
    ...
}

以上是关于c_cpp std :: map和std :: set的主要内容,如果未能解决你的问题,请参考以下文章