Skip to content

Commit

Permalink
engine: Remove deprecated use of std::binary_function
Browse files Browse the repository at this point in the history
  • Loading branch information
cassava committed Jul 25, 2022
1 parent b891da9 commit 806b8ea
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions engine/src/utility/time_event.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,6 @@ struct TimeTrigger {

using TimeEmplaceHook = std::function<void(const cloe::Trigger&, cloe::Duration)>;

struct TimeTriggerCompare : public std::binary_function<std::shared_ptr<TimeTrigger>,
std::shared_ptr<TimeTrigger>,
bool> {
bool operator()(const std::shared_ptr<TimeTrigger>& x,
const std::shared_ptr<TimeTrigger>& y) const {
return x->time > y->time;
}
};

class TimeCallback : public cloe::Callback {
public:
TimeCallback(cloe::Logger log, TimeEmplaceHook h) : log_(log), hook_(h) {}
Expand Down Expand Up @@ -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::shared_ptr<TimeTrigger>,
std::vector<std::shared_ptr<TimeTrigger>>,
TimeTriggerCompare>
storage_;
std::priority_queue<
std::shared_ptr<TimeTrigger>, std::vector<std::shared_ptr<TimeTrigger>>,
std::function<bool(const std::shared_ptr<TimeTrigger>&, const std::shared_ptr<TimeTrigger>&)>>
storage_{[](const std::shared_ptr<TimeTrigger>& x,
const std::shared_ptr<TimeTrigger>& y) -> bool { return x->time > y->time; }};
};

class NextFactory : public cloe::EventFactory {
Expand Down

0 comments on commit 806b8ea

Please sign in to comment.