mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Add non-empty version of push_next() to Vector.
This commit is contained in:
parent
d262ca53ea
commit
159cf8c477
@ -114,6 +114,7 @@ public:
|
||||
tracy_force_inline void push_back_non_empty( const T& v )
|
||||
{
|
||||
assert( m_capacity != MaxCapacity() );
|
||||
assert( m_ptr );
|
||||
if( m_size == CapacityNoNullptrCheck() ) AllocMore();
|
||||
new(m_ptr+m_size) T( v );
|
||||
m_size++;
|
||||
@ -143,6 +144,15 @@ public:
|
||||
return m_ptr[m_size++];
|
||||
}
|
||||
|
||||
tracy_force_inline T& push_next_non_empty()
|
||||
{
|
||||
assert( m_capacity != MaxCapacity() );
|
||||
assert( m_ptr );
|
||||
if( m_size == CapacityNoNullptrCheck() ) AllocMore();
|
||||
new(m_ptr+m_size) T();
|
||||
return m_ptr[m_size++];
|
||||
}
|
||||
|
||||
tracy_force_inline T& push_next_no_space_check()
|
||||
{
|
||||
assert( m_capacity != MaxCapacity() );
|
||||
|
Loading…
Reference in New Issue
Block a user