MutableBufferSequence.qbk 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. [/
  2. / Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  3. /
  4. / Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. /]
  7. [section:MutableBufferSequence Mutable buffer sequence requirements]
  8. A ['mutable buffer sequence] represents a set of memory regions that may be
  9. used to receive the output of an operation, such as the `receive` operation of
  10. a socket.
  11. A type `X` meets the `MutableBufferSequence` requirements if it satisfies the
  12. requirements of `Destructible` (C++Std [destructible]) and
  13. `CopyConstructible` (C++Std [copyconstructible]), as well as the additional
  14. requirements listed below.
  15. In the table below, `x` denotes a (possibly const) value of type `X`, and `u`
  16. denotes an identifier.
  17. [table MutableBufferSequence requirements
  18. [[expression] [return type] [assertion/note\npre/post-condition]]
  19. [
  20. [`boost::asio::buffer_sequence_begin(x)`\n
  21. `boost::asio::buffer_sequence_end(x)`]
  22. [An iterator type meeting the requirements for bidirectional iterators
  23. (C++Std \[bidirectional.iterators\]) whose value type is convertible to
  24. `mutable_buffer`.]
  25. []
  26. ]
  27. [
  28. [``
  29. X u(x);
  30. ``]
  31. []
  32. [post:\n
  33. ``
  34. equal(
  35. boost::asio::buffer_sequence_begin(x),
  36. boost::asio::buffer_sequence_end(x),
  37. boost::asio::buffer_sequence_begin(u),
  38. boost::asio::buffer_sequence_end(u),
  39. [](const mutable_buffer& b1,
  40. const mutable_buffer& b2)
  41. {
  42. return b1.data() == b2.data()
  43. && b1.size() == b2.size();
  44. })
  45. ``]
  46. ]
  47. ]
  48. [endsect]