boostorg / boost

Super-project for modularized Boost
https://github.com/boostorg/wiki/wiki/Getting-Started%3A-Overview
Boost Software License 1.0
6.97k stars 1.72k forks source link

Construct asio::mutable_buffer out of span #873

Closed ujos closed 5 months ago

ujos commented 5 months ago

Could you please add an option to create an instance of the boost::asio::mutable_buffer class out of std::span / boost::span?

It is easy to manipulate with the buffer via the span interface. You can do subspan without any reallocations and prepare data ptr/size in a natural way. What is missing is a asio::mutable_buffer constructor that accepts the span.

ujos commented 5 months ago

Please ignore this ticket. It seems users can use boost::asio::buffer() function instead of explicitly create an instance of the mutable_buffer class