TLA Line data Source code
1 : //
2 : // Copyright (c) 2025 Mohammad Nejati
3 : //
4 : // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 : // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 : //
7 : // Official repository: https://github.com/cppalliance/http
8 : //
9 :
10 : #ifndef BOOST_HTTP_DETAIL_BUFFER_UTILS_HPP
11 : #define BOOST_HTTP_DETAIL_BUFFER_UTILS_HPP
12 :
13 : #include <boost/capy/buffers.hpp>
14 : #include <boost/core/span.hpp>
15 : #include <iterator>
16 :
17 : namespace boost {
18 : namespace http {
19 : namespace detail {
20 :
21 : template<typename BufferSequence>
22 : auto
23 HIT 83952 : make_span(BufferSequence const& bs) ->
24 : boost::span<typename std::iterator_traits<
25 : decltype(capy::buffer_sequence_begin(bs))>::value_type const>
26 : {
27 : return { &*capy::buffer_sequence_begin(bs),
28 83952 : std::size_t(std::distance(
29 167904 : capy::buffer_sequence_begin(bs), capy::buffer_sequence_end(bs))) };
30 : }
31 :
32 : } // detail
33 : } // http
34 : } // boost
35 :
36 : #endif
|