Say I am working with a class:
class Foo{
public:
std:string name;
/*...*/
}/*end Foo*/
and I provide an overload for operator==
bool operator==(const Foo& fooObj, const std::string& strObj) {
return (fooObj.name == strObj);
}
Do I also need to re-implement the same logic in reverse?
bool operator==(const std::string& strObj, const Foo& fooObj) {
return (strObj == fooObj.name);
}