From 026a27aa05e4850b2708d82a66104fb51948a509 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 19 Oct 2017 20:34:07 +0200 Subject: [PATCH] Implement front() in custom vector. --- server/TracyVector.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/TracyVector.hpp b/server/TracyVector.hpp index 3064cb45..30a3e99a 100644 --- a/server/TracyVector.hpp +++ b/server/TracyVector.hpp @@ -60,6 +60,9 @@ public: T* end() { return m_ptr + m_size; } const T* end() const { return m_ptr + m_size; } + T& front() { assert( m_size > 0 ); return m_ptr[0]; } + const T& front() const { assert( m_size > 0 ); return m_ptr[0]; } + T& back() { assert( m_size > 0 ); return m_ptr[m_size - 1]; } const T& back() const { assert( m_size > 0 ); return m_ptr[m_size - 1]; }