bool operator()(Person A, Person B)
Can you please explain this line? Why is operator() used?
bool operator()(Person A, Person B)
Can you please explain this line? Why is operator() used?
@aiman.mumtaz
It’s actually:
return_type operator character_to_be_overloaded (Argument 1, Argument 2,...){ //...// }
So here “operator” is itself a keyword which is used to overload i.e assign another function to an character ( here simple brackets).
You can read more on Operator overloading here.