boost asio buffer lazy allocation
问题 Async operations. Now I pass preallocated byte buffer, for example: s.async_receive_from( boost::asio::buffer( preallocated_pointer, preallocated_size ), _remote_endpoint, boost::bind(...) ); Is it possible to make lazy allocation for this and other calls? 回答1: Lazy allocation, or allocating when the resource is needed, can be accomplished using boost::asio::null_buffers. null_buffers can be used to obtain reactor-style operations within Boost.Asio. This can be useful for integrating with