Is there a way in D to have a list that allows you to move around values? I create a cache, and I would like to save the log when the last access to the item, so when compressing the cache or just about overflow, I can delete items that have not been accessed after a while.
I would like to be able to push my back and pop from the front. Notice that I would like to appear in front, not from the back, as I want the oldest items to come out.
I want to be able to search if the item is really in the list. If such a function does not exist, I could alternatively implement it myself; it does not matter.
I would like to be able to switch items around. This allows me when accessing an item in the list, I can return it back to the back, where are the most recent items.
Is there such a function already in D, maybe a better approach to this?
source
share