When will the operator function call?

When will the overloading operator() present in PersonCompare get called?

Hey @priya_Jain if you are talking about the code in the video then please share screenshot of it .

In the video there’s a () operator in personcompare class, it will be called at the time of comparison between two objects of person. As stl doesn’t deal with the function but with classes.

But in the code we are not doing comparison

in bool operator() we are doing na A.age<B.age that is nothing but comparison.