ConstBufferSequence.qbk 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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:ConstBufferSequence Constant buffer sequence requirements]
  8. A ['constant buffer sequence] represents a set of memory regions that may be
  9. used as input to an operation, such as the `send` operation of a socket.
  10. A type `X` meets the `ConstBufferSequence` requirements if it satisfies the
  11. requirements of `Destructible` (C++Std [destructible]) and
  12. `CopyConstructible` (C++Std [copyconstructible]), as well as the additional
  13. requirements listed below.
  14. In the table below, `x` denotes a (possibly const) value of type `X`, and `u`
  15. denotes an identifier.
  16. [table ConstBufferSequence requirements
  17. [[expression] [return type] [assertion/note\npre/post-condition]]
  18. [
  19. [`boost::asio::buffer_sequence_begin(x)`\n
  20. `boost::asio::buffer_sequence_end(x)`]
  21. [An iterator type meeting the requirements for bidirectional iterators
  22. (C++Std \[bidirectional.iterators\]) whose value type is convertible to
  23. `const_buffer`.]
  24. []
  25. ]
  26. [
  27. [``
  28. X u(x);
  29. ``]
  30. []
  31. [post:\n
  32. ``
  33. equal(
  34. boost::asio::buffer_sequence_begin(x),
  35. boost::asio::buffer_sequence_end(x),
  36. boost::asio::buffer_sequence_begin(u),
  37. boost::asio::buffer_sequence_end(u),
  38. [](const const_buffer& b1,
  39. const const_buffer& b2)
  40. {
  41. return b1.data() == b2.data()
  42. && b1.size() == b2.size();
  43. })
  44. ``]
  45. ]
  46. ]
  47. [endsect]