A std::map that keep track of the order of insertion?
If you have only 50 values in std::map you could copy them to std::vector before printing out and sort via std::sort using appropriate functor. Or you could use boost::multi_index. It allows to use several indexes. In your case it could look like the following: struct value_t { string s; int i; }; struct string_tag {}; … Read more