Boost logo

Boost :

From: Vinnie Falco (vinnie.falco_at_[hidden])
Date: 2023-01-31 13:12:13


On Tue, Jan 31, 2023 at 2:08 AM Julien Blanc via Boost
<boost_at_[hidden]> wrote:
> That being said, i think we currently have a vocabulary type for
> non-owning non-resizable buffers: it's called span<byte>.

span<byte> is problematic for a few reasons. There's nothing wrong if
users want to use this type to describe a buffer, but it is less than
ideal as a vocabulary type. Regardless, in order to make Boost.Buffers
types and concepts work seamlessly with Asio (but without actually
depending on Asio) it is necessary for the two fundamental buffer
types `const_buffer` and `mutable_buffer` to be declared by the
library rather than being a span of things.

> Maybe an owning span would make some sense, to be able to transfer
> ownership of the underlying memory.

Beast innovates here with its own custom containers but I think I will
just use std::string and std::vector as they do the same thing and
require less work.

> Outside this, i'm not sure. IMHO a buffer is often just a special use case of a container.

Right, dynamic buffer adaptors control a string or vector.

Regards


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk