Skip to content

Commit 03fb442

Browse files
Remove const qualifier from generate_successors() method in node class and its implementation in my_node class
1 parent bfd9b81 commit 03fb442

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/a_star.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ namespace utils
7474
*
7575
* @return A vector of shared pointers to the successor nodes.
7676
*/
77-
[[nodiscard]] virtual std::vector<std::shared_ptr<node<Tp>>> generate_successors() const = 0;
77+
[[nodiscard]] virtual std::vector<std::shared_ptr<node<Tp>>> generate_successors() = 0;
7878

7979
/**
8080
* @brief Checks if the current node represents a goal state.
@@ -186,7 +186,7 @@ namespace utils
186186
}
187187
}
188188

189-
virtual void retract(const node<Tp> &n) noexcept {}
189+
virtual void retract(const node<Tp> &) noexcept {}
190190

191191
bool go_to(const node<Tp> &target) noexcept
192192
{
@@ -209,7 +209,7 @@ namespace utils
209209
return true;
210210
}
211211

212-
virtual bool apply_transition(const node<Tp> &n) noexcept { return true; }
212+
virtual bool apply_transition(const node<Tp> &) noexcept { return true; }
213213

214214
[[nodiscard]] node<Tp> &current_node() noexcept { return *c_node; }
215215

tests/test_a_star.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class my_node : public utils::node<int>, public std::enable_shared_from_this<my_
1010

1111
[[nodiscard]] int h_cost() const noexcept override { return 0; }
1212

13-
[[nodiscard]] std::vector<std::shared_ptr<utils::node<int>>> generate_successors() const override
13+
[[nodiscard]] std::vector<std::shared_ptr<utils::node<int>>> generate_successors() override
1414
{
1515
std::vector<std::shared_ptr<utils::node<int>>> successors;
1616
if (g_cost() < 10)

0 commit comments

Comments
 (0)