3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>buffer_copy (2 of 30 overloads)</title>
5 <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../../../boost_asio.html" title="Boost.Asio">
8 <link rel="up" href="../buffer_copy.html" title="buffer_copy">
9 <link rel="prev" href="overload1.html" title="buffer_copy (1 of 30 overloads)">
10 <link rel="next" href="overload3.html" title="buffer_copy (3 of 30 overloads)">
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
15 <td align="center"><a href="../../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../../more/index.htm">More</a></td>
22 <div class="spirit-nav">
23 <a accesskey="p" href="overload1.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../buffer_copy.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="overload3.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h4 class="title">
27 <a name="boost_asio.reference.buffer_copy.overload2"></a><a class="link" href="overload2.html" title="buffer_copy (2 of 30 overloads)">buffer_copy
28 (2 of 30 overloads)</a>
29 </h4></div></div></div>
31 Copies bytes from a source buffer to a target buffer.
33 <pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">buffer_copy</span><span class="special">(</span>
34 <span class="keyword">const</span> <span class="identifier">mutable_buffer</span> <span class="special">&</span> <span class="identifier">target</span><span class="special">,</span>
35 <span class="keyword">const</span> <span class="identifier">const_buffers_1</span> <span class="special">&</span> <span class="identifier">source</span><span class="special">);</span>
38 <a name="boost_asio.reference.buffer_copy.overload2.h0"></a>
39 <span class="phrase"><a name="boost_asio.reference.buffer_copy.overload2.parameters"></a></span><a class="link" href="overload2.html#boost_asio.reference.buffer_copy.overload2.parameters">Parameters</a>
41 <div class="variablelist">
42 <p class="title"><b></b></p>
43 <dl class="variablelist">
44 <dt><span class="term">target</span></dt>
46 A modifiable buffer representing the memory region to which the bytes
49 <dt><span class="term">source</span></dt>
51 A non-modifiable buffer representing the memory region from which
52 the bytes will be copied.
57 <a name="boost_asio.reference.buffer_copy.overload2.h1"></a>
58 <span class="phrase"><a name="boost_asio.reference.buffer_copy.overload2.return_value"></a></span><a class="link" href="overload2.html#boost_asio.reference.buffer_copy.overload2.return_value">Return
62 The number of bytes copied.
65 <a name="boost_asio.reference.buffer_copy.overload2.h2"></a>
66 <span class="phrase"><a name="boost_asio.reference.buffer_copy.overload2.remarks"></a></span><a class="link" href="overload2.html#boost_asio.reference.buffer_copy.overload2.remarks">Remarks</a>
69 The number of bytes copied is the lesser of:
71 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
73 <code class="computeroutput"><span class="identifier">buffer_size</span><span class="special">(</span><span class="identifier">target</span><span class="special">)</span></code>
76 <code class="computeroutput"><span class="identifier">buffer_size</span><span class="special">(</span><span class="identifier">source</span><span class="special">)</span></code>
80 This function is implemented in terms of <code class="computeroutput"><span class="identifier">memcpy</span></code>,
81 and consequently it cannot be used to copy between overlapping memory regions.
84 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
85 <td align="left"></td>
86 <td align="right"><div class="copyright-footer">Copyright © 2003-2017 Christopher M. Kohlhoff<p>
87 Distributed under the Boost Software License, Version 1.0. (See accompanying
88 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
93 <div class="spirit-nav">
94 <a accesskey="p" href="overload1.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../buffer_copy.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="overload3.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>