[ 
https://issues.apache.org/jira/browse/ARROW-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16368636#comment-16368636
 ] 

ASF GitHub Bot commented on ARROW-2169:
---------------------------------------

cpcloud closed pull request #1622: ARROW-2169: [C++] MSVC is complaining about 
uncaptured variables
URL: https://github.com/apache/arrow/pull/1622
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/cpp/src/arrow/array-test.cc b/cpp/src/arrow/array-test.cc
index d68b04dc3..1d321e677 100644
--- a/cpp/src/arrow/array-test.cc
+++ b/cpp/src/arrow/array-test.cc
@@ -1273,7 +1273,7 @@ class TestFWBinaryArray : public ::testing::Test {
 };
 
 TEST_F(TestFWBinaryArray, Builder) {
-  constexpr int32_t byte_width = 10;
+  int32_t byte_width = 10;
   int64_t length = 4096;
 
   int64_t nbytes = length * byte_width;
@@ -1288,7 +1288,7 @@ TEST_F(TestFWBinaryArray, Builder) {
 
   std::shared_ptr<Array> result;
 
-  auto CheckResult = [&length, &is_valid, &raw_data](const Array& result) {
+  auto CheckResult = [&length, &is_valid, &raw_data, &byte_width](const Array& 
result) {
     // Verify output
     const auto& fw_result = static_cast<const FixedSizeBinaryArray&>(result);
 
diff --git a/cpp/src/arrow/io/io-file-test.cc b/cpp/src/arrow/io/io-file-test.cc
index a492016eb..7a7f39636 100644
--- a/cpp/src/arrow/io/io-file-test.cc
+++ b/cpp/src/arrow/io/io-file-test.cc
@@ -393,9 +393,9 @@ TEST_F(TestReadableFile, ThreadSafety) {
   ASSERT_OK(ReadableFile::Open(path_, &pool, &file_));
 
   std::atomic<int> correct_count(0);
-  constexpr int niter = 10000;
+  int niter = 10000;
 
-  auto ReadData = [&correct_count, &data, this]() {
+  auto ReadData = [&correct_count, &data, &niter, this]() {
     std::shared_ptr<Buffer> buffer;
 
     for (int i = 0; i < niter; ++i) {
@@ -586,9 +586,9 @@ TEST_F(TestMemoryMappedFile, ThreadSafety) {
   ASSERT_OK(file->Write(data.c_str(), static_cast<int64_t>(data.size())));
 
   std::atomic<int> correct_count(0);
-  constexpr int niter = 10000;
+  int niter = 10000;
 
-  auto ReadData = [&correct_count, &data, &file]() {
+  auto ReadData = [&correct_count, &data, &file, &niter]() {
     std::shared_ptr<Buffer> buffer;
 
     for (int i = 0; i < niter; ++i) {
diff --git a/cpp/src/arrow/io/io-hdfs-test.cc b/cpp/src/arrow/io/io-hdfs-test.cc
index 380fb34e8..610a91fbc 100644
--- a/cpp/src/arrow/io/io-hdfs-test.cc
+++ b/cpp/src/arrow/io/io-hdfs-test.cc
@@ -452,9 +452,9 @@ TYPED_TEST(TestHadoopFileSystem, ThreadSafety) {
   ASSERT_OK(this->client_->OpenReadable(src_path, &file));
 
   std::atomic<int> correct_count(0);
-  constexpr int niter = 1000;
+  int niter = 1000;
 
-  auto ReadData = [&file, &correct_count, &data]() {
+  auto ReadData = [&file, &correct_count, &data, &niter]() {
     for (int i = 0; i < niter; ++i) {
       std::shared_ptr<Buffer> buffer;
       if (i % 2 == 0) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [C++] MSVC is complaining about uncaptured variables
> ----------------------------------------------------
>
>                 Key: ARROW-2169
>                 URL: https://issues.apache.org/jira/browse/ARROW-2169
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>    Affects Versions: 0.8.0
>            Reporter: Phillip Cloud
>            Assignee: Phillip Cloud
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.9.0
>
>
> Fix up shortly.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to