Skip to content

Commit 3f5e5dd

Browse files
committed
Fixing MSVC build
1 parent 926003f commit 3f5e5dd

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/rpc/client.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ struct client::impl {
6262
constexpr std::size_t max_read_bytes = default_buffer_size;
6363
writer_->socket_.async_read_some(
6464
RPCLIB_ASIO::buffer(pac_.buffer(), max_read_bytes),
65-
[this](std::error_code ec, std::size_t length) {
65+
// I don't think max_read_bytes needs to be captured explicitly
66+
// (since it's constexpr), but MSVC insists.
67+
[this, max_read_bytes](std::error_code ec, std::size_t length) {
6668
if (!ec) {
6769
LOG_TRACE("Read chunk of size {}", length);
6870
pac_.buffer_consumed(length);

lib/rpc/detail/server_session.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ void server_session::do_read() {
3838
constexpr std::size_t max_read_bytes = default_buffer_size;
3939
socket_.async_read_some(
4040
RPCLIB_ASIO::buffer(pac_.buffer(), default_buffer_size),
41-
read_strand_.wrap([this, self](std::error_code ec, std::size_t length) {
41+
// I don't think max_read_bytes needs to be captured explicitly
42+
// (since it's constexpr), but MSVC insists.
43+
read_strand_.wrap([this, self, max_read_bytes](std::error_code ec,
44+
std::size_t length) {
4245
if (!ec) {
4346
pac_.buffer_consumed(length);
4447
RPCLIB_MSGPACK::unpacked result;

0 commit comments

Comments
 (0)