当前位置: 首页>>代码示例>>C++>>正文


C++ ChildList::erase方法代码示例

本文整理汇总了C++中ChildList::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ ChildList::erase方法的具体用法?C++ ChildList::erase怎么用?C++ ChildList::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ChildList的用法示例。


在下文中一共展示了ChildList::erase方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: RemoveChildren

	virtual bool RemoveChildren(SContainer<T>* child)
	{
		if (std::find(children.begin(), children.end(), child)
				!= children.end())
		{
			children.erase(std::find(children.begin(), children.end(), child));
			return true;
		}
		return false;
	}
开发者ID:hearthewarsong,项目名称:htws_engine,代码行数:10,代码来源:scontainer.hpp

示例2: RemoveChild

   void DeltaDrawablePrivate::RemoveChild(DeltaDrawable* child)
   {
      if (!child) return;

      unsigned int pos = GetChildIndex(child);
      if (pos < mChildList.size())
      {
         child->SetParent(NULL);
         child->AddedToScene(NULL);
         mChildList.erase(mChildList.begin() + pos);
      }
   }
开发者ID:VRAC-WATCH,项目名称:deltajug,代码行数:12,代码来源:deltadrawable.cpp

示例3: noDuplicateNodes

// Compares all pairs of children, finding and removing duplicate BTERMs
void noDuplicateNodes( ChildList &l )
{
  //This is shallow!
  //ONLY SAFE WHEN DELETING BTERMS for now (note is prev to Aug 2009)

  // BK Aug 21, 2009: seems to be deep compare and deep delete
  ChildList dups;
  CLIter n1 = l.begin();
  CLIter n2 = ++(l.begin());
  CLIter end = l.end();
  while( n1 != end ){
    //assert((*n1)->t == BTERM);
    while( n2 != end ){
      //Comparison
      if( (*n1)->equals(*n2) ){
	dups.push_back(*n2);
      }
      n2++;
    }
    n1++;
    n2 = n1;
    n2++;
  }

  dups.sort();
  dups.unique();
  
  for(n2 = dups.begin(); n2 != dups.end(); n2++){
    for(n1 = l.begin(); n1 != l.end(); n1++){
      if(*n1 == *n2){
	(*n1)->destroyTree();
	l.erase(n1);
	break;
      }
    }
  }
  dups.clear();
}
开发者ID:yzhai220,项目名称:geopip,代码行数:39,代码来源:SymbolTree.cpp


注:本文中的ChildList::erase方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。