How comparator is behaving in the binary search function

I have looked into the c++ references about the binary search function.I do not have a slight idea what the values are coming into the comparator function and what happens after the comparator function returns a true or false.
Please help me with that.

Please provide us with a code snippet or something which you are stuck at so that we can help you out with it.

if (std::binary_search (v.begin(), v.end(), 6, myfunction)) std::cout << “found!\n”; else std::cout << “not found.\n”;

The built-in binarySearch function always supplies the pivot element to the comparator as the second argument. This is undocumented behaviour, but we can exploit that using a given comparator

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.