From: Maxim Yegorushkin (maxim.yegorushkin_at_[hidden])
Date: 2005-08-04 10:03:47
[multi_index] feature request
In my code I often use collections of noncopyable objects and yet I need
them indexed. The usual solution is to store pointers to the objects in the
index (be it a std::set/map or boost::multi_index). This leads to two
allocations: the first for the object and the second for the index node.
it would be more natural and effective to embed the index node in the
that the container is obviated from allocating nodes and only maintains
indexes. This also would make all container operations nothrow, since
insertion and removal requires only node pointer manipulations and using
comparer object which is typically nothrow.
In my work I use my own intrusive_list which has proved itself quite
effective. The syntax is:
typedef intrusive_list<noncopyable_object> list;
: list::node // embed the list node in the class
Will such a feature ever make it to multi_index?
-- Maxim Yegorushkin <firstname.lastname_at_[hidden]>