summaryrefslogtreecommitdiffstats
path: root/engine
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2019-01-22 04:31:30 +0100
committerNao Pross <naopross@thearcway.org>2019-01-22 04:31:30 +0100
commite584e04c5f8ffb14e50c701c1fd8178457a51743 (patch)
tree369599a34ae52ade9119d08a19c3fffe2a15b63d /engine
parentUpdate .gitignore, delete test/test (diff)
downloadflatland-e584e04c5f8ffb14e50c701c1fd8178457a51743.tar.gz
flatland-e584e04c5f8ffb14e50c701c1fd8178457a51743.zip
Add test for task and job, fix bug in job
By being a std::set job did not allow to add duplicate elements, changing it to a std::multiset fixed the issue.
Diffstat (limited to 'engine')
-rw-r--r--engine/include/task.hpp4
-rw-r--r--engine/task.cpp1
2 files changed, 2 insertions, 3 deletions
diff --git a/engine/include/task.hpp b/engine/include/task.hpp
index 8c4f48f..9422a23 100644
--- a/engine/include/task.hpp
+++ b/engine/include/task.hpp
@@ -27,9 +27,9 @@ namespace flat {
std::function<void()> m_callback;
};
- struct job : public std::set<task> {
+ struct job : public std::multiset<task> {
inline void add_task(task t) {
- insert(begin(), t);
+ this->insert(t);
}
void invoke_tasks();
diff --git a/engine/task.cpp b/engine/task.cpp
index 537a6b1..c09fa8b 100644
--- a/engine/task.cpp
+++ b/engine/task.cpp
@@ -1,7 +1,6 @@
#include "task.hpp"
#include <functional>
-#include <set>
namespace flat {