diff options
Diffstat (limited to 'engine/include/core/priority.hpp')
-rw-r--r-- | engine/include/core/priority.hpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/engine/include/core/priority.hpp b/engine/include/core/priority.hpp index 0f00006..773b2f7 100644 --- a/engine/include/core/priority.hpp +++ b/engine/include/core/priority.hpp @@ -4,7 +4,6 @@ namespace flat { namespace core { - enum class priority_t : unsigned { max = 0, higher = 1, @@ -27,10 +26,19 @@ namespace flat { return m_priority; } }; - - bool operator<(const prioritized& lhs, const prioritized& rhs) { - return lhs.priority() < rhs.priority(); - } + + struct prioritize { + bool operator()(const prioritized& lhs, const prioritized& rhs) { + return lhs.priority() < rhs.priority(); + } + + bool operator()(const prioritized * const& lhs, const prioritized * const& rhs) { + return lhs->priority() < rhs->priority(); + } + }; + + template<typename Prioritized> + using queue = std::multiset<Prioritized, prioritize>; } } |