Summary: As the `sizeof()` is being evaluated in a static context, MSVC doesn't let you reference non-static locals. Solve the issue by getting the type of the local via `decltype` instead.
Reviewed By: yfeldblum
Differential Revision:
D3600845
fbshipit-source-id:
825d93ced8f09d9f4bf0dcf02142f47a0ec32605
// socket, even if the maxReadsPerEvent_ is hit during
// a event loop iteration.
static constexpr size_t kMaxReadsPerEvent = 2;
+ // 2 event loop iterations
static constexpr size_t kMaxReadBufferSz =
- sizeof(readbuf_) / kMaxReadsPerEvent / 2; // 2 event loop iterations
+ sizeof(decltype(readbuf_)) / kMaxReadsPerEvent / 2;
public:
SSLClient(EventBase *eventBase,