Boost logo

Boost :

From: Ruben Perez (rubenperez038_at_[hidden])
Date: 2024-10-18 16:58:41


(CC-ing the list)

> >
> > I haven't looked at the implementation yet, but I'm assuming that
> > owning types are being used for a reason.
>
> You mean like ASIO buffers? Or vector? To std::move them around?

I mean that the current interface is using std::string (owning) as the
argument type for message payloads, which probably means that the
implementation will std::move the supplied buffer, so the user doesn't
need to keep it alive. My question was regarding the use of a
character type (like std::string) vs a blob type (like
std::vector<std::byte>), more than an owning vs. a non-woning type.

Now that you've mentioned it, most Asio-based libraries require the
user to keep the message payload alive for the duration of the
operation, in an attempt to minimize copying. So I will add this to my
list of questions for Ivica: is there a reason why you decided to use
an owning type for the message payload?

Regards,
Ruben.


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