Boost logo

Boost Users :

Subject: [Boost-users] ASIO vs Beast DynamicBuffer use
From: Cristian Morales Vega (cristian_at_[hidden])
Date: 2018-11-01 14:25:47


I have just noticed that while ASIO passes DynamicBuffers as &&
Beast passes them via reference

I'm guessing this happens because ASIO thinks you are going to use
dynamic_string_buffer/dynamic_vector_buffer as DynamicBuffer, while
Beast thinks you are going to use flat_buffer/multi_buffer. In the
second case doesn't make sense to give ownership of the DynamicBuffer
to the initiation function because then you would not be able to look
at the received data when the operation completes. Since ASIO
DynamicBuffer implementations are just adaptors over string/vectors
that you keep, it makes sense to move those adaptors, you still keep
the string/vector with the data. Have I got it right?

But this raises the question: what should I use in my own initiating functions?


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at