Skip to content

Commit 806b8ea

Browse files
committed
engine: Remove deprecated use of std::binary_function
1 parent b891da9 commit 806b8ea

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

engine/src/utility/time_event.hpp

+5-13
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,6 @@ struct TimeTrigger {
9595

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

98-
struct TimeTriggerCompare : public std::binary_function<std::shared_ptr<TimeTrigger>,
99-
std::shared_ptr<TimeTrigger>,
100-
bool> {
101-
bool operator()(const std::shared_ptr<TimeTrigger>& x,
102-
const std::shared_ptr<TimeTrigger>& y) const {
103-
return x->time > y->time;
104-
}
105-
};
106-
10798
class TimeCallback : public cloe::Callback {
10899
public:
109100
TimeCallback(cloe::Logger log, TimeEmplaceHook h) : log_(log), hook_(h) {}
@@ -148,10 +139,11 @@ class TimeCallback : public cloe::Callback {
148139
// This is ridiculous: We need to wrap the unique_ptr of Trigger in
149140
// a shared_ptr because you can only get objects by copy out of
150141
// a priority_queue.
151-
std::priority_queue<std::shared_ptr<TimeTrigger>,
152-
std::vector<std::shared_ptr<TimeTrigger>>,
153-
TimeTriggerCompare>
154-
storage_;
142+
std::priority_queue<
143+
std::shared_ptr<TimeTrigger>, std::vector<std::shared_ptr<TimeTrigger>>,
144+
std::function<bool(const std::shared_ptr<TimeTrigger>&, const std::shared_ptr<TimeTrigger>&)>>
145+
storage_{[](const std::shared_ptr<TimeTrigger>& x,
146+
const std::shared_ptr<TimeTrigger>& y) -> bool { return x->time > y->time; }};
155147
};
156148

157149
class NextFactory : public cloe::EventFactory {

0 commit comments

Comments
 (0)