Re: [boost] [async-mqtt5] Review questions
(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::vectorstd::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.
participants (1)
-
Ruben Perez