From 6c5efbfdcef6b8f4bdeb240464661f98787e1c37 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 26 Mar 2019 23:02:32 +0100 Subject: [PATCH] Implement custom vector swap. --- server/TracyVector.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/TracyVector.hpp b/server/TracyVector.hpp index 74bb8c91..61f2f05e 100644 --- a/server/TracyVector.hpp +++ b/server/TracyVector.hpp @@ -1,6 +1,7 @@ #ifndef __TRACYVECTOR_HPP__ #define __TRACYVECTOR_HPP__ +#include #include #include #include @@ -63,6 +64,13 @@ public: 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 size_t size() const { return m_size; }