Changed not to inherit from binary_function for c++11 or above. (#1607)

This commit is contained in:
Hong Chen 2023-11-16 10:55:13 -06:00 committed by GitHub
parent 2c27b65e14
commit 260b5fa558
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@
PURPOSE: ( Event Class )
*/
#include <string>
#include <iostream>
#include "trick/mm_macros.hh"
#include "trick/exec_proto.h"
@ -203,12 +204,16 @@ class Event {
#ifndef SWIG
struct CompareEventPtrs : public std::binary_function<Trick::Event *, Trick::Event *, bool> {
bool operator()(const Trick::Event * lhs, const Trick::Event * rhs) const {
return lhs->get_next_tics() < rhs->get_next_tics();
}
};
// No need to inherit from binary_function for c++11 or later
#if __cplusplus >= 201103L
struct CompareEventPtrs {
#else
struct CompareEventPtrs : public std::binary_function<Trick::Event *, Trick::Event *, bool> {
#endif
bool operator()(const Trick::Event * lhs, const Trick::Event * rhs) const {
return lhs->get_next_tics() < rhs->get_next_tics();
}
};
#endif
}