IAP GITLAB

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

reordered walk()

parent 02e98ce7
No related branches found
No related tags found
1 merge request!100Resolve "Low energy hadronic interactions: UrQMD interface"
......@@ -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