@@ -95,15 +95,6 @@ struct TimeTrigger {
95
95
96
96
using TimeEmplaceHook = std::function<void (const cloe::Trigger&, cloe::Duration )>;
97
97
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
-
107
98
class TimeCallback : public cloe ::Callback {
108
99
public:
109
100
TimeCallback (cloe::Logger log, TimeEmplaceHook h) : log_(log), hook_(h) {}
@@ -148,10 +139,11 @@ class TimeCallback : public cloe::Callback {
148
139
// This is ridiculous: We need to wrap the unique_ptr of Trigger in
149
140
// a shared_ptr because you can only get objects by copy out of
150
141
// 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 ; }};
155
147
};
156
148
157
149
class NextFactory : public cloe ::EventFactory {
0 commit comments