[llvm-dev] MapVector for strings

Russell Wallace via llvm-dev llvm-dev at lists.llvm.org
Fri Oct 2 08:22:41 PDT 2015


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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151002/00488db7/attachment.html>


More information about the llvm-dev mailing list