4 ms·
Perhaps I'm being dumb, but doesn't std::list<T> already do exactly this? From SGI's STL docs: "A list is a doubly linked list. That is, it is a Sequence that
by mpyne 14y ago
Perhaps I'm being dumb, but doesn't std::list<T> already do exactly this?
From SGI's STL docs:
"A list is a doubly linked list. That is, it is a Sequence that supports both forward and backward traversal, and (amortized) constant time insertion and removal of elements at the beginning or the end, or in the middle"
- malkia 14y agoAs others have said - yes, as long as you keep the iterator not the object itself. e.g. from T itself you cannot find where it was stored, so with std::list<something>, and then only from something you can't find where it is (you can have to look for it in the list).