Skip to content

Buffer sequence ownership should be clarified #263

@pdimov

Description

@pdimov

At the moment, read_some is specified as

template<MutableBufferSequence Buffers>
IoAwaitable auto read_some(Buffers buffers);

That is, it takes buffers by value.

This doesn't seem correct. It would imply that std::vector<mutable_buffer> is required to be copied by read_some, which is unnecessary.

And if we change this to e.g. Buffers&& buffers, we need to clarify that read_some doesn't mutate buffers in the lvalue case, so that the caller can still use buffers in a subsequent read_some (or write_some) call.

The rvalue case is trickier, but we need to have clarity on #261 before deciding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions