fork download
#include 
#include 
#include 
#include 

using namespace std;

template class Compare = std::less, template class Container = std::vector>
std::priority_queue>, Compare>
make_pqueue()
{
    return std::priority_queue>, Compare>();
}

int main() {
    int arr[] = {5, 3, 4, 2, 1};
    size_t size = sizeof(arr) / sizeof(*arr);

    auto pqueue = make_pqueue();

    for(size_t i = 0; i < size; ++i) {
        pqueue.push(arr[i]);
    }

    while (!pqueue.empty()) {
        cout << pqueue.top() << endl;
        pqueue.pop();
    }
}
Success #stdin #stdout 0s 3060KB
stdin
Standard input is empty
stdout
1
2
3
4
5