...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Returns a natural read size or throw if the buffer is full.
Defined in header <boost/beast/core/read_size.hpp>
template< class DynamicBuffer> std::size_t read_size_or_throw( DynamicBuffer& buffer, std::size_t max_size);
This function inspects the capacity, size, and maximum size of the dynamic buffer. Then it computes a natural read size given the passed-in upper limit. It favors a read size that does not require a reallocation, subject to a reasonable minimum to avoid tiny reads.
Name |
Description |
---|---|
|
The dynamic buffer to inspect. |
|
An upper limit on the returned value. |
Type |
Thrown On |
---|---|
|
if |
Convenience header <boost/beast/core.hpp>