 <p>std::map's comparator isn't std::equal_to it's std::less, I'm not sure what the best way to short circuit a &lt; compare so that it would be faster than the built in one.</p> <p>If there are always &lt; 15 elems, perhaps you could use a key besides std::string?</p>