MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / operator+

Function operator+

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

Create a new modifiable buffer that is offset from the start of another. * @relates mutable_buffer */

Source from the content-addressed store, hash-verified

649 * @relates mutable_buffer
650 */
651inline mutable_buffer operator+(const mutable_buffer& b,
652 std::size_t n) ASIO_NOEXCEPT
653{
654 std::size_t offset = n < b.size() ? n : b.size();
655 char* new_data = static_cast<char*>(b.data()) + offset;
656 std::size_t new_size = b.size() - offset;
657 return mutable_buffer(new_data, new_size
658#if defined(ASIO_ENABLE_BUFFER_DEBUGGING)
659 , b.get_debug_check()
660#endif // ASIO_ENABLE_BUFFER_DEBUGGING
661 );
662}
663
664/// Create a new modifiable buffer that is offset from the start of another.
665/**

Callers

nothing calls this directly

Calls 4

mutable_bufferClass · 0.70
const_bufferFunction · 0.70
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected