@b DynamicBuffer_v1: Move bytes from the output sequence to the input sequence. * @param n The number of bytes to append from the start of the output * sequence to the end of the input sequence. The remainder of the output * sequence is discarded. * * Requires a preceding call prepare(x) where x >= n , and * no intervening operations that modify the input or output
| 1971 | * output sequence is moved to the input sequence and no error is issued. |
| 1972 | */ |
| 1973 | void commit(std::size_t n) |
| 1974 | { |
| 1975 | size_ += (std::min)(n, string_.size() - size_); |
| 1976 | string_.resize(size_); |
| 1977 | } |
| 1978 | #endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1) |
| 1979 | |
| 1980 | /// @b DynamicBuffer_v2: Grow the underlying memory by the specified number of |