
26 Sep
2009
26 Sep
'09
10:49 p.m.
Am Saturday 26 September 2009 20:18:58 schrieb Freddie Witherden:
Node* afunction(...); [...] Node* tail; link(tail, afunction(...));
This is rather nice as in O(1) you can append a returned list to your current list. However, I am unsure how I would accomplish this in Boost Intrusive.
list.splice(list.end(),otherlist); boost.intrusive represents the nodes as STL-like containers, if you need to port code that handles nodes directly you might be interested in *list_algorithms of boost.intrusive, but I'd recommend using the containers.
Secondly, when dealing with heap allocated items, which need to be deleted, the current code uses a while loop to call each nodes destructor. What is the intrusive equivalent?
clear_and_dispose()