From ce9f4bc66fd7cc46612d91c8355e4096be7a9546 Mon Sep 17 00:00:00 2001 From: Jonathan Hanks <jonathan.hanks@ligo.org> Date: Tue, 10 Nov 2020 11:34:50 -0800 Subject: [PATCH] Removing some C++14isms from cps_recv's admin code. Removing lambda capture initializers as they are C++14 and we are building C++11 for now. --- src/pub_sub_stream/cps_recv_admin.cc | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/pub_sub_stream/cps_recv_admin.cc b/src/pub_sub_stream/cps_recv_admin.cc index bad99e0fa..8423c55b4 100644 --- a/src/pub_sub_stream/cps_recv_admin.cc +++ b/src/pub_sub_stream/cps_recv_admin.cc @@ -79,12 +79,12 @@ namespace cps_admin read_request( ) { req_ = {}; + auto self = shared_from_this( ); http::async_read( s_, buffer_, req_, - [self = shared_from_this( )]( - const boost::system::error_code& ec, - std::size_t bytes_transferred ) { + [self]( const boost::system::error_code& ec, + std::size_t bytes_transferred ) { if ( ec ) { return; @@ -105,13 +105,14 @@ namespace cps_admin auto resp_ptr = std::make_shared< response_type >( std::move( resp ) ); resp_ptr->keep_alive( false ); - http::async_write( s_, - *resp_ptr, - [self = shared_from_this( ), resp_ptr]( - const boost::system::error_code& ec, - std::size_t bytes_transferred ) { - // let it close. - } ); + auto self = shared_from_this( ); + http::async_write( + s_, + *resp_ptr, + [self, resp_ptr]( const boost::system::error_code& ec, + std::size_t bytes_transferred ) { + // let it close. + } ); } /*! -- GitLab