From aa085b7e7d3c470f8a577017e855361cce1f2a98 Mon Sep 17 00:00:00 2001 From: Isar Meijer <44964944+Isarm@users.noreply.github.com> Date: Tue, 25 Feb 2025 10:25:12 +0100 Subject: [PATCH] Add const to applyVisitor (#935) --- include/behaviortree_cpp/bt_factory.h | 2 +- src/bt_factory.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/behaviortree_cpp/bt_factory.h b/include/behaviortree_cpp/bt_factory.h index b0cb61f53..c20385b3b 100644 --- a/include/behaviortree_cpp/bt_factory.h +++ b/include/behaviortree_cpp/bt_factory.h @@ -149,7 +149,7 @@ class Tree [[nodiscard]] Blackboard::Ptr rootBlackboard(); //Call the visitor for each node of the tree. - void applyVisitor(const std::function& visitor); + void applyVisitor(const std::function& visitor) const; //Call the visitor for each node of the tree. void applyVisitor(const std::function& visitor); diff --git a/src/bt_factory.cpp b/src/bt_factory.cpp index 22d4167ec..f66c3661f 100644 --- a/src/bt_factory.cpp +++ b/src/bt_factory.cpp @@ -597,7 +597,7 @@ Blackboard::Ptr Tree::rootBlackboard() return {}; } -void Tree::applyVisitor(const std::function& visitor) +void Tree::applyVisitor(const std::function& visitor) const { BT::applyRecursiveVisitor(static_cast(rootNode()), visitor); }