STL And Visual Studio 6 Issue...
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.
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.
Ah, but there's the thing: I'm not calling std::mismatch...-anywhere-.
That's what's flummoxed me the most.
That's what's flummoxed me the most.
And I don't see how it could be calling indirectly... all I'm doing are standard accessor operations with the vectors.
Okay, ridiculously enough, defining an == operator made it compile.
I'm still a little miffed at why this was happening, though.
I'm still a little miffed at why this was happening, though.
Quote:Original post by Julian SpillaneTry putting in a breakpoint inside of that operator == function, and see what is in the call stack when/if it hits the breakpoint.
Okay, ridiculously enough, defining an == operator made it compile.
I'm still a little miffed at why this was happening, though.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement