From 94263c2b18fca39f7cf58897196a242c9aa58d14 Mon Sep 17 00:00:00 2001
From: Michael Kuron <mkuron@icp.uni-stuttgart.de>
Date: Mon, 10 Feb 2020 16:37:05 +0100
Subject: [PATCH] Remove use of deprecated std::bind1st and std::mem_fun

---
 src/pe/ccd/HashGrids.cpp | 12 ++++++------
 src/pe/ccd/SimpleCCD.cpp |  8 ++++----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/pe/ccd/HashGrids.cpp b/src/pe/ccd/HashGrids.cpp
index 0f9d4908d..3c312fa36 100644
--- a/src/pe/ccd/HashGrids.cpp
+++ b/src/pe/ccd/HashGrids.cpp
@@ -586,8 +586,8 @@ void HashGrids::HashGrid::enlarge()
 //   // 'nonGridBodies_' and pairwise collision checks are performed.
 //   gridActive_ = false;
 
-//   bodystorage_.registerAddCallback( "HashGrids", std::bind1st(std::mem_fun(&HashGrids::add), this) );
-//   bodystorage_.registerRemoveCallback( "HashGrids", std::bind1st(std::mem_fun(&HashGrids::remove), this) );
+//   bodystorage_.registerAddCallback( "HashGrids", std::bind(&HashGrids::add, this, std::placeholders::_1) );
+//   bodystorage_.registerRemoveCallback( "HashGrids", std::bind(&HashGrids::remove, this, std::placeholders::_1) );
 //}
 //*************************************************************************************************
 
@@ -611,11 +611,11 @@ HashGrids::HashGrids( BodyStorage& globalStorage, BodyStorage& bodystorage, Body
    // 'nonGridBodies_' and pairwise collision checks are performed.
    gridActive_ = false;
 
-   bodystorage_.registerAddCallback( "HashGrids", std::bind1st(std::mem_fun(&HashGrids::add), this) );
-   bodystorage_.registerRemoveCallback( "HashGrids", std::bind1st(std::mem_fun(&HashGrids::remove), this) );
+   bodystorage_.registerAddCallback( "HashGrids", std::bind(&HashGrids::add, this, std::placeholders::_1) );
+   bodystorage_.registerRemoveCallback( "HashGrids", std::bind(&HashGrids::remove, this, std::placeholders::_1) );
 
-   bodystorageShadowCopies_.registerAddCallback( "HashGrids", std::bind1st(std::mem_fun(&HashGrids::add), this) );
-   bodystorageShadowCopies_.registerRemoveCallback( "HashGrids", std::bind1st(std::mem_fun(&HashGrids::remove), this) );
+   bodystorageShadowCopies_.registerAddCallback( "HashGrids", std::bind(&HashGrids::add, this, std::placeholders::_1) );
+   bodystorageShadowCopies_.registerRemoveCallback( "HashGrids", std::bind(&HashGrids::remove, this, std::placeholders::_1) );
 }
 //*************************************************************************************************
 
diff --git a/src/pe/ccd/SimpleCCD.cpp b/src/pe/ccd/SimpleCCD.cpp
index 9c992738a..c9af45916 100644
--- a/src/pe/ccd/SimpleCCD.cpp
+++ b/src/pe/ccd/SimpleCCD.cpp
@@ -35,11 +35,11 @@ namespace ccd {
 
 SimpleCCD::SimpleCCD(BodyStorage& globalStorage, Storage& storage) : globalStorage_(globalStorage), storage_(storage)
 {
-   storage_[0].registerAddCallback( "SimpleCCD", std::bind1st(std::mem_fun(&SimpleCCD::add), this) );
-   storage_[0].registerRemoveCallback( "SimpleCCD", std::bind1st(std::mem_fun(&SimpleCCD::remove), this) );
+   storage_[0].registerAddCallback( "SimpleCCD", std::bind(&SimpleCCD::add, this, std::placeholders::_1) );
+   storage_[0].registerRemoveCallback( "SimpleCCD", std::bind(&SimpleCCD::remove, this, std::placeholders::_1) );
 
-   storage_[1].registerAddCallback( "SimpleCCD", std::bind1st(std::mem_fun(&SimpleCCD::add), this) );
-   storage_[1].registerRemoveCallback( "SimpleCCD", std::bind1st(std::mem_fun(&SimpleCCD::remove), this) );
+   storage_[1].registerAddCallback( "SimpleCCD", std::bind(&SimpleCCD::add, this, std::placeholders::_1) );
+   storage_[1].registerRemoveCallback( "SimpleCCD", std::bind(&SimpleCCD::remove, this, std::placeholders::_1) );
 }
 
 SimpleCCD::~SimpleCCD()
-- 
GitLab