Fix the use of deprecated C++ functions (#1138)

This commit is contained in:
diath
2021-04-01 00:38:36 +02:00
committed by GitHub
parent 67b7dbfcfe
commit b37623cd86
7 changed files with 30 additions and 26 deletions

View File

@@ -43,7 +43,7 @@ private:
std::deque<EventPtr> m_eventList;
int m_pollEventsSize;
stdext::boolean<false> m_disabled;
std::priority_queue<ScheduledEventPtr, std::deque<ScheduledEventPtr>, lessScheduledEvent> m_scheduledEventList;
std::priority_queue<ScheduledEventPtr, std::deque<ScheduledEventPtr>, ScheduledEvent::Compare> m_scheduledEventList;
};
extern EventDispatcher g_dispatcher;

View File

@@ -40,6 +40,12 @@ public:
int cyclesExecuted() { return m_cyclesExecuted; }
int maxCycles() { return m_maxCycles; }
struct Compare {
bool operator() (const ScheduledEventPtr &a, const ScheduledEventPtr &b) const {
return b->ticks() < a->ticks();
}
};
private:
ticks_t m_ticks;
int m_delay;
@@ -47,10 +53,4 @@ private:
int m_cyclesExecuted;
};
struct lessScheduledEvent : std::binary_function<ScheduledEventPtr, ScheduledEventPtr&, bool> {
bool operator()(const ScheduledEventPtr& a, const ScheduledEventPtr& b) {
return b->ticks() < a->ticks();
}
};
#endif