Imported Upstream version 1.57.0
[platform/upstream/boost.git] / doc / html / boost_asio / reference / buffer_copy / overload22.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>buffer_copy (22 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.78.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="overload21.html" title="buffer_copy (21 of 30 overloads)">
10 <link rel="next" href="overload23.html" title="buffer_copy (23 of 30 overloads)">
11 </head>
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>
20 </tr></table>
21 <hr>
22 <div class="spirit-nav">
23 <a accesskey="p" href="overload21.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="overload23.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="section">
26 <div class="titlepage"><div><div><h4 class="title">
27 <a name="boost_asio.reference.buffer_copy.overload22"></a><a class="link" href="overload22.html" title="buffer_copy (22 of 30 overloads)">buffer_copy
28         (22 of 30 overloads)</a>
29 </h4></div></div></div>
30 <p>
31           Copies a limited number of bytes from a source buffer to a target buffer.
32         </p>
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_buffers_1</span> <span class="special">&amp;</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">&amp;</span> <span class="identifier">source</span><span class="special">,</span>
36     <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">max_bytes_to_copy</span><span class="special">);</span>
37 </pre>
38 <h6>
39 <a name="boost_asio.reference.buffer_copy.overload22.h0"></a>
40           <span class="phrase"><a name="boost_asio.reference.buffer_copy.overload22.parameters"></a></span><a class="link" href="overload22.html#boost_asio.reference.buffer_copy.overload22.parameters">Parameters</a>
41         </h6>
42 <div class="variablelist">
43 <p class="title"><b></b></p>
44 <dl class="variablelist">
45 <dt><span class="term">target</span></dt>
46 <dd><p>
47                 A modifiable buffer representing the memory region to which the bytes
48                 will be copied.
49               </p></dd>
50 <dt><span class="term">source</span></dt>
51 <dd><p>
52                 A non-modifiable buffer representing the memory region from which
53                 the bytes will be copied.
54               </p></dd>
55 <dt><span class="term">max_bytes_to_copy</span></dt>
56 <dd><p>
57                 The maximum number of bytes to be copied.
58               </p></dd>
59 </dl>
60 </div>
61 <h6>
62 <a name="boost_asio.reference.buffer_copy.overload22.h1"></a>
63           <span class="phrase"><a name="boost_asio.reference.buffer_copy.overload22.return_value"></a></span><a class="link" href="overload22.html#boost_asio.reference.buffer_copy.overload22.return_value">Return
64           Value</a>
65         </h6>
66 <p>
67           The number of bytes copied.
68         </p>
69 <h6>
70 <a name="boost_asio.reference.buffer_copy.overload22.h2"></a>
71           <span class="phrase"><a name="boost_asio.reference.buffer_copy.overload22.remarks"></a></span><a class="link" href="overload22.html#boost_asio.reference.buffer_copy.overload22.remarks">Remarks</a>
72         </h6>
73 <p>
74           The number of bytes copied is the lesser of:
75         </p>
76 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
77 <li class="listitem">
78               <code class="computeroutput"><span class="identifier">buffer_size</span><span class="special">(</span><span class="identifier">target</span><span class="special">)</span></code>
79             </li>
80 <li class="listitem">
81               <code class="computeroutput"><span class="identifier">buffer_size</span><span class="special">(</span><span class="identifier">source</span><span class="special">)</span></code>
82             </li>
83 <li class="listitem">
84               <code class="computeroutput"><span class="identifier">max_bytes_to_copy</span></code>
85             </li>
86 </ul></div>
87 <p>
88           This function is implemented in terms of <code class="computeroutput"><span class="identifier">memcpy</span></code>,
89           and consequently it cannot be used to copy between overlapping memory regions.
90         </p>
91 </div>
92 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
93 <td align="left"></td>
94 <td align="right"><div class="copyright-footer">Copyright &#169; 2003-2014 Christopher M. Kohlhoff<p>
95         Distributed under the Boost Software License, Version 1.0. (See accompanying
96         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>)
97       </p>
98 </div></td>
99 </tr></table>
100 <hr>
101 <div class="spirit-nav">
102 <a accesskey="p" href="overload21.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="overload23.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
103 </div>
104 </body>
105 </html>