From 0b6220b2bfdbe9c952a855bbba4dbc220d4b53f6 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sun, 22 Mar 2020 19:08:38 +0100 Subject: [PATCH] Add Remove function to List, to remove items at a given index. --- src/Collections/List.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Collections/List.hpp b/src/Collections/List.hpp index f913f88..c2a7362 100644 --- a/src/Collections/List.hpp +++ b/src/Collections/List.hpp @@ -59,6 +59,10 @@ namespace Arbutils::Collections { inline void Resize(size_t size) { _vector.resize(size); } inline void Resize(size_t size, ValueT defaultValue) { _vector.resize(size, defaultValue); } + inline void Remove(size_t index){ + _vector.erase(_vector.begin() + index); + } + iterator begin() { return _vector.begin(); } const_iterator begin() const { return _vector.begin(); }