Fix MSVC error
authorFabian Fichter <ianfab@users.noreply.github.com>
Sat, 15 Dec 2018 17:02:24 +0000 (18:02 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sat, 15 Dec 2018 17:05:40 +0000 (18:05 +0100)
Explicitly capture compile-time variable in lambda expression.

No function change.

src/evaluate.cpp

index 7bebf7a..ce42ebc 100644 (file)
@@ -469,7 +469,7 @@ namespace {
         safe  = ~pos.pieces(Them);
         safe &= ~attackedBy[Us][ALL_PIECES] | (weak & attackedBy2[Them]);
 
-        std::function <Bitboard (PieceType)> get_attacks = [this](PieceType pt) {
+        std::function <Bitboard (PieceType)> 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())