Replace c++17 removed classes with c++11 replacements

release/4.3a0
Jose Luis Blanco-Claraco 2020-01-20 00:57:07 +01:00
parent 26a5a42a38
commit f3efbe2dd7
2 changed files with 3 additions and 3 deletions

View File

@ -107,7 +107,7 @@ namespace gtsam {
* Template to create a binary predicate
*/
template<class V>
struct equals : public std::binary_function<const V&, const V&, bool> {
struct equals : public std::function<bool(const V&, const V&)> {
double tol_;
equals(double tol = 1e-9) : tol_(tol) {}
bool operator()(const V& expected, const V& actual) {
@ -119,7 +119,7 @@ namespace gtsam {
* Binary predicate on shared pointers
*/
template<class V>
struct equals_star : public std::binary_function<const boost::shared_ptr<V>&, const boost::shared_ptr<V>&, bool> {
struct equals_star : public std::function<bool(const boost::shared_ptr<V>&, const boost::shared_ptr<V>&)> {
double tol_;
equals_star(double tol = 1e-9) : tol_(tol) {}
bool operator()(const boost::shared_ptr<V>& expected, const boost::shared_ptr<V>& actual) {

View File

@ -43,7 +43,7 @@ void Errors::print(const std::string& s) const {
}
/* ************************************************************************* */
struct equalsVector : public std::binary_function<const Vector&, const Vector&, bool> {
struct equalsVector : public std::function<bool(const Vector&, const Vector&)> {
double tol_;
equalsVector(double tol = 1e-9) : tol_(tol) {}
bool operator()(const Vector& expected, const Vector& actual) {