Currently I am using vector of classes data structure for objects, but I believe that is not very efficient for performance issue. I commonly perform searches in vector for particular objects so it kind-of gets slow, when there are a lot of objects.
Share
If your
vectoris ordered binary searches with upper_bound and lower_bound are going to perform very good. If your vector is not ordered and objects are inserted often (which would imply reordering it or copying a lot of elements to preserve the order) a map or unordered_map is a very good search structure.However, all those are general purpose solutions and there might be more efficient solutions depending on your specific use case (insert often, remove often, size critical).
But you should definitely profile your application first to make sure you are not optimizing the wrong part.