本文整理汇总了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;
}
示例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);
}
}
示例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();
}