08-01-2016, 08:41 AM
Could anyone help me get this snippet to compile?
It tells me that:
#include <memory>
#include <vector>
#include <future>
using namespace std;
vector<packaged_task<void()>> veccy;
template<typename T>
void queue(T Task)
{
veccy.emplace_back(move(Task));
}
int main()
{
unique_ptr<int> un;
queue(
[un = move(un)]
{
}
);
return 0;
}
It tells me that:
Code:
Error C2280 'main::<lambda_2dcc5207d1d056d2ef4fc2991b66fdec>::<lambda_2dcc5207d1d056d2ef4fc2991b66fdec>(const main::<lambda_2dcc5207d1d056d2ef4fc2991b66fdec> &)': attempting to reference a deleted function ConsoleApplication1 c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility 288
