Hi, why didnt we directly overload operator == using the function operator overload.
Something like:
//comparator using operator overloading
bool operator == (Book &x, Book &y)
{
if(x.getName()==y.getName())
{
cout<<“Found”;
}
else
{
cout<<“Not found”;
}
}
Is there any benefit in the class BookCompare method used by Prateek bhaiya?