Opened 4 years ago

Last modified 4 years ago

#13564 new Bugs

Compile error of asio::async_read_until

Reported by: Vincent Lextrait <vincent.lextrait@…> Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost 1.67.0 Severity: Problem
Keywords: Cc:

Description

I have a new compile error after moving from asio in 1.65.1 to asio in 1.67.0. Same code which compiled fine before. async_read_until uses read_until_delim_string_op in read_until.hpp, and the ctor has been rewritten in 67.0. It seems to want now to copy the buffer in the first constructor. Buffers are non copyable, so there is a compile error.

The 67.0 ctor is now a template:

template <typename BufferSequence> read_until_delim_string_op(AsyncReadStream& stream,

BOOST_ASIO_MOVE_ARG(BufferSequence) buffers, const std::string& delim, ReadHandler& handler)

: stream_(stream),

buffers_(BOOST_ASIO_MOVE_CAST(BufferSequence)(buffers)), delim_(delim), start_(0), search_position_(0), handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))

{ }

In 65.1 the ctor was:

read_until_delim_op(AsyncReadStream& stream,

boost::asio::basic_streambuf<Allocator>& streambuf, char delim, ReadHandler& handler)

: stream_(stream),

streambuf_(streambuf), delim_(delim), start_(0), search_position_(0), handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))

I have gcc 8.1. Not sure if this is a bug (it sounds like it), therefore logging this as "Support Request" for now.

Change History (3)

comment:1 by anonymous, 4 years ago

Type: Support RequestsBugs

comment:2 by anonymous, 4 years ago

Upgrading to a "bug" as no answer after 7 weeks.

comment:3 by anonymous, 4 years ago

Here is the compilation error reported by LLVM (which does report an issue, like g++-8):

In file included from /usr/local/include/boost/asio.hpp:113: In file included from /usr/local/include/boost/asio/read_until.hpp:1824: /usr/local/include/boost/asio/impl/read_until.hpp:680:9: error: call to implicitly-deleted copy constructor of 'hx2a::tcp::streambuf'

buffers_(BOOST_ASIO_MOVE_CAST(BufferSequence)(buffers)), ~

/usr/local/include/boost/asio/impl/read_until.hpp:912:3: note: in instantiation of function template specialization 'boost::asio::detail ::read_until_delim_string_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp>, hx2a::tcp::streambuf, (lambda at /usr/local/hx2a/C+ +/public/include/hx2a/couchdb.hpp:511:6)>::read_until_delim_string_op<hx2a::tcp::streambuf &>' requested here

detail::read_until_delim_string_op<AsyncReadStream,

Note: See TracTickets for help on using tickets.