mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Implement tracy::Vector::erase().
This commit is contained in:
parent
f39c2d5e70
commit
84052c622f
@ -98,6 +98,21 @@ public:
|
|||||||
return m_ptr + dist;
|
return m_ptr + dist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
T* erase( T* begin, T* end )
|
||||||
|
{
|
||||||
|
assert( begin >= m_ptr && begin <= m_ptr + m_size );
|
||||||
|
assert( end >= m_ptr && end <= m_ptr + m_size );
|
||||||
|
assert( begin <= end );
|
||||||
|
|
||||||
|
const auto dist = end - begin;
|
||||||
|
if( dist > 0 )
|
||||||
|
{
|
||||||
|
memmove( begin, end, ( m_size - ( end - m_ptr ) ) * sizeof( T ) );
|
||||||
|
m_size -= dist;
|
||||||
|
}
|
||||||
|
return begin;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void AllocMore()
|
void AllocMore()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user