Random Chitchat 2012-2016
(08-01-2016, 08:41 AM)tigerw Wrote: Could anyone help me get this snippet to compile?

#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

Well, it seems that it's a Visual Studio compiler issue (duly reported and fixed). In the meantime, a workaround is to use a class which moves itself when copied.
Thanks given by:
Also, shcode=cpp is broken :P
Thanks given by:
I came back from my vacation to Terschelling. I'm going to there for ~10 years, but it's still as beautiful as ever Smile

I tried to upload some photo's, but unfortunately the forum didn't do anything when I tried to upload them. The "Add Attachment" did a post with the image, but the forum didn't save it for some reason.
Thanks given by:
You need to select the file and then press add attachment.... 

Stupid behavior, took me long to find out
Thanks given by:
I did, but it didn't do anything with it.
Thanks given by:
Yesterday we had a big family gathering, some 40 people. And for all the kids, I was the good uncle with the quadcopter Smile Everyone wanted to try and fly, I can't believe all those children did actually try and we didn't lose the drone.

I'm pretty sure what this year's letters to Santa will look like. "Dear Satan, please give me a quadcopter just like uncle's"Big Grin
Thanks given by:
Haha, that's awesomeBig Grin My brother is also talking about drones and quadcopters all the time Smile
Thanks given by:
Quadcopters are pretty darn awesome though. Does yours have a camera on it? You can make some awesome images with it.
Thanks given by:
@PureTryOut Nicely said, they are pretty darn awesome indeed. I can't repeat that enough times Smile It's a new addiction for me.
Thanks given by:
I've decided to invite ElNounch to join the Server development team in the github Cuberite Organization. I believe he deserves this for his development efforts so far and I hope he will continue his great work. Big Thanks!
Thanks given by:




Users browsing this thread: 22 Guest(s)