From d7446df11d14f2d83d2d3313f918a434373a63e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Mon, 17 Feb 2020 10:38:08 +0100 Subject: Add documentation to memory_heap.h --- src/memory_heap.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/memory_heap.h b/src/memory_heap.h index d90c50c..3f0105a 100644 --- a/src/memory_heap.h +++ b/src/memory_heap.h @@ -34,6 +34,12 @@ // is a vector to handle the case when for some reason we need more memory // than initially anticipated. Instead of throwing errors and giving up, we can // then at least allocate new memory and just hope for the best. +// +// The members add, get, remove correspond to new, dereference, delete. Thus, we +// first add an object and this gives us and index. With this index we can then +// retrieve the object until we remove it. As soon as it is removed, you shouldn't +// use the index anymore to retrieve it (similarly, as you shouldn't use a pointer +// after calling delete on it). template class MemoryHeap { -- cgit v1.2.3