mirror of
https://github.com/wolfpld/tracy.git
synced 2024-09-20 05:42:18 +00:00
Implement custom vector swap.
This commit is contained in:
parent
a632d9e2a3
commit
6c5efbfdce
@ -1,6 +1,7 @@
|
|||||||
#ifndef __TRACYVECTOR_HPP__
|
#ifndef __TRACYVECTOR_HPP__
|
||||||
#define __TRACYVECTOR_HPP__
|
#define __TRACYVECTOR_HPP__
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -63,6 +64,13 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void swap( Vector& other )
|
||||||
|
{
|
||||||
|
std::swap( m_ptr, other.m_ptr );
|
||||||
|
std::swap( m_size, other.m_size );
|
||||||
|
std::swap( m_capacity, other.m_capacity );
|
||||||
|
}
|
||||||
|
|
||||||
tracy_force_inline bool empty() const { return m_size == 0; }
|
tracy_force_inline bool empty() const { return m_size == 0; }
|
||||||
tracy_force_inline size_t size() const { return m_size; }
|
tracy_force_inline size_t size() const { return m_size; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user