From 929e8091dcd32c38cb51c1d070e9f72040eedb6a Mon Sep 17 00:00:00 2001 From: lisyarus Date: Wed, 7 Feb 2024 14:14:13 +0300 Subject: [PATCH] Fix perfect forwarding in constructor args in util::pathfinder --- libs/util/include/psemek/util/find_path.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/util/include/psemek/util/find_path.hpp b/libs/util/include/psemek/util/find_path.hpp index 7fbbe995..798f1e69 100644 --- a/libs/util/include/psemek/util/find_path.hpp +++ b/libs/util/include/psemek/util/find_path.hpp @@ -39,10 +39,11 @@ namespace psemek::util util::hash_map previous; std::set queue; - pathfinder(NeighboursFn && node_neighbours, HeuristicFn && heuristic, EdgeCallback && edge_callback) - : node_neighbours(std::forward(node_neighbours)) - , heuristic(std::forward(heuristic)) - , edge_callback(std::forward(edge_callback)) + template + pathfinder(NeighboursFn1 && node_neighbours, HeuristicFn1 && heuristic, EdgeCallback1 && edge_callback) + : node_neighbours(std::forward(node_neighbours)) + , heuristic(std::forward(heuristic)) + , edge_callback(std::forward(edge_callback)) , queue(node_compare{priority}) {}