5 ms·
The point of intrusive lists is to allow access to the link when you provide only the contained object. The way you're thinking of would theoretically work, bu
by mihai_ionic 13y ago
The point of intrusive lists is to allow access to the link when you provide only the contained object.
The way you're thinking of would theoretically work, but you'd have to make sure the compiler isn't adding fancy padding that would break your pointer manipulation and type casting.
boost::intrusive::list on the other hand, works in a type-safe manner by having your class either inherit a list hook, or provide it as member and then pass the list implementation a member pointer as template parameter so that it can be accessed.