C++11: replace deprecated function std::bind2nd with lambda functions

This commit is contained in:
wmayer
2020-10-15 14:46:02 +02:00
parent d8bbced84e
commit 56c6db10e0
11 changed files with 59 additions and 40 deletions

View File

@@ -556,8 +556,10 @@ void MeshSegmentAlgorithm::FindSegments(std::vector<MeshSurfaceSegmentPtr>& segm
cAlgo.ResetFacetsFlag(resetVisited, MeshCore::MeshFacet::VISIT);
resetVisited.clear();
iCur = std::find_if(iBeg, iEnd, std::bind2nd(MeshCore::MeshIsNotFlag<MeshCore::MeshFacet>(),
MeshCore::MeshFacet::VISIT));
MeshCore::MeshIsNotFlag<MeshCore::MeshFacet> flag;
iCur = std::find_if(iBeg, iEnd, [flag](const MeshFacet& f) {
return flag(f, MeshFacet::VISIT);
});
if (iCur < iEnd)
startFacet = iCur - iBeg;
else
@@ -580,8 +582,9 @@ void MeshSegmentAlgorithm::FindSegments(std::vector<MeshSurfaceSegmentPtr>& segm
}
// search for the next start facet
iCur = std::find_if(iCur, iEnd, std::bind2nd(MeshCore::MeshIsNotFlag<MeshCore::MeshFacet>(),
MeshCore::MeshFacet::VISIT));
iCur = std::find_if(iCur, iEnd, [flag](const MeshFacet& f) {
return flag(f, MeshFacet::VISIT);
});
if (iCur < iEnd)
startFacet = iCur - iBeg;
else