LCOV - code coverage report
Current view: top level - boost/buffers/impl - mutable_buffer_span.hpp (source / functions) Hit Total Coverage
Test: coverage_filtered.info Lines: 16 16 100.0 %
Date: 2024-04-15 19:09:26 Functions: 4 4 100.0 %

          Line data    Source code
       1             : //
       2             : // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com)
       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/buffers
       8             : //
       9             : 
      10             : #ifndef BOOST_BUFFERS_IMPL_MUTABLE_BUFFER_SPAN_HPP
      11             : #define BOOST_BUFFERS_IMPL_MUTABLE_BUFFER_SPAN_HPP
      12             : 
      13             : namespace boost {
      14             : namespace buffers {
      15             : 
      16             : mutable_buffer_subspan
      17         374 : mutable_buffer_span::
      18             : prefix_impl(
      19             :     std::size_t n) const noexcept
      20             : {
      21         748 :     return mutable_buffer_subspan(
      22         374 :         *this).prefix_impl(n);
      23             : }
      24             : 
      25             : mutable_buffer_subspan
      26         374 : mutable_buffer_span::
      27             : suffix_impl(
      28             :     std::size_t n) const noexcept
      29             : {
      30         748 :     return mutable_buffer_subspan(
      31         374 :         *this).suffix_impl(n);
      32             : }
      33             : 
      34             : //-----------------------------------------------
      35             : 
      36             : // here because circular dependency
      37         750 : mutable_buffer_subspan::
      38             : mutable_buffer_subspan(
      39         750 :     mutable_buffer_span const& s) noexcept
      40         750 :     : p_(s.p_)
      41         750 :     , n_(s.n_)
      42         750 :     , p1_([&]() -> std::size_t
      43             :         {
      44         750 :             if(n_ > 0)
      45         749 :                 return p_[n_-1].size();
      46           1 :             return 0;
      47         750 :         }())
      48             : {
      49         750 : }
      50             : 
      51             : } // buffers
      52             : } // boost
      53             : 
      54             : #endif

Generated by: LCOV version 1.15