MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / grow

Function grow

3rd/asio-1.24.0/include/asio/buffer.hpp:1933–1942  ·  view source on GitHub ↗

@b DynamicBuffer_v2: Grow the underlying memory by the specified number of bytes. * Resizes the string to accommodate an additional @c n bytes at the end. * * @throws std::length_error If size() + n > max_size() . */

Source from the content-addressed store, hash-verified

1931 * @throws std::length_error If <tt>size() + n > max_size()</tt>.
1932 */
1933 void grow(std::size_t n)
1934 {
1935 if (size() > max_size() || max_size() - size() < n)
1936 {
1937 std::length_error ex("dynamic_string_buffer too long");
1938 asio::detail::throw_exception(ex);
1939 }
1940
1941 string_.resize(size() + n);
1942 }
1943
1944 /// @b DynamicBuffer_v2: Shrink the underlying memory by the specified number
1945 /// of bytes.

Callers

nothing calls this directly

Calls 4

throw_exceptionFunction · 0.85
sizeFunction · 0.70
max_sizeFunction · 0.70
resizeMethod · 0.45

Tested by

no test coverage detected