Advertisement Jump to content
Sign in to follow this  
Julian Spillane

STL And Visual Studio 6 Issue...

This topic is 4907 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

First off, I know I shouldn't be using Visual Studio 6's STL libraries for any type of decent code, but that's a moot point right now. The problem is that I occasionally get this compiler error: c:\program files\microsoft visual studio\vc98\include\xutility(88) : error C2678: binary '==' : no operator defined which takes a left-hand operand of type 'const struct CPoly' (or there is no acceptable conversion) c:\program files\microsoft visual studio\vc98\include\xutility(30) : see reference to function template instantiation 'struct std::pair<struct CPoly const *,struct CPoly const *> __cdecl std::mismatch(const struct CPoly *,const struct CPoly *,const struct CPoly *)' being compiled And it only seems to happen when I define a structure like such: struct Bar { std::vector<float> m_vFloat; } struct Foo { std::vector<Bar> m_vBars; }; And since it's a templated error, it's nigh impossible to pinpoint where it's happening, and it's driving me up the wall. Do you guys have any suggestions? Thanks a lot.

Share this post


Link to post
Share on other sites
Advertisement
If you're going to call std::mismatch on a container (directly or indirectly), the objects it contains must have an == operator. CPoly doesn't - or you've made it a non-const member function.

Share this post


Link to post
Share on other sites
Quote:
Original post by Julian Spillane
Okay, ridiculously enough, defining an == operator made it compile.

I'm still a little miffed at why this was happening, though.
Try putting in a breakpoint inside of that operator == function, and see what is in the call stack when/if it hits the breakpoint.

Share this post


Link to post
Share on other sites
Quote:
Original post by Julian Spillane
Okay, ridiculously enough, defining an == operator made it compile.

I'm still a little miffed at why this was happening, though.


Are you sure you're not doing == between two vectors somewhere? That will trigger an element-by-element comparison, possibly relying on std::mismatch.

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!