How campare object works in Iterator+Template+Comparator function

I ’ m having a doubt regarding the function which is being used as comparator !

ex: boolean()(){
}

and how it can be implemented in template function!

for different datatype your comparator will be different as the way we compare datatypes differ for each other so there no use to make this function as a template function