[Boost-bugs] [Boost C++ Libraries] #4746: Read operations incorrectly accept ConstBufferSequences

Subject: [Boost-bugs] [Boost C++ Libraries] #4746: Read operations incorrectly accept ConstBufferSequences
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-10-17 21:21:05


#4746: Read operations incorrectly accept ConstBufferSequences
------------------------------+---------------------------------------------
 Reporter: chris_kohlhoff | Owner: chris_kohlhoff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
  Version: Boost 1.44.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------------------------------
 In Asio 1.4.6 / Boost 1.44, following program compiles when it shouldn't:

 {{{
 #include <boost/asio.hpp>
 #include <string>
 #include <vector>

 void handler(boost::system::error_code, std::size_t) {}

 int main()
 {
   boost::asio::io_service io_service;
   boost::asio::ip::tcp::socket sock(io_service);

   boost::asio::const_buffers_1 cb1(0, 0);
   sock.read_some(cb1);
   sock.async_read_some(cb1, handler);

   std::string s;
   sock.read_some(boost::asio::buffer(s));
   sock.async_read_some(boost::asio::buffer(s), handler);

   const std::vector<char> v;
   sock.read_some(boost::asio::buffer(v));
   sock.async_read_some(boost::asio::buffer(v), handler);
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4746>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:04 UTC