From 6e7a28d75414ebe2184cc0e72406e9b7099bcb84 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Mon, 10 Aug 2020 17:20:37 +0200 Subject: [PATCH] Support for swapping in a UniquePtrList. --- src/Memory/UniquePtrList.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Memory/UniquePtrList.hpp b/src/Memory/UniquePtrList.hpp index 28ddc42..5b5ed36 100644 --- a/src/Memory/UniquePtrList.hpp +++ b/src/Memory/UniquePtrList.hpp @@ -46,6 +46,11 @@ namespace ArbUt { _vector[index] = nullptr; return p; } + void Swap(size_t indexA, size_t indexB){ + auto temp = _vector[indexA]; + _vector[indexA] = _vector[indexB]; + _vector[indexB] = temp; + } void Set(size_t index, ValueT* ptr) { delete _vector[index]; _vector[index] = ptr;