From 806b8eabe6b4ceee5e81b7692b8f7bf1e56d4364 Mon Sep 17 00:00:00 2001 From: Benjamin Morgan Date: Tue, 7 Jun 2022 17:05:24 +0200 Subject: [PATCH] engine: Remove deprecated use of std::binary_function --- engine/src/utility/time_event.hpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/engine/src/utility/time_event.hpp b/engine/src/utility/time_event.hpp index ae2fcea01..c32f2250f 100644 --- a/engine/src/utility/time_event.hpp +++ b/engine/src/utility/time_event.hpp @@ -95,15 +95,6 @@ struct TimeTrigger { using TimeEmplaceHook = std::function; -struct TimeTriggerCompare : public std::binary_function, - std::shared_ptr, - bool> { - bool operator()(const std::shared_ptr& x, - const std::shared_ptr& y) const { - return x->time > y->time; - } -}; - class TimeCallback : public cloe::Callback { public: TimeCallback(cloe::Logger log, TimeEmplaceHook h) : log_(log), hook_(h) {} @@ -148,10 +139,11 @@ class TimeCallback : public cloe::Callback { // This is ridiculous: We need to wrap the unique_ptr of Trigger in // a shared_ptr because you can only get objects by copy out of // a priority_queue. - std::priority_queue, - std::vector>, - TimeTriggerCompare> - storage_; + std::priority_queue< + std::shared_ptr, std::vector>, + std::function&, const std::shared_ptr&)>> + storage_{[](const std::shared_ptr& x, + const std::shared_ptr& y) -> bool { return x->time > y->time; }}; }; class NextFactory : public cloe::EventFactory {