make tasks neither copyable nor movable

master
Daniel Kolesa 2016-04-03 19:13:23 +01:00
parent d12a8bdf74
commit 8f97190958
1 changed files with 5 additions and 0 deletions

View File

@ -38,7 +38,12 @@ using cscript::Bytecode;
struct Task {
ostd::Function<void()> cb;
Task *next = nullptr;
Task() = delete;
Task(const Task &) = delete;
Task(Task &&) = delete;
Task(ostd::Function<void()> &&cbf): cb(ostd::move(cbf)) {}
Task &operator=(const Task &) = delete;
Task &operator=(Task &&) = delete;
};
struct ThreadPool {