Skip to content

Commit

Permalink
Add const to applyVisitor (BehaviorTree#935)
Browse files Browse the repository at this point in the history
  • Loading branch information
Isarm authored Feb 25, 2025
1 parent 7704d94 commit aa085b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/behaviortree_cpp/bt_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class Tree
[[nodiscard]] Blackboard::Ptr rootBlackboard();

//Call the visitor for each node of the tree.
void applyVisitor(const std::function<void(const TreeNode*)>& visitor);
void applyVisitor(const std::function<void(const TreeNode*)>& visitor) const;

//Call the visitor for each node of the tree.
void applyVisitor(const std::function<void(TreeNode*)>& visitor);
Expand Down
2 changes: 1 addition & 1 deletion src/bt_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ Blackboard::Ptr Tree::rootBlackboard()
return {};
}

void Tree::applyVisitor(const std::function<void(const TreeNode*)>& visitor)
void Tree::applyVisitor(const std::function<void(const TreeNode*)>& visitor) const
{
BT::applyRecursiveVisitor(static_cast<const TreeNode*>(rootNode()), visitor);
}
Expand Down

0 comments on commit aa085b7

Please sign in to comment.