From 2f94fb396c9dda6e5f3c4be4e0184f3ef46fa9a5 Mon Sep 17 00:00:00 2001
From: Maximilian Reininghaus <maximilian.reininghaus@tu-dortmund.de>
Date: Sat, 16 Feb 2019 20:55:02 +0100
Subject: [PATCH] deleted walk() example

---
 Documentation/Examples/cascade_example.cc | 18 ------------------
 Environment/VolumeTreeNode.h              |  2 +-
 2 files changed, 1 insertion(+), 19 deletions(-)

diff --git a/Documentation/Examples/cascade_example.cc b/Documentation/Examples/cascade_example.cc
index 17f5e23f9..89dc1f68b 100644
--- a/Documentation/Examples/cascade_example.cc
+++ b/Documentation/Examples/cascade_example.cc
@@ -246,24 +246,6 @@ int main() {
 
   universe.AddChild(std::move(theMedium));
 
-  auto const allElementsInUniverse = std::invoke([&]() {
-    std::set<particles::Code> allElementsInUniverse;
-    auto collectElements = [&](auto& vtn) {
-      if (auto const mp = vtn.GetModelPropertiesPtr();
-          mp != nullptr) { // do not query Universe it self, it has no ModelProperties
-        auto const& comp = mp->GetNuclearComposition().GetComponents();
-	for (auto const c : comp)
-	  allElementsInUniverse.insert(c);
-        // std::for_each(comp.cbegin(), comp.cend(),
-        //               [&](particles::Code c) { allElementsInUniverse.insert(c); });
-      }
-    };
-    universe.walk(collectElements);
-    return allElementsInUniverse;
-  });
-
-  for (auto elem : allElementsInUniverse) { std::cout << elem << std::endl; }
-
   const CoordinateSystem& rootCS = env.GetCoordinateSystem();
 
   // setup processes, decays and interactions
diff --git a/Environment/VolumeTreeNode.h b/Environment/VolumeTreeNode.h
index 093708a61..9cd3be1a9 100644
--- a/Environment/VolumeTreeNode.h
+++ b/Environment/VolumeTreeNode.h
@@ -80,7 +80,7 @@ namespace corsika::environment {
       } else {
         std::for_each(fChildNodes.begin(), fChildNodes.end(),
                       [&](auto& v) { v->walk(func); });
-        t(*this);
+        func(*this);
       }
     }
 
-- 
GitLab