IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 83a12df1 authored by Maximilian Reininghaus's avatar Maximilian Reininghaus :vulcan: Committed by Maximilian Reininghaus
Browse files

reordered walk()

parent 62e7c331
No related branches found
No related tags found
1 merge request!116Some improvements here and there
......@@ -75,15 +75,12 @@ namespace corsika::environment {
*/
template <typename TCallable, bool preorder = true>
void walk(TCallable func) {
if constexpr (preorder) {
func(*this);
std::for_each(fChildNodes.begin(), fChildNodes.end(),
[&](auto& v) { v->walk(func); });
} else {
std::for_each(fChildNodes.begin(), fChildNodes.end(),
[&](auto& v) { v->walk(func); });
func(*this);
}
if constexpr (preorder) { func(*this); }
std::for_each(fChildNodes.begin(), fChildNodes.end(),
[&](auto& v) { v->walk(func); });
if constexpr (!preorder) { func(*this); };
}
void AddChild(VTNUPtr pChild) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment