i am new to C++ programming, and am confused as to why i cannot supply my template parameters to intialise a packaged_task in cpp.
#include <vector>
#include <queue>
#include <chrono>
#include <thread>
#include <cassert>
#include <future>
using namespace std::chrono;
using std::future;
using std::packaged_task;
using std::priority_queue;
class CPlayGround {
priority_queue<int> pq;
public:
CPlayGround() {
using task_type = int();
packaged_task<task_type> pt{aFunc()};
}
int aFunc() {
return 10;
}
};
my CLion compiler states:
In template, no type named type in "std::result_of<int&()>"