Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
ant6n
11y ago
0 comments
Share
If you use a std::List<T>, doesn't it uses nodes like
T data p next p previous p owner
anyway? It shouldn't create a pointer to the data, just like a std::vector<T> isn't an array of pointers to T.
0 comments
default
newest
oldest
desdiv
11y ago
Let's say I have a bunch of
Bullet
objects, and each
Bullet
belongs to multiple lists. In that case, std::list<Bullet> doesn't work and I have to use std::list<Bullet*> instead, thus the extra pointer dereference.
SamReidHughes
11y ago
Only without the owner pointer. But intrusive lists don't need an owner pointer either.
j
/
k
navigate · click thread line to collapse