From df9282dc12d45996bb83cb42f6da10fd82519a47 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 15 Oct 2020 18:55:29 +0200 Subject: [PATCH] C++11: [skip ci] replace deprecated function std::mem_fun_ref with lambda functions --- src/Mod/Mesh/App/Core/Builder.cpp | 4 +++- src/Mod/Mesh/App/Core/MeshKernel.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Mod/Mesh/App/Core/Builder.cpp b/src/Mod/Mesh/App/Core/Builder.cpp index 02e6174f3c..db5a6271f5 100644 --- a/src/Mod/Mesh/App/Core/Builder.cpp +++ b/src/Mod/Mesh/App/Core/Builder.cpp @@ -208,7 +208,9 @@ void MeshBuilder::RemoveUnreferencedPoints() _meshKernel._aclPointArray[it->_aulPoints[i]].ResetInvalid(); } - unsigned long uValidPts = std::count_if(_meshKernel._aclPointArray.begin(), _meshKernel._aclPointArray.end(), std::mem_fun_ref(&MeshPoint::IsValid)); + unsigned long uValidPts = std::count_if(_meshKernel._aclPointArray.begin(), + _meshKernel._aclPointArray.end(), + [](const MeshPoint& p) { return p.IsValid(); }); if ( uValidPts < _meshKernel.CountPoints() ) _meshKernel.RemoveInvalids(); } diff --git a/src/Mod/Mesh/App/Core/MeshKernel.cpp b/src/Mod/Mesh/App/Core/MeshKernel.cpp index 34ef5f2c5d..dbcc8570b8 100644 --- a/src/Mod/Mesh/App/Core/MeshKernel.cpp +++ b/src/Mod/Mesh/App/Core/MeshKernel.cpp @@ -660,7 +660,7 @@ void MeshKernel::RemoveInvalids () // delete point, number of valid points unsigned long ulNewPts = std::count_if(_aclPointArray.begin(), _aclPointArray.end(), - std::mem_fun_ref(&MeshPoint::IsValid)); + [](const MeshPoint& p) { return p.IsValid(); }); // tmp. point array MeshPointArray aclTempPt(ulNewPts); MeshPointArray::_TIterator pPTemp = aclTempPt.begin(); @@ -705,7 +705,7 @@ void MeshKernel::RemoveInvalids () // delete facets, number of valid facets unsigned long ulDelFacets = std::count_if(_aclFacetArray.begin(), _aclFacetArray.end(), - std::mem_fun_ref(&MeshFacet::IsValid)); + [](const MeshFacet& f) { return f.IsValid(); }); MeshFacetArray aclFArray(ulDelFacets); MeshFacetArray::_TIterator pFTemp = aclFArray.begin(); pFEnd = _aclFacetArray.end();