From a4cc47cd8759738a275507a74ca0b79d2ed8b2b9 Mon Sep 17 00:00:00 2001 From: cryptocode Date: Thu, 16 May 2019 10:19:52 +0200 Subject: [PATCH] Add unnecessary lambda capture to please VS2017 (#1988) --- nano/core_test/socket.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nano/core_test/socket.cpp b/nano/core_test/socket.cpp index 19907f56..667836c1 100644 --- a/nano/core_test/socket.cpp +++ b/nano/core_test/socket.cpp @@ -87,7 +87,9 @@ TEST (socket, concurrent_writes) auto client (clients[0]); for (int i = 0; i < client_count; i++) { - std::thread runner ([&client]() { + // Note: this gives a warning on most compilers because message_count is constexpr and a + // capture isn't needed. However, removing it fails to compile on VS2017 due to a known compiler bug. + std::thread runner ([&client, &message_count]() { for (int i = 0; i < message_count; i++) { auto buff (std::make_shared> ());