|
Boost Users : |
Subject: Re: [Boost-users] [Intrusive] List Manipulation and Management
From: Freddie Witherden (freddie_at_[hidden])
Date: 2009-09-26 19:17:52
> you cannot treat intrusive lists as values that you can return, this
> is by
> concept. a single value(more precicely: hook) can only be part of one
> intrusive list at a time.
> there are multiple solutions for this, depending on your code.
> passing the
> list by reference to the function, passing an back_insert_iterator as
> OutputIterator etc.
This seems like a reasonable solution. It makes sense as well
considering that I only intended to insert from either the front or
back of the list.
> clear_and_dispose calls a dispose function. but it is user supplied
> and it is
> possible to remove from the list without disposing, but this is
> intentional
> again.
> depending on your use case again, you could
> A *a= new A[1000];
> {
> list<...> l;
> l.push_back(a[500]);
> //more list calls
> }
> delete a;
The node list I was speaking of is actually more of a tree. As some of
the node-subclasses have list members themselves (of course, in Pascal
it is just Node* childList). So it could be quite difficult to flatten.
Regards, Freddie.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net