summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/asio/src/doc/requirements/MutableBufferSequence.qbk
blob: 7683a682ec6793b0af6a17f04a055daa01740ea1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
[/
 / Copyright (c) 2003-2016 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:MutableBufferSequence Mutable buffer sequence requirements]

A ['mutable buffer sequence] represents a set of memory regions that may be
used to receive the output of an operation, such as the `receive` operation of
a socket.

A type `X` meets the `MutableBufferSequence` 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 MutableBufferSequence requirements
  [[expression] [return type] [assertion/note\npre/post-condition]]
  [
    [`asio::buffer_sequence_begin(x)`\n
     `asio::buffer_sequence_end(x)`]
    [An iterator type meeting the requirements for bidirectional iterators
     (C++Std \[bidirectional.iterators\]) whose value type is convertible to
     `mutable_buffer`.]
    []
  ]
  [
    [``
      X u(x);
    ``]
    []
    [post:\n
     ``
       equal(
         asio::buffer_sequence_begin(x),
         asio::buffer_sequence_end(x),
         asio::buffer_sequence_begin(u),
         asio::buffer_sequence_end(u),
         [](const typename X::value_type& v1,
            const typename X::value_type& v2)
          {
            mutable_buffer b1(v1);
            mutable_buffer b2(v2);
            return b1.data() == b2.data()
                && b1.size() == b2.size();
          })
     ``]
  ]
]

[endsect]