I have two std::array same size and store the same element type (a class that I wrote) when I compare them using ==
operator compiler throws this error: ...\include\xutility(2919): error C2672: 'operator __surrogate_func': no matching overloaded function found
.
I tried comparing tow arrays with vectors as their elements and it worked but comparing arrays with any class I write I'm getting that error.
Test class:
class Class {
int i;
public:
Class() {}
Class(const Class& other) {}
Class(Class&& other) {}
~Class() {}
Class operator= (const Class& other) {}
Class operator= (Class&& other) {}
BOOL operator== (const Class& other) {}
};
Comparison:
std::array<Class, 3> a0 = {};
std::array<Class, 3> a1 = {};
if (a0 == a1)
"COOL";
Error I'm getting:
...\include\xutility(2919): error C2672: 'operator __surrogate_func': no matching overloaded function found
BOOL
instead ofbool
and why is there no return statement in your functions? – krzaqa0
anda1
, but the arrays. – Eli SadoffClass
not forstd::array<Class, 3>
– Eli SadoffBOOL
definitely isn't the same asbool
. It's a typedef forint
. – krzaq