I've need a solution, which will store a non unique key - values pairs. I don't want to repeat keys (space efficiency) and I want to focus on lookup speed (efficiency of inserting a new data is less important). I will use std::multimap here. But I will have to lookup for keys, which meets some range criteria.
The most complex example: Key is a string, values are not important. I'd like to find out all values, which keys starts with "Lol". Or I'd like to find out all values, which keys "are between" "bar" and "foo".
Can I do it with a multimap? My second thought is to use sorted vector, which will point to vectors of values. Something like that:
std::vector<std::string, std::vector<T>> sorted_vec;
Then I can easily meet search criteria. But I really care about a performance of lookups. Is it a right approach?