From: Fabian Fichter Date: Sat, 15 Dec 2018 17:02:24 +0000 (+0100) Subject: Fix MSVC error X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=c80eddc419254379deeb8db740e6d1360c46549d;p=fairystockfish.git Fix MSVC error Explicitly capture compile-time variable in lambda expression. No function change. --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 7bebf7a..ce42ebc 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -469,7 +469,7 @@ namespace { safe = ~pos.pieces(Them); safe &= ~attackedBy[Us][ALL_PIECES] | (weak & attackedBy2[Them]); - std::function get_attacks = [this](PieceType pt) { + std::function get_attacks = [this, Them](PieceType pt) { return attackedBy[Them][pt] | (pos.captures_to_hand() && pos.count_in_hand(Them, pt) ? ~pos.pieces() : 0); }; for (PieceType pt : pos.piece_types())