include/boost/capy/buffers/slice.hpp

97.1% Lines (694/715) 100.0% List of functions (107/107) 77.6% Branches (194/250)
f(x) Functions (107)
Function Calls Lines Branches Blocks
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator::const_iterator(boost::capy::const_buffer const*, unsigned long, unsigned long, unsigned long, unsigned long) :95 56x 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::const_iterator(__gnu_cxx::__normal_iterator<boost::capy::const_buffer const*, std::span<boost::capy::const_buffer const, 18446744073709551615ul> >, unsigned long, unsigned long, unsigned long, unsigned long) :95 1012x 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::const_iterator(__gnu_cxx::__normal_iterator<boost::capy::mutable_buffer const*, std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >, unsigned long, unsigned long, unsigned long, unsigned long) :95 1012x 100.0% 100.0% boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator::const_iterator(__gnu_cxx::__normal_iterator<boost::capy::const_buffer const*, std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >, unsigned long, unsigned long, unsigned long, unsigned long) :95 4572x 100.0% 100.0% boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator::operator==(boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator const&) const :122 76x 100.0% 60.0% 100.0% boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator==(boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator const&) const :122 1430x 100.0% 60.0% 100.0% boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator==(boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator const&) const :122 1430x 100.0% 60.0% 100.0% boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator::operator==(boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator const&) const :122 6180x 100.0% 60.0% 100.0% boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator::operator!=(boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator const&) const :134 76x 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator!=(boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator const&) const :134 1430x 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator!=(boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator const&) const :134 1430x 100.0% 100.0% boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator::operator!=(boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator const&) const :134 6180x 100.0% 100.0% boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator::operator*() const :141 48x 100.0% 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator*() const :141 924x 100.0% 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator*() const :141 924x 100.0% 100.0% 100.0% boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator::operator*() const :141 3894x 100.0% 100.0% 100.0% boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator::operator++() :160 48x 100.0% 50.0% 75.0% boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator++() :160 612x 100.0% 50.0% 80.0% boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator++() :160 612x 100.0% 50.0% 80.0% boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator::operator++() :160 3230x 100.0% 50.0% 80.0% boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator++(int) :169 156x 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator++(int) :169 156x 100.0% 100.0% boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator::operator++(int) :169 332x 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator--() :177 312x 100.0% 50.0% 80.0% boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator--() :177 312x 100.0% 50.0% 80.0% boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator::operator--() :177 664x 100.0% 50.0% 80.0% boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator--(int) :186 156x 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator--(int) :186 156x 100.0% 100.0% boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator::operator--(int) :186 332x 100.0% 100.0% boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::slice_of(std::array<boost::capy::const_buffer, 3ul> const&) :200 14x 100.0% 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::slice_of(std::span<boost::capy::const_buffer const, 18446744073709551615ul> const&) :200 44x 100.0% 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::slice_of(std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> const&) :200 44x 100.0% 100.0% 100.0% boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::slice_of(std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > const&) :200 92x 100.0% 100.0% 100.0% boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::begin() const :220 28x 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::begin() const :220 506x 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::begin() const :220 506x 100.0% 100.0% boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::begin() const :220 2286x 100.0% 100.0% boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::end() const :229 28x 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::end() const :229 506x 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::end() const :229 506x 100.0% 100.0% boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::end() const :229 2286x 100.0% 100.0% boost::capy::tag_invoke(boost::capy::slice_tag const&, boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >&, boost::capy::slice_how, unsigned long) :237 14x 100.0% 100.0% boost::capy::tag_invoke(boost::capy::slice_tag const&, boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >&, boost::capy::slice_how, unsigned long) :237 41x 100.0% 100.0% boost::capy::tag_invoke(boost::capy::slice_tag const&, boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >&, boost::capy::slice_how, unsigned long) :237 41x 100.0% 100.0% boost::capy::tag_invoke(boost::capy::slice_tag const&, boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >&, boost::capy::slice_how, unsigned long) :237 575x 100.0% 100.0% boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::begin_iter_impl() const :248 40x 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::begin_iter_impl() const :248 542x 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::begin_iter_impl() const :248 542x 100.0% 100.0% boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::begin_iter_impl() const :248 2814x 100.0% 100.0% boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::end_iter_impl() const :256 33x 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::end_iter_impl() const :256 522x 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::end_iter_impl() const :256 522x 100.0% 100.0% boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::end_iter_impl() const :256 2514x 100.0% 100.0% boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::remove_prefix_impl(unsigned long) :264 7x 94.7% 75.0% 92.0% boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::remove_prefix_impl(unsigned long) :264 20x 100.0% 87.5% 100.0% boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::remove_prefix_impl(unsigned long) :264 20x 100.0% 87.5% 100.0% boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::remove_prefix_impl(unsigned long) :264 300x 100.0% 87.5% 100.0% boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::remove_suffix_impl(unsigned long) :295 5x 84.8% 57.1% 75.0% boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::remove_suffix_impl(unsigned long) :295 16x 84.8% 57.1% 79.0% boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::remove_suffix_impl(unsigned long) :295 16x 84.8% 57.1% 79.0% boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::remove_suffix_impl(unsigned long) :295 228x 84.8% 57.1% 79.0% boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::keep_prefix_impl(unsigned long) :345 7x 100.0% 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::keep_prefix_impl(unsigned long) :345 21x 100.0% 100.0% 100.0% boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::keep_prefix_impl(unsigned long) :345 21x 100.0% 100.0% 100.0% boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::keep_prefix_impl(unsigned long) :345 275x 100.0% 100.0% 100.0% boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::slice_impl(boost::capy::slice_how, unsigned long) :377 14x 100.0% 66.7% 100.0% boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::slice_impl(boost::capy::slice_how, unsigned long) :377 41x 100.0% 66.7% 100.0% boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::slice_impl(boost::capy::slice_how, unsigned long) :377 41x 100.0% 66.7% 100.0% boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::slice_impl(boost::capy::slice_how, unsigned long) :377 575x 100.0% 66.7% 100.0% void boost::capy::keep_prefix_mrdocs_workaround_t::operator()<boost::capy::buffer_array<4ul, false> >(boost::capy::buffer_array<4ul, false>&, unsigned long) const :412 272x 100.0% 100.0% void boost::capy::keep_prefix_mrdocs_workaround_t::operator()<boost::capy::buffer_array<4ul, true> >(boost::capy::buffer_array<4ul, true>&, unsigned long) const :412 272x 100.0% 100.0% void boost::capy::keep_prefix_mrdocs_workaround_t::operator()<boost::capy::const_buffer>(boost::capy::const_buffer&, unsigned long) const :412 1327x 100.0% 100.0% void boost::capy::keep_prefix_mrdocs_workaround_t::operator()<boost::capy::mutable_buffer>(boost::capy::mutable_buffer&, unsigned long) const :412 676x 100.0% 100.0% void boost::capy::keep_prefix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> > >(boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >&, unsigned long) const :412 7x 100.0% 100.0% 100.0% void boost::capy::keep_prefix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >&, unsigned long) const :412 11x 100.0% 100.0% 100.0% void boost::capy::keep_prefix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >&, unsigned long) const :412 11x 100.0% 100.0% 100.0% void boost::capy::keep_prefix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > > >(boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >&, unsigned long) const :412 22x 100.0% 100.0% 100.0% void boost::capy::keep_prefix_mrdocs_workaround_t::operator()<std::array<boost::capy::const_buffer, 2ul> >(std::array<boost::capy::const_buffer, 2ul>&, unsigned long) const :412 272x 100.0% 100.0% void boost::capy::keep_prefix_mrdocs_workaround_t::operator()<std::array<boost::capy::mutable_buffer, 2ul> >(std::array<boost::capy::mutable_buffer, 2ul>&, unsigned long) const :412 272x 100.0% 100.0% void boost::capy::keep_suffix_mrdocs_workaround_t::operator()<boost::capy::buffer_array<4ul, false> >(boost::capy::buffer_array<4ul, false>&, unsigned long) const :426 272x 100.0% 100.0% 100.0% void boost::capy::keep_suffix_mrdocs_workaround_t::operator()<boost::capy::buffer_array<4ul, true> >(boost::capy::buffer_array<4ul, true>&, unsigned long) const :426 272x 100.0% 100.0% 100.0% void boost::capy::keep_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >&, unsigned long) const :426 11x 100.0% 100.0% 100.0% void boost::capy::keep_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >&, unsigned long) const :426 11x 100.0% 100.0% 100.0% void boost::capy::keep_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > > >(boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >&, unsigned long) const :426 22x 100.0% 100.0% 100.0% void boost::capy::keep_suffix_mrdocs_workaround_t::operator()<std::array<boost::capy::const_buffer, 2ul> >(std::array<boost::capy::const_buffer, 2ul>&, unsigned long) const :426 272x 100.0% 100.0% 100.0% void boost::capy::keep_suffix_mrdocs_workaround_t::operator()<std::array<boost::capy::mutable_buffer, 2ul> >(std::array<boost::capy::mutable_buffer, 2ul>&, unsigned long) const :426 272x 100.0% 100.0% 100.0% void boost::capy::remove_prefix_mrdocs_workaround_t::operator()<boost::capy::buffer_array<4ul, false> >(boost::capy::buffer_array<4ul, false>&, unsigned long) const :442 272x 100.0% 100.0% void boost::capy::remove_prefix_mrdocs_workaround_t::operator()<boost::capy::buffer_array<4ul, true> >(boost::capy::buffer_array<4ul, true>&, unsigned long) const :442 272x 100.0% 100.0% void boost::capy::remove_prefix_mrdocs_workaround_t::operator()<boost::capy::const_buffer>(boost::capy::const_buffer&, unsigned long) const :442 1313x 100.0% 100.0% void boost::capy::remove_prefix_mrdocs_workaround_t::operator()<boost::capy::mutable_buffer>(boost::capy::mutable_buffer&, unsigned long) const :442 659x 100.0% 100.0% void boost::capy::remove_prefix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> > >(boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >&, unsigned long) const :442 7x 100.0% 100.0% 100.0% void boost::capy::remove_prefix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >&, unsigned long) const :442 11x 100.0% 100.0% 100.0% void boost::capy::remove_prefix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >&, unsigned long) const :442 11x 100.0% 100.0% 100.0% void boost::capy::remove_prefix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > > >(boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >&, unsigned long) const :442 280x 100.0% 100.0% 100.0% void boost::capy::remove_prefix_mrdocs_workaround_t::operator()<std::array<boost::capy::const_buffer, 2ul> >(std::array<boost::capy::const_buffer, 2ul>&, unsigned long) const :442 272x 100.0% 100.0% void boost::capy::remove_prefix_mrdocs_workaround_t::operator()<std::array<boost::capy::mutable_buffer, 2ul> >(std::array<boost::capy::mutable_buffer, 2ul>&, unsigned long) const :442 272x 100.0% 100.0% void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<boost::capy::buffer_array<4ul, false> >(boost::capy::buffer_array<4ul, false>&, unsigned long) const :456 272x 100.0% 100.0% 100.0% void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<boost::capy::buffer_array<4ul, true> >(boost::capy::buffer_array<4ul, true>&, unsigned long) const :456 272x 100.0% 100.0% 100.0% void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >&, unsigned long) const :456 11x 100.0% 100.0% 100.0% void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >&, unsigned long) const :456 11x 100.0% 100.0% 100.0% void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > > >(boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >&, unsigned long) const :456 276x 100.0% 100.0% 100.0% void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<std::array<boost::capy::const_buffer, 2ul> >(std::array<boost::capy::const_buffer, 2ul>&, unsigned long) const :456 272x 100.0% 100.0% 100.0% void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<std::array<boost::capy::mutable_buffer, 2ul> >(std::array<boost::capy::mutable_buffer, 2ul>&, unsigned long) const :456 272x 100.0% 100.0% 100.0% std::conditional<boost::capy::detail::has_tag_invoke<boost::capy::const_buffer, void>::value, boost::capy::const_buffer, boost::capy::slice_of<boost::capy::const_buffer> >::type boost::capy::prefix_mrdocs_workaround_t::operator()<boost::capy::const_buffer>(boost::capy::const_buffer const&, unsigned long) const :477 799x 100.0% 100.0% std::conditional<boost::capy::detail::has_tag_invoke<boost::capy::mutable_buffer, void>::value, boost::capy::mutable_buffer, boost::capy::slice_of<boost::capy::mutable_buffer> >::type boost::capy::prefix_mrdocs_workaround_t::operator()<boost::capy::mutable_buffer>(boost::capy::mutable_buffer const&, unsigned long) const :477 138x 100.0% 100.0% std::conditional<boost::capy::detail::has_tag_invoke<std::array<boost::capy::const_buffer, 3ul>, void>::value, std::array<boost::capy::const_buffer, 3ul>, boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> > >::type boost::capy::prefix_mrdocs_workaround_t::operator()<std::array<boost::capy::const_buffer, 3ul> >(std::array<boost::capy::const_buffer, 3ul> const&, unsigned long) const :477 7x 100.0% 100.0% std::conditional<boost::capy::detail::has_tag_invoke<boost::capy::const_buffer, void>::value, boost::capy::const_buffer, boost::capy::slice_of<boost::capy::const_buffer> >::type boost::capy::sans_prefix_mrdocs_workaround_t::operator()<boost::capy::const_buffer>(boost::capy::const_buffer const&, unsigned long) const :507 792x 100.0% 100.0%
Line Branch TLA Hits Source Code
1 //
2 // Copyright (c) 2025 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/capy
8 //
9
10 #ifndef BOOST_CAPY_BUFFERS_SLICE_HPP
11 #define BOOST_CAPY_BUFFERS_SLICE_HPP
12
13 #include <boost/capy/detail/config.hpp>
14 #include <boost/capy/buffers.hpp>
15 #include <array>
16 #include <cassert>
17 #include <iterator>
18 #include <type_traits>
19
20 namespace boost {
21 namespace capy {
22
23 template<class T> class slice_of;
24
25 namespace detail {
26
27 template<class T, class = void>
28 struct has_tag_invoke : std::false_type {};
29
30 template<class T>
31 struct has_tag_invoke<T, decltype(tag_invoke(
32 std::declval<slice_tag const&>(),
33 std::declval<T&>(),
34 std::declval<slice_how>(),
35 std::declval<std::size_t>()))>
36 : std::true_type {};
37
38 } // detail
39
40 /** Alias for the type representing a slice of T
41 */
42 template<class T>
43 using slice_type = std::conditional_t<
44 detail::has_tag_invoke<T>::value,
45 T, slice_of<T>>;
46
47 //------------------------------------------------
48
49 /** A wrapper enabling a buffer sequence to be consumed
50 */
51 template<ConstBufferSequence BufferSequence>
52 class slice_of<BufferSequence>
53 {
54 static_assert(!std::is_const_v<BufferSequence>,
55 "BufferSequence can't be const");
56
57 static_assert(!std::is_reference_v<BufferSequence>,
58 "BufferSequence can't be a reference");
59
60 using iter_type = decltype(
61 std::declval<BufferSequence const&>().begin());
62
63 using difference_type =
64 typename std::iterator_traits<iter_type>::difference_type;
65
66 BufferSequence bs_;
67 difference_type begin_ = 0; // index of first buffer in sequence
68 difference_type end_ = 0; // 1 + index of last buffer in sequence
69 std::size_t len_ = 0; // length of bs_
70 std::size_t size_ = 0; // total bytes
71 std::size_t prefix_ = 0; // used prefix bytes
72 std::size_t suffix_ = 0; // used suffix bytes
73
74 public:
75 /** The type of values returned by iterators
76 */
77 using value_type = std::conditional_t<
78 MutableBufferSequence<BufferSequence>,
79 mutable_buffer, const_buffer>;
80
81 /** The type of returned iterators
82 */
83 class const_iterator
84 {
85 iter_type it_;
86 // VFALCO we could just point back to
87 // the original sequence to save size
88 std::size_t prefix_ = 0;
89 std::size_t suffix_ = 0;
90 std::size_t i_ = 0;
91 std::size_t n_ = 0;
92
93 friend class slice_of<BufferSequence>;
94
95 6652x const_iterator(
96 iter_type it,
97 std::size_t prefix__,
98 std::size_t suffix__,
99 std::size_t i,
100 std::size_t n) noexcept
101 6652x : it_(it)
102 6652x , prefix_(prefix__)
103 6652x , suffix_(suffix__)
104 6652x , i_(i)
105 6652x , n_(n)
106 {
107 // n_ is the index of the end iterator
108 6652x }
109
110 public:
111 using value_type = typename slice_of::value_type;
112 using reference = value_type;
113 using pointer = void;
114 using difference_type = std::ptrdiff_t;
115 using iterator_category =
116 std::bidirectional_iterator_tag;
117 using iterator_concept = std::bidirectional_iterator_tag;
118
119 const_iterator() = default;
120
121 bool
122 9116x operator==(
123 const_iterator const& other) const noexcept
124 {
125 return
126 9144x it_ == other.it_ &&
127
4/8
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator::operator==(boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator const&) const:
✓ Branch 0 taken 28 times.
✗ Branch 1 not taken.
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator==(boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator const&) const:
✓ Branch 0 taken 506 times.
✗ Branch 1 not taken.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator==(boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator const&) const:
✓ Branch 0 taken 506 times.
✗ Branch 1 not taken.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator::operator==(boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator const&) const:
✓ Branch 0 taken 2286 times.
✗ Branch 1 not taken.
3326x prefix_ == other.prefix_ &&
128
4/8
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator::operator==(boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator const&) const:
✓ Branch 0 taken 28 times.
✗ Branch 1 not taken.
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator==(boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator const&) const:
✓ Branch 0 taken 506 times.
✗ Branch 1 not taken.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator==(boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator const&) const:
✓ Branch 0 taken 506 times.
✗ Branch 1 not taken.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator::operator==(boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator const&) const:
✓ Branch 0 taken 2286 times.
✗ Branch 1 not taken.
3326x suffix_ == other.suffix_ &&
129
12/16
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator::operator==(boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator const&) const:
✓ Branch 0 taken 28 times.
✓ Branch 1 taken 48 times.
✓ Branch 2 taken 28 times.
✗ Branch 3 not taken.
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator==(boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator const&) const:
✓ Branch 0 taken 506 times.
✓ Branch 1 taken 924 times.
✓ Branch 2 taken 506 times.
✗ Branch 3 not taken.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator==(boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator const&) const:
✓ Branch 0 taken 506 times.
✓ Branch 1 taken 924 times.
✓ Branch 2 taken 506 times.
✗ Branch 3 not taken.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator::operator==(boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator const&) const:
✓ Branch 0 taken 2286 times.
✓ Branch 1 taken 3894 times.
✓ Branch 2 taken 2286 times.
✗ Branch 3 not taken.
15768x i_ == other.i_ &&
130
4/8
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator::operator==(boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator const&) const:
✓ Branch 0 taken 28 times.
✗ Branch 1 not taken.
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator==(boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator const&) const:
✓ Branch 0 taken 506 times.
✗ Branch 1 not taken.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator==(boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator const&) const:
✓ Branch 0 taken 506 times.
✗ Branch 1 not taken.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator::operator==(boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator const&) const:
✓ Branch 0 taken 2286 times.
✗ Branch 1 not taken.
12442x n_ == other.n_;
131 }
132
133 bool
134 9116x operator!=(
135 const_iterator const& other) const noexcept
136 {
137 9116x return !(*this == other);
138 }
139
140 reference
141 5790x operator*() const noexcept
142 {
143 5790x value_type v = *it_;
144 using P = std::conditional_t<
145 MutableBufferSequence<BufferSequence>,
146 char*, char const*>;
147 5790x auto p = reinterpret_cast<P>(v.data());
148 5790x auto n = v.size();
149
8/8
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator::operator*() const:
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 24 times.
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator*() const:
✓ Branch 0 taken 440 times.
✓ Branch 1 taken 484 times.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator*() const:
✓ Branch 0 taken 440 times.
✓ Branch 1 taken 484 times.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator::operator*() const:
✓ Branch 0 taken 2039 times.
✓ Branch 1 taken 1855 times.
5790x if(i_ == 0)
150 {
151 2943x p += prefix_;
152 2943x n -= prefix_;
153 }
154
8/8
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator::operator*() const:
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 24 times.
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator*() const:
✓ Branch 0 taken 440 times.
✓ Branch 1 taken 484 times.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator*() const:
✓ Branch 0 taken 440 times.
✓ Branch 1 taken 484 times.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator::operator*() const:
✓ Branch 0 taken 2039 times.
✓ Branch 1 taken 1855 times.
5790x if(i_ == n_ - 1)
155 2943x n -= suffix_;
156 5790x return value_type(p, n);
157 }
158
159 const_iterator&
160 4502x operator++() noexcept
161 {
162
4/8
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator::operator++():
✗ Branch 0 not taken.
✓ Branch 1 taken 48 times.
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator++():
✗ Branch 0 not taken.
✓ Branch 1 taken 612 times.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator++():
✗ Branch 0 not taken.
✓ Branch 1 taken 612 times.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator::operator++():
✗ Branch 0 not taken.
✓ Branch 1 taken 3230 times.
4502x BOOST_CAPY_ASSERT(i_ < n_);
163 4502x ++it_;
164 4502x ++i_;
165 4502x return *this;
166 }
167
168 const_iterator
169 644x operator++(int) noexcept
170 {
171 644x auto temp = *this;
172 644x ++(*this);
173 644x return temp;
174 }
175
176 const_iterator&
177 1288x operator--() noexcept
178 {
179
3/6
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator--():
✗ Branch 0 not taken.
✓ Branch 1 taken 312 times.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator--():
✗ Branch 0 not taken.
✓ Branch 1 taken 312 times.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::const_iterator::operator--():
✗ Branch 0 not taken.
✓ Branch 1 taken 664 times.
1288x BOOST_CAPY_ASSERT(i_ > 0);
180 1288x --it_;
181 1288x --i_;
182 1288x return *this;
183 }
184
185 const_iterator
186 644x operator--(int) noexcept
187 {
188 644x auto temp = *this;
189 644x --(*this);
190 644x return temp;
191 }
192 };
193
194 /** Constructor
195 */
196 slice_of() = default;
197
198 /** Constructor
199 */
200 194x slice_of(
201 BufferSequence const& bs)
202 194x : bs_(bs)
203 {
204 194x iter_type it = capy::begin(bs_);
205 194x iter_type eit = capy::end(bs_);
206 194x begin_ = 0;
207 194x end_ = std::distance(it, eit);
208
8/8
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::slice_of(std::array<boost::capy::const_buffer, 3ul> const&):
✓ Branch 0 taken 42 times.
✓ Branch 1 taken 14 times.
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::slice_of(std::span<boost::capy::const_buffer const, 18446744073709551615ul> const&):
✓ Branch 1 taken 132 times.
✓ Branch 2 taken 44 times.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::slice_of(std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> const&):
✓ Branch 1 taken 132 times.
✓ Branch 2 taken 44 times.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::slice_of(std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > const&):
✓ Branch 1 taken 276 times.
✓ Branch 2 taken 92 times.
776x while(it != eit)
209 {
210 582x value_type b(*it);
211 582x size_ += b.size();
212 582x ++len_;
213 582x ++it;
214 }
215 194x }
216
217 /** Return an iterator to the beginning of the sequence
218 */
219 const_iterator
220 3326x begin() const noexcept
221 {
222 return const_iterator(
223 3326x begin_iter_impl(), prefix_, suffix_, 0, len_);
224 }
225
226 /** Return an iterator to the end of the sequence
227 */
228 const_iterator
229 3326x end() const noexcept
230 {
231 return const_iterator(
232 3326x end_iter_impl(), prefix_, suffix_, len_, len_);
233 }
234
235 friend
236 void
237 671x tag_invoke(
238 slice_tag const&,
239 slice_of<BufferSequence>& bs,
240 slice_how how,
241 std::size_t n)
242 {
243 671x bs.slice_impl(how, n);
244 671x }
245
246 private:
247 iter_type
248 3938x begin_iter_impl() const noexcept
249 {
250 3938x iter_type it = capy::begin(bs_);
251 3938x std::advance(it, begin_);
252 3938x return it;
253 }
254
255 iter_type
256 3591x end_iter_impl() const noexcept
257 {
258 3591x iter_type it = capy::begin(bs_);
259 3591x std::advance(it, end_);
260 3591x return it;
261 }
262
263 void
264 347x remove_prefix_impl(
265 std::size_t n)
266 {
267
7/8
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::remove_prefix_impl(unsigned long):
✗ Branch 0 not taken.
✓ Branch 1 taken 7 times.
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::remove_prefix_impl(unsigned long):
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 19 times.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::remove_prefix_impl(unsigned long):
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 19 times.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::remove_prefix_impl(unsigned long):
✓ Branch 0 taken 23 times.
✓ Branch 1 taken 277 times.
347x if(n > size_)
268 25x n = size_;
269
270 // nice hack to simplify the loop (M. Nejati)
271 347x n += prefix_;
272 347x size_ += prefix_;
273 347x prefix_ = 0;
274
275 347x iter_type it = begin_iter_impl();
276
277
12/16
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::remove_prefix_impl(unsigned long):
✓ Branch 0 taken 10 times.
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::remove_prefix_impl(unsigned long):
✓ Branch 0 taken 39 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 39 times.
✗ Branch 3 not taken.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::remove_prefix_impl(unsigned long):
✓ Branch 0 taken 39 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 39 times.
✗ Branch 3 not taken.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::remove_prefix_impl(unsigned long):
✓ Branch 0 taken 524 times.
✓ Branch 1 taken 77 times.
✓ Branch 2 taken 524 times.
✗ Branch 3 not taken.
709x while(n > 0 && begin_ != end_)
278 {
279 612x value_type b = *it;
280
8/8
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::remove_prefix_impl(unsigned long):
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 7 times.
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::remove_prefix_impl(unsigned long):
✓ Branch 1 taken 12 times.
✓ Branch 2 taken 27 times.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::remove_prefix_impl(unsigned long):
✓ Branch 1 taken 12 times.
✓ Branch 2 taken 27 times.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::remove_prefix_impl(unsigned long):
✓ Branch 1 taken 223 times.
✓ Branch 2 taken 301 times.
612x if(n < b.size())
281 {
282 250x prefix_ = n;
283 250x size_ -= n;
284 250x break;
285 }
286 362x n -= b.size();
287 362x size_ -= b.size();
288 362x ++begin_;
289 362x ++it;
290 362x --len_;
291 }
292 347x }
293
294 void
295 265x remove_suffix_impl(
296 std::size_t n)
297 {
298
4/8
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::remove_suffix_impl(unsigned long):
✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::remove_suffix_impl(unsigned long):
✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::remove_suffix_impl(unsigned long):
✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::remove_suffix_impl(unsigned long):
✗ Branch 0 not taken.
✓ Branch 1 taken 228 times.
265x if(size_ == 0)
299 {
300 BOOST_CAPY_ASSERT(begin_ == end_);
301 265x return;
302 }
303
4/8
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::remove_suffix_impl(unsigned long):
✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::remove_suffix_impl(unsigned long):
✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::remove_suffix_impl(unsigned long):
✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::remove_suffix_impl(unsigned long):
✗ Branch 0 not taken.
✓ Branch 1 taken 228 times.
265x BOOST_CAPY_ASSERT(begin_ != end_);
304
305
4/8
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::remove_suffix_impl(unsigned long):
✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::remove_suffix_impl(unsigned long):
✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::remove_suffix_impl(unsigned long):
✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::remove_suffix_impl(unsigned long):
✗ Branch 0 not taken.
✓ Branch 1 taken 228 times.
265x if(n > size_)
306 n = size_;
307
308 265x n += suffix_;
309 265x size_ += suffix_;
310 265x suffix_ = 0;
311
312 265x iter_type bit = begin_iter_impl();
313 265x iter_type it = end_iter_impl();
314 265x it--;
315
316
8/8
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::remove_suffix_impl(unsigned long):
✓ Branch 0 taken 10 times.
✓ Branch 1 taken 3 times.
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::remove_suffix_impl(unsigned long):
✓ Branch 1 taken 28 times.
✓ Branch 2 taken 6 times.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::remove_suffix_impl(unsigned long):
✓ Branch 1 taken 28 times.
✓ Branch 2 taken 6 times.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::remove_suffix_impl(unsigned long):
✓ Branch 1 taken 325 times.
✓ Branch 2 taken 111 times.
517x while(it != bit)
317 {
318 391x value_type b = *it;
319
8/8
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::remove_suffix_impl(unsigned long):
✓ Branch 1 taken 2 times.
✓ Branch 2 taken 8 times.
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::remove_suffix_impl(unsigned long):
✓ Branch 1 taken 10 times.
✓ Branch 2 taken 18 times.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::remove_suffix_impl(unsigned long):
✓ Branch 1 taken 10 times.
✓ Branch 2 taken 18 times.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::remove_suffix_impl(unsigned long):
✓ Branch 1 taken 117 times.
✓ Branch 2 taken 208 times.
391x if(n < b.size())
320 {
321 139x suffix_ = n;
322 139x size_ -= n;
323 139x return;
324 }
325 252x n -= b.size();
326 252x size_ -= b.size();
327 252x --it;
328 252x --end_;
329 252x --len_;
330 }
331 126x value_type b = *it;
332 126x auto m = b.size() - prefix_;
333
4/8
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::remove_suffix_impl(unsigned long):
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::remove_suffix_impl(unsigned long):
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::remove_suffix_impl(unsigned long):
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::remove_suffix_impl(unsigned long):
✓ Branch 0 taken 111 times.
✗ Branch 1 not taken.
126x if(n < m)
334 {
335 126x suffix_ = n;
336 126x size_ -= n;
337 126x return;
338 }
339 end_ = begin_;
340 len_ = 0;
341 size_ = 0;
342 }
343
344 void
345 324x keep_prefix_impl(
346 std::size_t n)
347 {
348
8/8
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::keep_prefix_impl(unsigned long):
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 6 times.
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::keep_prefix_impl(unsigned long):
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 19 times.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::keep_prefix_impl(unsigned long):
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 19 times.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::keep_prefix_impl(unsigned long):
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 271 times.
324x if(n >= size_)
349 9x return;
350
8/8
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::keep_prefix_impl(unsigned long):
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 5 times.
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::keep_prefix_impl(unsigned long):
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 16 times.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::keep_prefix_impl(unsigned long):
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 16 times.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::keep_prefix_impl(unsigned long):
✓ Branch 0 taken 43 times.
✓ Branch 1 taken 228 times.
315x if(n == 0)
351 {
352 50x end_ = begin_;
353 50x len_ = 0;
354 50x size_ = 0;
355 50x return;
356 }
357 265x remove_suffix_impl(size_ - n);
358 }
359
360 void
361 keep_suffix_impl(
362 std::size_t n)
363 {
364 if(n >= size_)
365 return;
366 if(n == 0)
367 {
368 begin_ = end_;
369 len_ = 0;
370 size_ = 0;
371 return;
372 }
373 remove_prefix_impl(size_ - n);
374 }
375
376 void
377 671x slice_impl(
378 slice_how how,
379 std::size_t n)
380 {
381
8/12
boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >::slice_impl(boost::capy::slice_how, unsigned long):
✓ Branch 0 taken 7 times.
✓ Branch 1 taken 7 times.
✗ Branch 2 not taken.
boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::slice_impl(boost::capy::slice_how, unsigned long):
✓ Branch 0 taken 20 times.
✓ Branch 1 taken 21 times.
✗ Branch 2 not taken.
boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::slice_impl(boost::capy::slice_how, unsigned long):
✓ Branch 0 taken 20 times.
✓ Branch 1 taken 21 times.
✗ Branch 2 not taken.
boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >::slice_impl(boost::capy::slice_how, unsigned long):
✓ Branch 0 taken 300 times.
✓ Branch 1 taken 275 times.
✗ Branch 2 not taken.
671x switch(how)
382 {
383 347x case slice_how::remove_prefix:
384 {
385 347x remove_prefix_impl(n);
386 347x break;
387 }
388 324x case slice_how::keep_prefix:
389 {
390 324x keep_prefix_impl(n);
391 324x break;
392 }
393 }
394 671x }
395 };
396
397 //------------------------------------------------
398
399 // in-place modify return value
400 // -----------------------------
401 // keep_prefix* prefix
402 // keep_suffix suffix
403 // remove_prefix* sans_prefix
404 // remove_suffix sans_suffix
405
406 /** Remove all but the first `n` bytes from a buffer sequence
407 */
408 constexpr struct keep_prefix_mrdocs_workaround_t
409 {
410 template<ConstBufferSequence BufferSequence>
411 requires detail::has_tag_invoke<BufferSequence>::value
412 3142x void operator()(
413 BufferSequence& bs,
414 std::size_t n) const
415 {
416
4/4
void boost::capy::keep_prefix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> > >(boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >&, unsigned long) const:
✓ Branch 1 taken 7 times.
void boost::capy::keep_prefix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >&, unsigned long) const:
✓ Branch 1 taken 11 times.
void boost::capy::keep_prefix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >&, unsigned long) const:
✓ Branch 1 taken 11 times.
void boost::capy::keep_prefix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > > >(boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >&, unsigned long) const:
✓ Branch 1 taken 22 times.
3142x tag_invoke(slice_tag{}, bs, slice_how::keep_prefix, n);
417 3142x }
418 } const keep_prefix{};
419
420 /** Remove all but the last `n` bytes from a buffer sequence
421 */
422 constexpr struct keep_suffix_mrdocs_workaround_t
423 {
424 template<ConstBufferSequence BufferSequence>
425 requires detail::has_tag_invoke<BufferSequence>::value
426 1132x void operator()(
427 BufferSequence& bs,
428 std::size_t n) const
429 {
430 1132x auto n0 = buffer_size(bs);
431
14/14
void boost::capy::keep_suffix_mrdocs_workaround_t::operator()<boost::capy::buffer_array<4ul, false> >(boost::capy::buffer_array<4ul, false>&, unsigned long) const:
✓ Branch 0 taken 240 times.
✓ Branch 1 taken 32 times.
void boost::capy::keep_suffix_mrdocs_workaround_t::operator()<boost::capy::buffer_array<4ul, true> >(boost::capy::buffer_array<4ul, true>&, unsigned long) const:
✓ Branch 0 taken 240 times.
✓ Branch 1 taken 32 times.
void boost::capy::keep_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >&, unsigned long) const:
✓ Branch 0 taken 9 times.
✓ Branch 1 taken 2 times.
void boost::capy::keep_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >&, unsigned long) const:
✓ Branch 0 taken 9 times.
✓ Branch 1 taken 2 times.
void boost::capy::keep_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > > >(boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >&, unsigned long) const:
✓ Branch 0 taken 20 times.
✓ Branch 1 taken 2 times.
void boost::capy::keep_suffix_mrdocs_workaround_t::operator()<std::array<boost::capy::const_buffer, 2ul> >(std::array<boost::capy::const_buffer, 2ul>&, unsigned long) const:
✓ Branch 0 taken 240 times.
✓ Branch 1 taken 32 times.
void boost::capy::keep_suffix_mrdocs_workaround_t::operator()<std::array<boost::capy::mutable_buffer, 2ul> >(std::array<boost::capy::mutable_buffer, 2ul>&, unsigned long) const:
✓ Branch 0 taken 240 times.
✓ Branch 1 taken 32 times.
1132x if(n < n0)
432
3/3
void boost::capy::keep_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >&, unsigned long) const:
✓ Branch 1 taken 9 times.
void boost::capy::keep_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >&, unsigned long) const:
✓ Branch 1 taken 9 times.
void boost::capy::keep_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > > >(boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >&, unsigned long) const:
✓ Branch 1 taken 20 times.
998x tag_invoke(slice_tag{}, bs, slice_how::remove_prefix, n0 - n);
433 1132x }
434 } const keep_suffix{};
435
436 /** Remove `n` bytes from the beginning of a buffer sequence
437 */
438 constexpr struct remove_prefix_mrdocs_workaround_t
439 {
440 template<ConstBufferSequence BufferSequence>
441 requires detail::has_tag_invoke<BufferSequence>::value
442 3369x void operator()(
443 BufferSequence& bs,
444 std::size_t n) const
445 {
446
4/4
void boost::capy::remove_prefix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> > >(boost::capy::slice_of<std::array<boost::capy::const_buffer, 3ul> >&, unsigned long) const:
✓ Branch 1 taken 7 times.
void boost::capy::remove_prefix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >&, unsigned long) const:
✓ Branch 1 taken 11 times.
void boost::capy::remove_prefix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >&, unsigned long) const:
✓ Branch 1 taken 11 times.
void boost::capy::remove_prefix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > > >(boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >&, unsigned long) const:
✓ Branch 1 taken 280 times.
3369x tag_invoke(slice_tag{}, bs, slice_how::remove_prefix, n);
447 3369x }
448 } const remove_prefix{};
449
450 /** Remove `n` bytes from the end of a buffer sequence
451 */
452 constexpr struct remove_suffix_mrdocs_workaround_t
453 {
454 template<ConstBufferSequence BufferSequence>
455 requires detail::has_tag_invoke<BufferSequence>::value
456 1386x void operator()(
457 BufferSequence& bs,
458 std::size_t n) const
459 {
460 1386x auto n0 = buffer_size(bs);
461
14/14
void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<boost::capy::buffer_array<4ul, false> >(boost::capy::buffer_array<4ul, false>&, unsigned long) const:
✓ Branch 0 taken 256 times.
✓ Branch 1 taken 16 times.
void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<boost::capy::buffer_array<4ul, true> >(boost::capy::buffer_array<4ul, true>&, unsigned long) const:
✓ Branch 0 taken 256 times.
✓ Branch 1 taken 16 times.
void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >&, unsigned long) const:
✓ Branch 0 taken 10 times.
✓ Branch 1 taken 1 time.
void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >&, unsigned long) const:
✓ Branch 0 taken 10 times.
✓ Branch 1 taken 1 time.
void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > > >(boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >&, unsigned long) const:
✓ Branch 0 taken 253 times.
✓ Branch 1 taken 23 times.
void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<std::array<boost::capy::const_buffer, 2ul> >(std::array<boost::capy::const_buffer, 2ul>&, unsigned long) const:
✓ Branch 0 taken 256 times.
✓ Branch 1 taken 16 times.
void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<std::array<boost::capy::mutable_buffer, 2ul> >(std::array<boost::capy::mutable_buffer, 2ul>&, unsigned long) const:
✓ Branch 0 taken 256 times.
✓ Branch 1 taken 16 times.
1386x if(n > 0)
462 {
463
14/14
void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<boost::capy::buffer_array<4ul, false> >(boost::capy::buffer_array<4ul, false>&, unsigned long) const:
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 240 times.
void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<boost::capy::buffer_array<4ul, true> >(boost::capy::buffer_array<4ul, true>&, unsigned long) const:
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 240 times.
void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >&, unsigned long) const:
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 9 times.
void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >&, unsigned long) const:
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 9 times.
void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > > >(boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >&, unsigned long) const:
✓ Branch 0 taken 23 times.
✓ Branch 1 taken 230 times.
void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<std::array<boost::capy::const_buffer, 2ul> >(std::array<boost::capy::const_buffer, 2ul>&, unsigned long) const:
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 240 times.
void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<std::array<boost::capy::mutable_buffer, 2ul> >(std::array<boost::capy::mutable_buffer, 2ul>&, unsigned long) const:
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 240 times.
1297x if( n > n0)
464 89x n = n0;
465
3/3
void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >&, unsigned long) const:
✓ Branch 1 taken 10 times.
void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> > >(boost::capy::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >&, unsigned long) const:
✓ Branch 1 taken 10 times.
void boost::capy::remove_suffix_mrdocs_workaround_t::operator()<boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > > >(boost::capy::slice_of<std::vector<boost::capy::const_buffer, std::allocator<boost::capy::const_buffer> > >&, unsigned long) const:
✓ Branch 1 taken 253 times.
1297x tag_invoke(slice_tag{}, bs, slice_how::keep_prefix, n0 - n);
466 }
467 1386x }
468 } const remove_suffix{};
469
470 //------------------------------------------------
471
472 /** Return a sequence representing the first `n` bytes of a buffer sequence
473 */
474 constexpr struct prefix_mrdocs_workaround_t
475 {
476 template<ConstBufferSequence BufferSequence>
477 944x slice_type<BufferSequence> operator()(
478 BufferSequence const& bs,
479 std::size_t n) const noexcept
480 {
481 944x slice_type<BufferSequence> result(bs);
482 944x keep_prefix(result, n);
483 944x return result;
484 }
485 } prefix{};
486
487 /** Return a sequence representing the last `n` bytes of a buffer sequence
488 */
489 constexpr struct suffix_mrdocs_workaround_t
490 {
491 template<ConstBufferSequence BufferSequence>
492 slice_type<BufferSequence> operator()(
493 BufferSequence const& bs,
494 std::size_t n) const noexcept
495 {
496 slice_type<BufferSequence> result(bs);
497 keep_suffix(result, n);
498 return result;
499 }
500 } suffix{};
501
502 /** Return a sequence representing all but the first `n` bytes of a buffer sequence
503 */
504 constexpr struct sans_prefix_mrdocs_workaround_t
505 {
506 template<ConstBufferSequence BufferSequence>
507 959x slice_type<BufferSequence> operator()(
508 BufferSequence const& bs,
509 std::size_t n) const noexcept
510 {
511 959x slice_type<BufferSequence> result(bs);
512 959x remove_prefix(result, n);
513 959x return result;
514 }
515 } sans_prefix{};
516
517 /** Return a sequence representing all but the last `n` bytes of a buffer sequence
518 */
519 constexpr struct sans_suffix_mrdocs_workaround_t
520 {
521 template<ConstBufferSequence BufferSequence>
522 slice_type<BufferSequence> operator()(
523 BufferSequence const& bs,
524 std::size_t n) const noexcept
525 {
526 slice_type<BufferSequence> result(bs);
527 remove_suffix(result, n);
528 return result;
529 }
530 } sans_suffix{};
531
532 } // capy
533 } // boost
534
535 #endif
536