I have a class Table
which has a member function std::vector<Attribute> attributeVec();
where Attribute
is a seperate class.
I am working with code that would like to do something of the form
if (tableA.attributeVec() == tableB.attributeVec()){ ...
Where tableA
and tableB
are Table
objects.
I'm getting a lot of weird compiler errors in Visual Studio 2012 that say things like
binary '==' : no operator found which takes a left-hand operand of type 'const DatabaseAPI::Attribute' (or there is no acceptable conversion)
So I believe the vectors cannot be compared like that. It would make my life easier if I could get this code to compile, but how could I do that? Can I define the operator? Do I need to rewrite some of the Attribute
class so they can be compared?
Specifics: After writing an API, I was given a set of tests which, if reasonable, need to work. While I believe this at least makes unreasonable assumptions about my code (given my API), it wouldn't hurt to implement this in my code.
Thanks!