I am trying to understand the priority queue in stl. What I have understood is that the third argument is basically typename(in this case function pointer). So,if it just accepts the typename, how will it have access over my compare function when it will implement its operations if it just accept typename and not actual function pointer?
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
bool comp(int a,int b){
return a<b;
}
int main()
{
int (*p)(int,int);
p=comp;
priority_queue< int,vector<int>,decltype(&comp) > pq;
decltype(p) a;
cout<<typeid(a).name();
}