1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Constant buffer sequence requirements</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="../reference.html" title="Reference"> 9<link rel="prev" href="ConnectHandler.html" title="Connect handler requirements"> 10<link rel="next" href="DynamicBuffer.html" title="Dynamic buffer requirements"> 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="ConnectHandler.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.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="DynamicBuffer.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h3 class="title"> 27<a name="boost_asio.reference.ConstBufferSequence"></a><a class="link" href="ConstBufferSequence.html" title="Constant buffer sequence requirements">Constant buffer 28 sequence requirements</a> 29</h3></div></div></div> 30<p> 31 A <span class="emphasis"><em>constant buffer sequence</em></span> represents a set of memory 32 regions that may be used as input to an operation, such as the <code class="computeroutput">send</code> 33 operation of a socket. 34 </p> 35<p> 36 A type <code class="computeroutput">X</code> meets the <code class="computeroutput">ConstBufferSequence</code> requirements 37 if it satisfies the requirements of <code class="computeroutput">Destructible</code> (C++Std [destructible]) 38 and <code class="computeroutput">CopyConstructible</code> (C++Std [copyconstructible]), as well 39 as the additional requirements listed below. 40 </p> 41<p> 42 In the table below, <code class="computeroutput">x</code> denotes a (possibly const) value of type 43 <code class="computeroutput">X</code>, and <code class="computeroutput">u</code> denotes an identifier. 44 </p> 45<div class="table"> 46<a name="boost_asio.reference.ConstBufferSequence.t0"></a><p class="title"><b>Table 8. ConstBufferSequence requirements</b></p> 47<div class="table-contents"><table class="table" summary="ConstBufferSequence requirements"> 48<colgroup> 49<col> 50<col> 51<col> 52</colgroup> 53<thead><tr> 54<th> 55 <p> 56 expression 57 </p> 58 </th> 59<th> 60 <p> 61 return type 62 </p> 63 </th> 64<th> 65 <p> 66 assertion/note<br> pre/post-condition 67 </p> 68 </th> 69</tr></thead> 70<tbody> 71<tr> 72<td> 73 <p> 74 <code class="computeroutput">boost::asio::buffer_sequence_begin(x)</code><br> <code class="computeroutput">boost::asio::buffer_sequence_end(x)</code> 75 </p> 76 </td> 77<td> 78 <p> 79 An iterator type meeting the requirements for bidirectional iterators 80 (C++Std [bidirectional.iterators]) whose value type is convertible 81 to <code class="computeroutput">const_buffer</code>. 82 </p> 83 </td> 84<td> 85 </td> 86</tr> 87<tr> 88<td> 89 <p> 90</p> 91<pre class="programlisting">X u(x); 92</pre> 93<p> 94 </p> 95 </td> 96<td> 97 </td> 98<td> 99 <p> 100 post:<br> 101</p> 102<pre class="programlisting">equal( 103 boost::asio::buffer_sequence_begin(x), 104 boost::asio::buffer_sequence_end(x), 105 boost::asio::buffer_sequence_begin(u), 106 boost::asio::buffer_sequence_end(u), 107 [](const const_buffer& b1, 108 const const_buffer& b2) 109 { 110 return b1.data() == b2.data() 111 && b1.size() == b2.size(); 112 }) 113</pre> 114<p> 115 </p> 116 </td> 117</tr> 118</tbody> 119</table></div> 120</div> 121<br class="table-break"> 122</div> 123<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 124<td align="left"></td> 125<td align="right"><div class="copyright-footer">Copyright © 2003-2020 Christopher M. 126 Kohlhoff<p> 127 Distributed under the Boost Software License, Version 1.0. (See accompanying 128 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>) 129 </p> 130</div></td> 131</tr></table> 132<hr> 133<div class="spirit-nav"> 134<a accesskey="p" href="ConnectHandler.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.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="DynamicBuffer.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 135</div> 136</body> 137</html> 138