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

Function shrink

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

@b DynamicBuffer_v2: Shrink the underlying memory by the specified number of bytes. * Erases @c n bytes from the end of the string by resizing the basic_string * object. If @c n is greater than the current size of the string, the string * is emptied. */

Source from the content-addressed store, hash-verified

1949 * is emptied.
1950 */
1951 void shrink(std::size_t n)
1952 {
1953 string_.resize(n > size() ? 0 : size() - n);
1954 }
1955
1956 /// @b DynamicBuffer_v1: Remove characters from the input sequence.
1957 /// @b DynamicBuffer_v2: Consume the specified number of bytes from the

Callers

nothing calls this directly

Calls 2

sizeFunction · 0.70
resizeMethod · 0.45

Tested by

no test coverage detected