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

dynamic_string_buffer::data (2 of 3 overloads)

DynamicBuffer_v2: Get a sequence of buffers that represents the underlying memory.

mutable_buffers_type data(
    std::size_t pos,
    std::size_t n);


Position of the first byte to represent in the buffer sequence


The number of bytes to return in the buffer sequence. If the underlying memory is shorter, the buffer sequence represents as many bytes as are available.

Return Value

An object of type mutable_buffers_type that satisfies MutableBufferSequence requirements, representing the basic_string memory.


The returned object is invalidated by any dynamic_string_buffer or basic_string member function that resizes or erases the string.