I have the following erroneous code which I am trying to compile in VC2010, but I\'m getting the error C2974 this only occurs when I include the lambda expression, so I\'m g
Following is an example for building a minheap using priority queue. I have used a lambda to define the comparator, given linked lists defined by vector
// This comparator will be used to build minheap.
auto comp = [&](ListNode *a, ListNode *b) {
return a->val > b->val;
};
// This priority queue is the min heap
priority_queue, decltype(comp)> pq(comp);