diff --git a/asio/include/asio/buffer.hpp b/asio/include/asio/buffer.hpp index 905ef7c41c..52c812ca17 100644 --- a/asio/include/asio/buffer.hpp +++ b/asio/include/asio/buffer.hpp @@ -52,6 +52,43 @@ #include "asio/detail/push_options.hpp" namespace asio { +namespace detail { + +#if defined(ASIO_MSVC) + +struct span_memfns_base +{ + void subspan(); +}; + +template +struct span_memfns_derived : T, span_memfns_base +{ +}; + +template +struct span_memfns_check +{ +}; + +template +char (&subspan_memfn_helper(...))[2]; + +template +char subspan_memfn_helper( + span_memfns_check< + void (span_memfns_base::*)(), + &span_memfns_derived::subspan>*); + +template +struct has_subspan_memfn : + integral_constant(0)) != 1> +{ +}; + +#endif // defined(ASIO_MSVC) + +} // namespace detail class mutable_buffer; class const_buffer; @@ -92,6 +129,34 @@ class mutable_buffer { } + /// Construct a buffer from a span of bytes. + template