error C2660 “std::packaged_task<int (int)>::operator ()”: The function does not take zero arguments
#include "thread_pool.hpp"
#include "thread"
#include "future"
#include "functional"
#include "memory"
#include "iostream"
using namespace std;
int f(int j)
{
return j;
}
int main(int argc, char **argv)
{
tp::ThreadPool pool;
//
std::packaged_task<int(int)> t(f);
std::future<int> r = t.get_future();
pool.post(t);
r.get();
//while (1);
getchar();
return 0;
}