I am currently using an std::set<uintptr_t> list to store unique pointers in it. This list gets bigger with the time and when this list reaches x amount of entries it should delete the first entry, the other entries should move down one and make room for a new entry.
For example:
if (list.count >= 20)
{
list.remove[0]; //remove the first entry from the list?
}
I know this code doesn't work but just for the logic so you know what I mean. Also the first entry would be empty then, would it be possible to move all other entries one down so the [0] entry isn't empty anymore?
std::set::eraseuintptr_tfor pointers? Pointers to what? Why aren't you using actual pointers instead of an integer type (uintptr_tis an integer type, large enough to also hold pointer values)? That has a definite bad smell about it.