C++11: [skip ci] replace deprecated function std::mem_fun_ref with lambda functions

This commit is contained in:
wmayer
2020-10-15 18:55:29 +02:00
parent da4a2e4ea4
commit df9282dc12
2 changed files with 5 additions and 3 deletions

View File

@@ -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();
}

View File

@@ -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();