Boost C++ Libraries: Ticket #8624: Large objects passed by value https://svn.boost.org/trac10/ticket/8624 <p> In asio/detail/reactive_socket_service_base.hpp: </p> <pre class="wiki">198 template &lt;typename ConstBufferSequence, typename Handler&gt; 199 void async_send(base_implementation_type&amp; impl, 200 const ConstBufferSequence&amp; buffers, CID 10918 (#1-5 of 5): Big parameter passed by value (PASS_BY_VALUE) pass_by_value: Passing parameter handler of type boost::asio::detail::write_op&lt; boost::asio::basic_stream_socket&lt; boost::asio::ip::tcp, boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt;, boost::asio::mutable_buffers_1, boost::asio::detail::transfer_all_t, boost::asio::ssl::detail::io_op&lt; boost::asio::basic_stream_socket&lt; boost::asio::ip::tcp, boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt;, boost::asio::ssl::detail::write_op&lt; boost::asio::detail::consuming_buffers&lt; boost::asio::const_buffer, std::vector&lt;boost::asio::const_buffer&gt; &gt; &gt;, boost::asio::detail::write_op&lt; boost::asio::ssl::stream&lt; boost::asio::basic_stream_socket&lt; boost::asio::ip::tcp, boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt; &gt;, std::vector&lt;boost::asio::const_buffer&gt;, boost::asio::detail::transfer_all_t, boost::function2&lt;void, boost::system::error_code const &amp;, unsigned long&gt; &gt; &gt; &gt; (size 256 bytes) by value. 201 socket_base::message_flags flags, Handler handler) 202 { </pre><p> Same for async_receive. </p> <p> In asio/handler_invoke_hook.hpp: </p> <pre class="wiki">61 template &lt;typename Function&gt; CID 10407 (#1-12 of 12): Big parameter passed by value (PASS_BY_VALUE) pass_by_value: Passing parameter function of type boost::asio::detail::binder2&lt; boost::asio::detail::write_op&lt; boost::asio::basic_stream_socket&lt; boost::asio::ip::tcp, boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt;, std::vector&lt;boost::asio::const_buffer&gt;, boost::asio::detail::transfer_all_t, boost::function2&lt;void, boost::system::error_code const &amp;, unsigned long&gt; &gt;, boost::system::error_code, unsigned long &gt; (size 136 bytes) by value. 62 inline void asio_handler_invoke(Function function, ...) </pre><p> In asio/impl/write.hpp: </p> <pre class="wiki">548 template &lt;typename AsyncWriteStream, typename ConstBufferSequence, 549 typename CompletionCondition, typename WriteHandler&gt; 550 inline write_op&lt;AsyncWriteStream, ConstBufferSequence, 551 CompletionCondition, WriteHandler&gt; 552 make_write_op(AsyncWriteStream&amp; s, const ConstBufferSequence&amp; buffers, CID 10920 (#1-3 of 3): Big parameter passed by value (PASS_BY_VALUE) pass_by_value: Passing parameter handler of type boost::asio::ssl::detail::io_op&lt; boost::asio::basic_stream_socket&lt; boost::asio::ip::tcp, boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt;, boost::asio::ssl::detail::write_op&lt; boost::asio::detail::consuming_buffers&lt; boost::asio::const_buffer, std::vector&lt;boost::asio::const_buffer&gt; &gt; &gt;, boost::asio::detail::write_op&lt; boost::asio::ssl::stream&lt; boost::asio::basic_stream_socket&lt; boost::asio::ip::tcp, boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt; &gt; &gt;, std::vector&lt;boost::asio::const_buffer&gt;, boost::asio::detail::transfer_all_t, boost::function2&lt;void, boost::system::error_code const &amp;, unsigned long&gt; &gt; &gt; (size 224 bytes) by value. 553 CompletionCondition completion_condition, WriteHandler handler) 554 { 555 return write_op&lt;AsyncWriteStream, ConstBufferSequence, CompletionCondition, 556 WriteHandler&gt;(s, buffers, completion_condition, handler); 557 } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8624 Trac 1.4.3 chris_kohlhoff Tue, 01 Oct 2013 10:40:57 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8624#comment:1 https://svn.boost.org/trac10/ticket/8624#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fixes on trunk in <a class="changeset" href="https://svn.boost.org/trac10/changeset/85749" title="Enable the move optimisation (and otherwise eliminate a copy) for ...">[85749]</a> and <a class="changeset" href="https://svn.boost.org/trac10/changeset/85763" title="Eliminate some unnecessary handler copies. ">[85763]</a>. Merged to release in <a class="changeset" href="https://svn.boost.org/trac10/changeset/85838" title="Merge asio from trunk. ...">[85838]</a>. </p> <p> N.B. some copies are unavoidable in C++03 due to the need to obtain a non-const handler object. In C++11 most of these instances can use move construction rather than copy construction. </p> Ticket