From 3e0c28fdd95f7ec7950d220a03d0c0e5d3a23bd0 Mon Sep 17 00:00:00 2001 From: Christopher Dykes Date: Fri, 7 Apr 2017 21:15:44 -0700 Subject: [PATCH] Qualify a couple local constexpr values as 'static' to allow use from within non-capturing lambdas Summary: MSVC doesn't allow non-static locals to be accessed within a non-capturing lambda, and some were introduced into the json code. Reviewed By: yfeldblum Differential Revision: D4856242 fbshipit-source-id: b2db36ca37a79a41237d39cc7e7b839a5416922f --- folly/json.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/folly/json.cpp b/folly/json.cpp index ae2f2937..ee56f0b1 100644 --- a/folly/json.cpp +++ b/folly/json.cpp @@ -615,8 +615,8 @@ std::string serialize(dynamic const& dyn, serialization_opts const& opts) { template size_t firstEscapableInWord(T s) { static_assert(std::is_unsigned::value, "Unsigned integer required"); - constexpr T kOnes = ~T() / 255; // 0x...0101 - constexpr T kMsbs = kOnes * 0x80; // 0x...8080 + static constexpr T kOnes = ~T() / 255; // 0x...0101 + static constexpr T kMsbs = kOnes * 0x80; // 0x...8080 // Sets the MSB of bytes < b. Precondition: b < 128. auto isLess = [](T w, uint8_t b) { -- 2.34.1