From 6d8a3f7dc0349d1289bf7d90cad017ada7e11116 Mon Sep 17 00:00:00 2001 From: Karma Riuk Date: Thu, 6 Feb 2025 10:55:25 +0100 Subject: [PATCH] made lambda capture values by reference, not by value --- cpp/src/ais/v1_simple.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cpp/src/ais/v1_simple.cpp b/cpp/src/ais/v1_simple.cpp index b3b9fb8..e848dfb 100644 --- a/cpp/src/ais/v1_simple.cpp +++ b/cpp/src/ais/v1_simple.cpp @@ -16,11 +16,9 @@ std::string ai::v1_simple::search(std::string pos, int depth) { std::map> futures; for (const Move& move : moves) { Board tmp_board = b.make_move(move); - futures.insert( - {move.to_string(), pool.enqueue([this, tmp_board, depth]() { - return minimax(tmp_board, depth - 1); - })} - ); + futures.insert({move.to_string(), pool.enqueue([&]() { + return minimax(tmp_board, depth - 1); + })}); } std::string best_move;