MCPcopy Create free account
hub / github.com/cinder/Cinder / consume

Function consume

include/asio/buffer.hpp:1792–1804  ·  view source on GitHub ↗

@b DynamicBuffer_v1: Remove characters from the input sequence. @b DynamicBuffer_v2: Consume the specified number of bytes from the beginning of the underlying memory. * @b DynamicBuffer_v1: Removes @c n characters from the beginning of the * input sequence. @note If @c n is greater than the size of the input * sequence, the entire input sequence is consumed and no error is issued. * *

Source from the content-addressed store, hash-verified

1790 * emptied.
1791 */
1792 void consume(std::size_t n)
1793 {
1794#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
1795 if (size_ != (std::numeric_limits<std::size_t>::max)())
1796 {
1797 std::size_t consume_length = (std::min)(n, size_);
1798 string_.erase(0, consume_length);
1799 size_ -= consume_length;
1800 return;
1801 }
1802#endif // !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
1803 string_.erase(0, n);
1804 }
1805
1806private:
1807 std::basic_string<Elem, Traits, Allocator>& string_;

Callers

nothing calls this directly

Calls 3

sizeFunction · 0.50
eraseMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected