From 645efa713dd58a5ff9248c8b10a8bdfacf35c69f Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Tue, 22 Oct 2024 07:54:22 +1100 Subject: [PATCH] Allow buffers to be implicitly constructed from spans. --- asio/include/asio/buffer.hpp | 40 ++++++++++++++++++++ asio/include/asio/detail/type_traits.hpp | 5 +++ asio/src/tests/unit/buffer.cpp | 47 ++++++++++++++++++------ 3 files changed, 81 insertions(+), 11 deletions(-) diff --git a/asio/include/asio/buffer.hpp b/asio/include/asio/buffer.hpp index 905ef7c41c..6f4f6ff424 100644 --- a/asio/include/asio/buffer.hpp +++ b/asio/include/asio/buffer.hpp @@ -92,6 +92,26 @@ class mutable_buffer { } + /// Construct a buffer from a span of bytes. + template