
David Abrahams <dave <at> boostpro.com> writes:
on Sat Nov 01 2008, JOAQUIN M. LOPEZ MUÑOZ <joaquin-AT-tid.es> wrote:
Actually, MultiIndex could give me *almost* everything I need by threading a singly-linked list through the hash nodes (instead of doubly-linked). That's enough for a FIFO queue.
You can do that with Boost.Intrusive, and that will indeed save you one pointer per node as compared with the Boost.MultiIndex-based solution. If you're resorting to manually combining a hash_map and a slist<pointer> then you'd begaining nothing, as in the hash_map+ deque<pointer> case described in my previous post.
[...]
I handn't looked at Boost.Intrusive before. While it looks interesting, it seems pretty complicated and I can't quite see any point in using it when I could just use Boost.Unordered with a value_type that holds an additional pointer. Maybe I'm missing something; I don't know.
Of course anything you can do with Boost.Intrusive (or any other lib) you can do without. For such a simple thing as a forward_list you might not want to incur the cost of learning a new library. In my opinion, however, Boost.Intrusive really pays off. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo