IAP GITLAB

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

VolumeTreeNode::walk() made const

parent a06216b6
No related branches found
No related tags found
1 merge request!440Resolve "Create SIBYLL process that handles everything including nuclei"
...@@ -54,11 +54,11 @@ namespace corsika { ...@@ -54,11 +54,11 @@ namespace corsika {
template <typename IModelProperties> template <typename IModelProperties>
template <typename TCallable, bool preorder> template <typename TCallable, bool preorder>
inline void VolumeTreeNode<IModelProperties>::walk(TCallable func) { inline void VolumeTreeNode<IModelProperties>::walk(TCallable func) const {
if constexpr (preorder) { func(*this); } if constexpr (preorder) { func(*this); }
std::for_each(childNodes_.begin(), childNodes_.end(), std::for_each(childNodes_.begin(), childNodes_.end(),
[&](auto& v) { v->walk(func); }); [&](auto const& v) { v->walk(func); });
if constexpr (!preorder) { func(*this); }; if constexpr (!preorder) { func(*this); };
} }
......
...@@ -44,7 +44,7 @@ namespace corsika { ...@@ -44,7 +44,7 @@ namespace corsika {
* func is ignored. * func is ignored.
*/ */
template <typename TCallable, bool preorder = true> template <typename TCallable, bool preorder = true>
void walk(TCallable func); void walk(TCallable func) const;
void addChild(VTNUPtr pChild); 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