From 234217e6cc653d39036d4258bb914410cebde806 Mon Sep 17 00:00:00 2001 From: Eric Mertens Date: Sun, 27 Nov 2022 11:54:47 -0800 Subject: [PATCH] fix reference to popped queue element --- 2019/20.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2019/20.cpp b/2019/20.cpp index 5c0321f..ef2235b 100644 --- a/2019/20.cpp +++ b/2019/20.cpp @@ -128,7 +128,7 @@ auto SolveMaze(Distances const& distances, bool const recursive) -> std::int64_t todo.emplace(0, 0, "-AA"); while(!todo.empty()) { - auto const& [steps, depth, name] = todo.top(); + auto const [steps, depth, name] = std::move(todo.top()); todo.pop(); if (name == "-ZZ") { return steps; } if (seen.emplace(depth, name).second) {