From e34f60a8ac741579405a1ddda4d6a2b712498381 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Wed, 22 Apr 2020 13:22:20 +0200 Subject: [PATCH] Return previous value from Set function. --- src/Collections/List.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Collections/List.hpp b/src/Collections/List.hpp index 20bb22d..5e70d63 100644 --- a/src/Collections/List.hpp +++ b/src/Collections/List.hpp @@ -52,7 +52,9 @@ namespace Arbutils::Collections { throw std::logic_error(ss.str()); } #endif + auto prev = _vector.at(index); _vector[index] = value; + return prev; } inline bool Contains(const ValueT& value) const {