Just a simple generic circular buffer. Should fulfill the needs of most simple delaying tasks.
Gets the element from the buffer at the current read index, and increments the read index.
Resize the buffer. If the new size is larger than the max size, the buffer will be reallocated so that size is the new maximum size. It is very inefficient to delete and allocate large amounts of memory like this so it is recommended to give the buffer an initial max size that will never be exceeded.
Assign the buffer element at the current write index to element and increment the write index.