This is an automated email from the ASF dual-hosted git repository.

mzhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new fc0069b  Fixed a compilation issue due to const capture in a lambda.
fc0069b is described below

commit fc0069ba639cb82c6bebb9893dc67caef7d81b50
Author: Meng Zhu <[email protected]>
AuthorDate: Mon Nov 4 17:10:24 2019 -0800

    Fixed a compilation issue due to const capture in a lambda.
    
    MSVC on Windows requires explicit capture of const expression
    while clang on Mac complains about such capture.
    
    This patch removes the const qualifier and capture the non-const
    variable so that both can be happy.
---
 src/tests/hierarchical_allocator_tests.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/tests/hierarchical_allocator_tests.cpp 
b/src/tests/hierarchical_allocator_tests.cpp
index eea194a..af99539 100644
--- a/src/tests/hierarchical_allocator_tests.cpp
+++ b/src/tests/hierarchical_allocator_tests.cpp
@@ -8449,9 +8449,9 @@ 
TEST_P(HierarchicalAllocator__BENCHMARK_WithResourceParam, UpdateAllocation)
 
   // We introduce a level of role hierarchy here. Each role will be
   // "parent_role/role-[random letters with childRoleLength]".
-  const size_t childRoleLength = 36u;
+  size_t childRoleLength = 36u;
   vector<string> roles(param.roleCount);
-  std::generate(roles.begin(), roles.end(), [&randString]() {
+  std::generate(roles.begin(), roles.end(), [&childRoleLength, &randString]() {
     return "role-" + randString(childRoleLength);
   });
 

Reply via email to