Summary:
Because, as discussed in past diffs, MSVC currently requires them to be static in order to resolve them from within the scope of a lambda when they aren't captured.
The only one that actually needs to be marked as `static` is `numReps`, but I like consistency, so I marked them all as static.
Reviewed By: yfeldblum
Differential Revision:
D4191610
fbshipit-source-id:
7246170f30551d2079b4373eefbf3d02aab6dfa9
#if FOLLY_HAVE_STD_THIS_THREAD_SLEEP_FOR
TEST(ThreadLocal, Stress) {
- constexpr size_t numFillObjects = 250;
+ static constexpr size_t numFillObjects = 250;
std::array<ThreadLocalPtr<FillObject>, numFillObjects> objects;
- constexpr size_t numThreads = 32;
- constexpr size_t numReps = 20;
+ static constexpr size_t numThreads = 32;
+ static constexpr size_t numReps = 20;
std::vector<std::thread> threads;
threads.reserve(numThreads);