[Insight-users] operator definition conflicts with ITK?

Kexiang Wang kxwang at gmail.com
Wed Aug 11 18:43:59 EDT 2004


Look at this example

#include "itkImage.h"
class A
{
public:
  A(){}
  friend int operator , (const A&, const A&);
};

int operator , (const A& a, const A& b)
{
  return 1;
}


int main()
{
  return 0;
}

this error is reported
d:\microsoft visual studio\vc98\include\xstring(44) : error C2678:
binary ',' : no operator defined which takes a left-hand operand of
type 'void' (or there is no acceptable conversion)
d:\microsoft visual studio\vc98\include\xstring(42) : while compiling
class-template member function '__thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::std::basic_string<char,struct std::char_trait
s<char>,class std::allocator<char> >(const class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > &)'

why can't i define operator , along with ITK?


More information about the Insight-users mailing list