Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

Buffer-oriented asynchronous random-access write device requirements

In the table below, a denotes an asynchronous write stream object, o denotes an offset of type boost::uint64_t, cb denotes an object satisfying constant buffer sequence requirements, and h denotes an object satisfying write handler requirements.

Table 2. Buffer-oriented asynchronous random-access write device requirements



semantics, pre/post-conditions



Returns the io_service object through which the async_write_some_at handler h will be invoked.

a.async_write_some_at(o, cb, h);


Initiates an asynchronous operation to write one or more bytes of data to the device a at offset o. The operation is performed via the io_service object a.get_io_service() and behaves according to asynchronous operation requirements.

The constant buffer sequence cb specifies memory where the data to be written is located. The async_write_some_at operation shall always write a buffer in the sequence completely before proceeding to the next.

The implementation shall maintain one or more copies of cb until such time as the write operation no longer requires access to the memory specified by the buffers in the sequence. The program must ensure the memory is valid until:

— the last copy of cb is destroyed, or

— the handler for the asynchronous write operation is invoked,

whichever comes first.

If the total size of all buffers in the sequence cb is 0, the asynchronous write operation shall complete immediately and pass 0 as the argument to the handler that specifies the number of bytes written.