I was just trying to swap the data between the two priority queues and got this error. I also did some googling and still don't know what's wrong here.
#include <queue>
class Node
{
public:
int idx;
};
auto greater = []( const Node& a, const Node& b) {return a.idx > b.idx; };
using QUEUE = std::priority_queue<Node, std::vector<Node>, decltype(greater)>;
void foo(QUEUE& a)
{
QUEUE b(greater);
a.swap(b);
}
int main()
{
}
Here's the full error message:
Error C2280 ' < lambda_07efac20ebfa61cc8bb35aebd7d81f7c> &<< lambda_07efac20ebfa61cc8bb35aebd7d81f7c>>::operator =(const << lambda_07efac20ebfa61cc8bb35aebd7d81f7c>> &)': attempting to reference a deleted function