VC version upgrade question - TechRepublic
General discussion
April 27, 2001 at 07:07 AM
ompravish

VC version upgrade question

by ompravish . Updated 25 years, 1 month ago

compiler error c2678 – saying Any binary operator( <<, >>, ==, !=)as not defined even though they are present. Probable reason is Iam using VC 6 whereas the code is from earlier version of VC. MSDN help describes it as a namespace problem and suggests some workarounds. Heres the code snippet.

In someclass.h:

template , class Alloc = std::allocator >
class Someclass
{
// class definition here
friend bool operator==(const
someclass &rs1,const someclass &rs2)
{}
}

In main.cpp:
struct aclass
{
aclass(char *r) {
if (r != NULL) {
std::istringstream str(r);
str >> range; }
}
someclass range;
friend operator==(const aclass &p1, const aclass &p2)
{
return 1;
}
}

This discussion is locked

All Comments