本文整理汇总了C++中AlignedArray::pop_back方法的典型用法代码示例。如果您正苦于以下问题:C++ AlignedArray::pop_back方法的具体用法?C++ AlignedArray::pop_back怎么用?C++ AlignedArray::pop_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AlignedArray
的用法示例。
在下文中一共展示了AlignedArray::pop_back方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: erase
// ------------------------------------------------------------------------
void erase(const int ID)
{
assert(ID > -1);
assert((unsigned int)ID < (unsigned int)m_contents_vector.size());
delete ( TYPE *) m_contents_vector[ID];
#ifdef USE_ALIGNED
const unsigned int amount = (unsigned int)m_contents_vector.size();
for(unsigned int i=ID; i<amount-1; i++)
{
m_contents_vector[i]=m_contents_vector[i+1];
}
m_contents_vector.pop_back();
#else
m_contents_vector.erase(m_contents_vector.begin()+ID);
#endif
} // erase
示例2: remove
/**
* Removes without deleting
*/
void remove(TYPE* obj)
{
for(unsigned int n=0; n<(unsigned int)m_contents_vector.size(); n++)
{
TYPE * pointer = m_contents_vector[n];
if(pointer == obj)
{
#ifdef USE_ALIGNED
const unsigned int amount =
(unsigned int)m_contents_vector.size();
for(unsigned int i=n; i<amount-1; i++)
{
m_contents_vector[i]=m_contents_vector[i+1];
}
m_contents_vector.pop_back();
#else
m_contents_vector.erase(m_contents_vector.begin()+n);
#endif
return;
}
} // for n < size()
} // remove