Original Post
So one of my projects I'm working on has taken me to the point of requiring a template container class similar to a priority queue, but with the ability to enforce uniqueness of objects stored (so kind of like an inverse map). That is, objects stored might have non-unique keys so that the sort order is actually a set of possible orders, but when inserting an item, a check should first be made to see whether the item already exists or not. Certainly, I could just write a helper function (or friend function) to do this checking and insertion into an STL list, but I was hoping there was already something out there. I'd really prefer to offer the container as a complete class, so an adapter might be appropriate!? Obviously, one possibility is just to design my own template class from scratch. So, to summarise, I need a priority queue that also permits inspection of non-head items, at least internally for member functions. I'm guessing I'm going to have to design/write it myself though. Any thoughts or advice on how to do this efficiently/robustly would be welcome. Cheers, Timkin