MapVector for strings

I’m looking at a requirement to store a collection of strings and then iterate through them in an order that needs to be deterministic, but would do better to be the order in which they were encountered rather than alphabetical order. MapVector provides that order, though not for strings; the documentation mentioned the possibility of providing an appropriate specialization.

However, MapVector is based on DenseMap, which is designed for pointers, not objects like std::string. Would it be a good idea to go ahead and use it anyway, or would it be better to implement my own map vector based on some other underlying hash map class?

You can store the strings in a std::vector or SmallVector and use a StringSet to ensure uniqueness.