std::map and std::string

Posted May 25th, 2009 by William Willing

Categories: Programming

This is a bit trivial, but there is a chance that this information will save someone a lot of time looking in the wrong place, so I thought I’d post it. I ran into this using Visual C++ 2008, but it probably applies to some other C++-compilers as well.

If you are using an std::map that has an std::string as a key or value and you get all kinds of error messages from your compiler about template argument deduction or implicit conversions, you probably forgot to include <string>.

Leave a comment

CAPTCHA Image Audio Version
Reload Image

Bad Behavior has blocked 58 access attempts in the last 7 days.