From b379ba22686443b1f82d385dd05572594f025882 Mon Sep 17 00:00:00 2001 From: v4hn Date: Tue, 6 Nov 2018 12:11:37 +0100 Subject: [PATCH] fix broken rvalue-forward & SerialContainer assert Release mode builds previously produced broken solutions with too many entries, debug build triggered the assert container.cpp:334: assert(solution.empty()) The standard guarantees std::vector(&&a) leaves a.empty() == true, so the logic there is fine as long as subsolutions is actually used for move-construction. --- core/include/moveit/task_constructor/storage.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/include/moveit/task_constructor/storage.h b/core/include/moveit/task_constructor/storage.h index 55079bbf..a07fb3fb 100644 --- a/core/include/moveit/task_constructor/storage.h +++ b/core/include/moveit/task_constructor/storage.h @@ -300,7 +300,7 @@ public: : SolutionBase() {} SolutionSequence(container_type&& subsolutions, double cost = 0.0, StagePrivate* creator = nullptr) - : SolutionBase(creator, cost), subsolutions_(subsolutions) + : SolutionBase(creator, cost), subsolutions_(std::move(subsolutions)) {} void push_back(const SolutionBase& solution);