diff --git a/include/boost/asio/buffer.hpp b/include/boost/asio/buffer.hpp index 729a31b..2f02c8a 100644 --- a/include/boost/asio/buffer.hpp +++ b/include/boost/asio/buffer.hpp @@ -767,6 +767,16 @@ inline mutable_buffers_1 buffer(void* data, std::size_t size_in_bytes) return mutable_buffers_1(mutable_buffer(data, size_in_bytes)); } +/// Create a new modifiable buffer that represents the given memory range. +/** + * @returns mutable_buffers_1(data, size_in_bytes) + */ +inline mutable_buffers_1 buffer(const char* data, std::size_t size_in_bytes) +{ + return mutable_buffers_1(static_cast(const_cast(data)), size_in_bytes); +} + + /// Create a new non-modifiable buffer that represents the given memory range. /** * @returns const_buffers_1(data, size_in_bytes).