54 lines
1.6 KiB
Plaintext
54 lines
1.6 KiB
Plaintext
[/
|
|
/ Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
|
/
|
|
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
/]
|
|
|
|
[section:ConstBufferSequence Constant buffer sequence requirements]
|
|
|
|
A ['constant buffer sequence] represents a set of memory regions that may be
|
|
used as input to an operation, such as the `send` operation of a socket.
|
|
|
|
A type `X` meets the `ConstBufferSequence` requirements if it satisfies the
|
|
requirements of `Destructible` (C++Std [destructible]) and
|
|
`CopyConstructible` (C++Std [copyconstructible]), as well as the additional
|
|
requirements listed below.
|
|
|
|
In the table below, `x` denotes a (possibly const) value of type `X`, and `u`
|
|
denotes an identifier.
|
|
|
|
[table ConstBufferSequence requirements
|
|
[[expression] [return type] [assertion/note\npre/post-condition]]
|
|
[
|
|
[`boost::asio::buffer_sequence_begin(x)`\n
|
|
`boost::asio::buffer_sequence_end(x)`]
|
|
[An iterator type meeting the requirements for bidirectional iterators
|
|
(C++Std \[bidirectional.iterators\]) whose value type is convertible to
|
|
`const_buffer`.]
|
|
[]
|
|
]
|
|
[
|
|
[``
|
|
X u(x);
|
|
``]
|
|
[]
|
|
[post:\n
|
|
``
|
|
equal(
|
|
boost::asio::buffer_sequence_begin(x),
|
|
boost::asio::buffer_sequence_end(x),
|
|
boost::asio::buffer_sequence_begin(u),
|
|
boost::asio::buffer_sequence_end(u),
|
|
[](const const_buffer& b1,
|
|
const const_buffer& b2)
|
|
{
|
|
return b1.data() == b2.data()
|
|
&& b1.size() == b2.size();
|
|
})
|
|
``]
|
|
]
|
|
]
|
|
|
|
[endsect]
|