Summary:
Because MSVC doesn't like it when you attempt to explicitly capture a c-style array in a lambda capture list.
See: https://developercommunity.visualstudio.com/content/problem/2444/cannot-explicitly-capture-c-style-array-in-lambda.html
Reviewed By: yfeldblum
Differential Revision:
D4191400
fbshipit-source-id:
305f8086c29f079ccf2c322f20da6393235bc76d
auto unique_ptr_int = folly::make_unique<int>(900);
EXPECT_EQ(900, *unique_ptr_int);
- char fooData[64] = {0};
- EXPECT_EQ(0, fooData[0]); // suppress gcc warning about fooData not being used
+ struct {
+ char data[64];
+ } fooData = {{0}};
+ (void)fooData; // suppress gcc warning about fooData not being used
auto functor = std::bind(
[fooData](std::unique_ptr<int>& up) mutable { return ++*up; },