Skip to content

Commit aa085b7

Browse files
authored
Add const to applyVisitor (BehaviorTree#935)
1 parent 7704d94 commit aa085b7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/behaviortree_cpp/bt_factory.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class Tree
149149
[[nodiscard]] Blackboard::Ptr rootBlackboard();
150150

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

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

src/bt_factory.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ Blackboard::Ptr Tree::rootBlackboard()
597597
return {};
598598
}
599599

600-
void Tree::applyVisitor(const std::function<void(const TreeNode*)>& visitor)
600+
void Tree::applyVisitor(const std::function<void(const TreeNode*)>& visitor) const
601601
{
602602
BT::applyRecursiveVisitor(static_cast<const TreeNode*>(rootNode()), visitor);
603603
}

0 commit comments

Comments
 (0)