I need a data structure (std preferred) that boasts:
- sorting (upon insertion if possible)
- comparison (by random-access, or member function) to determine if an object already exists in the structure
- ability to retrieve, and remove lead/trailing element
I considered vector, but no real support for sorting exists, but did have the other 2
I also considered priority-queue, but need to have the ability to compare against what is already there.
You can use
std::set.set::find.set::beginiterator and to last element you can useset::rbegin. To remove these elements you can useset::erasemethod.