On Fri, 13 May 2022 at 19:20, Vinnie Falco via Boost
On Tue, May 10, 2022 at 1:33 PM Marcelo Zimbres Silva via Boost
wrote: Having a std::vector in the signature of the completion handler is unusual in ASIO. In general, large objects should be passed as parameters to the initiating function.
I agree that this is weird. Instead of a vector, the library could introduce a new concept, "RowAccumulator" which is a lightweight, movable value which is invoked to append elements to a notional container. This solves all the problems with allocators and memory-reuse.
How would that RowAccumulator concept be different from a regular output iterator with boost::mysql::row value type?
I suggest that if the library is accepted, it should be conditional upon removing the vector and replacing it with a concept. And the library should provide either in the examples, or as a public API - a wrapper that implements accumulation to a vector.
This makes sense. I've updated https://github.com/anarthal/mysql/issues/58 to include your comments. Regards, Ruben.