From 6f4e196236f3b5c36de921e16a3d4c1bf79e7f1e Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 11 Sep 2020 15:09:02 +0200 Subject: [PATCH] templating callable function in foreachs to allow usage of lambdas --- vcg/complex/foreach.h | 48 +++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/vcg/complex/foreach.h b/vcg/complex/foreach.h index 4f7710fd..a062e41c 100644 --- a/vcg/complex/foreach.h +++ b/vcg/complex/foreach.h @@ -34,8 +34,8 @@ namespace tri { @{ */ -template -inline void ForEachFacePos(const MeshType &m, std::function &)> action) +template +inline void ForEachFacePos(const MeshType &m, Callable action) { typedef typename face::Pos PosType; @@ -50,8 +50,8 @@ inline void ForEachFacePos(const MeshType &m, std::function -inline void ForEachFacePos(MeshType &m, std::function &)> action) +template +inline void ForEachFacePos(MeshType &m, Callable action) { typedef typename face::Pos PosType; @@ -76,8 +76,8 @@ inline void ForEachFacePos(MeshType &m, std::function -inline void ForEachFace(const MeshType &m, std::function action) +template +inline void ForEachFace(const MeshType &m, Callable action) { if(m.fn == (int) m.face.size()) { @@ -95,8 +95,8 @@ inline void ForEachFace(const MeshType &m, std::function -inline void ForEachFace(MeshType &m, std::function action) +template +inline void ForEachFace(MeshType &m, Callable action) { if(m.fn == (int) m.face.size()) { @@ -124,8 +124,8 @@ inline void ForEachFace(MeshType &m, std::function -inline void ForEachVertex(const MeshType &m, std::function action) +template +inline void ForEachVertex(const MeshType &m, Callable action) { if(m.vn == (int) m.vert.size()) { @@ -143,8 +143,8 @@ inline void ForEachVertex(const MeshType &m, std::function -inline void ForEachVertex(MeshType &m, std::function action) +template +inline void ForEachVertex(MeshType &m, Callable action) { if(m.vn == (int) m.vert.size()) { @@ -172,8 +172,8 @@ inline void ForEachVertex(MeshType &m, std::function -inline void ForEachHEdge(const MeshType &m, std::function action) +template +inline void ForEachHEdge(const MeshType &m, Callable action) { if(m.hn == (int) m.hedge.size()) { @@ -191,8 +191,8 @@ inline void ForEachHEdge(const MeshType &m, std::function -inline void ForEachHEdge(MeshType &m, std::function action) +template +inline void ForEachHEdge(MeshType &m, Callable action) { if(m.hn == (int) m.hedge.size()) { @@ -220,8 +220,8 @@ inline void ForEachHEdge(MeshType &m, std::function -inline void ForEachEdge(const MeshType &m, std::function action) +template +inline void ForEachEdge(const MeshType &m, Callable action) { if(m.en == (int) m.edge.size()) { @@ -239,8 +239,8 @@ inline void ForEachEdge(const MeshType &m, std::function -inline void ForEachEdge(MeshType &m, std::function action) +template +inline void ForEachEdge(MeshType &m, Callable action) { if(m.en == (int) m.edge.size()) { @@ -268,8 +268,8 @@ inline void ForEachEdge(MeshType &m, std::function -inline void ForEachTetra(const MeshType &m, std::function action) +template +inline void ForEachTetra(const MeshType &m, Callable action) { if(m.tn == (int) m.tetra.size()) { @@ -287,8 +287,8 @@ inline void ForEachTetra(const MeshType &m, std::function -inline void ForEachTetra(MeshType &m, std::function action) +template +inline void ForEachTetra(MeshType &m, Callable action) { if(m.tn == (int) m.tetra.size()) {