Merge pull request #214 from borglab/fix/deprecated-cpp17

Replace c++17 removed classes with c++11 replacements
release/4.3a0
Frank Dellaert 2020-01-21 08:37:36 -05:00 committed by GitHub
commit 2668eef4e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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) {