Advertisement Jump to content
Sign in to follow this  
v0dKA

std::string operator != (problems)

This topic is 4920 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just recently installed VC++ 2005 Express beta 2. For some reason, the compiler is flagging an error when I try to use the std::string != operator:
std::string a = ...;
if( a != "." && a != ".." ) { ... }
The second line would produce 2 errors (1 from each comparison) that look like this: error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'std::string' (or there is no acceptable conversion) could be 'built-in C++ operator!=(const char [2], const char [2])' I never got this error in previous versions of VC++. What has changed and how can I fix it?

Share this post


Link to post
Share on other sites
Advertisement
You can get errors like that if you include a std header that has a std::string definition that doesn't actually #include <string>. Now if you have #include <string> in your source file and are still getting those errors, then I have no clue.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!