Comparator in stl

at the time of calling bubble_sort function from main function three parameter is passed array , n and compare .
bubble_sort function accept array as a ,n as n but compare as bool(&cmp)(int a,int b). how to work compare function in bubble_ sort with bool(&cmp)(int a,int b)…
please explain in deep otherwise give a reference link for understanding this concept…

bool compare(int a,int b){
	return a<b;
}

this is a simple compare function

in bubble sort we have to check
will we swap 2 elements or not??
for that we use the compare function
if compare function returns true we swap otherwise not

in this compare function if a<b we return true
means if a<b then we swap hence the smaller element comes forward