Vladimir Prus <[EMAIL PROTECTED]> writes: > I'm in a need of a container, which: > > - is sorted > - has iterators which are not invalidated on > 'insert' > - keeps no more than k elements. If more elements are > inserted, the smallest ones should be erased. > > > I'm considering writing a wrapper over std::multiset for this purpose. > But before I start, I wanted to ask if anybody knows existing solution.
If you don't really need iterator stability, and pointer/reference stability works instead, you might use a bounded heap of pointers to items stored in a deque. -- David Abrahams [EMAIL PROTECTED] * http://www.boost-consulting.com Boost support, enhancements, training, and commercial distribution _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost