include/boost/capy/detail/slice_of.hpp
100.0% Lines (72/0/72)
87.0% List of functions (127/0/146)
Functions (146)
Function
Calls
Lines
Blocks
boost::capy::detail::slice_of<boost::capy::const_buffer>::adjust(boost::capy::const_buffer const&, unsigned long, unsigned long)
:63
250x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, false> >::adjust(boost::capy::mutable_buffer const&, unsigned long, unsigned long)
:63
15840x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, true> >::adjust(boost::capy::const_buffer const&, unsigned long, unsigned long)
:63
15840x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> > >::adjust(boost::capy::const_buffer const&, unsigned long, unsigned long)
:63
6x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::mutable_buffer>::adjust(boost::capy::mutable_buffer const&, unsigned long, unsigned long)
:63
198x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 100ul> >::adjust(boost::capy::const_buffer const&, unsigned long, unsigned long)
:63
0
0.0%
0.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> >::adjust(boost::capy::const_buffer const&, unsigned long, unsigned long)
:63
155x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 3ul> >::adjust(boost::capy::const_buffer const&, unsigned long, unsigned long)
:63
48x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 4ul> >::adjust(boost::capy::const_buffer const&, unsigned long, unsigned long)
:63
0
0.0%
0.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 5ul> >::adjust(boost::capy::const_buffer const&, unsigned long, unsigned long)
:63
5x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 1ul> >::adjust(boost::capy::mutable_buffer const&, unsigned long, unsigned long)
:63
3x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 2ul> >::adjust(boost::capy::mutable_buffer const&, unsigned long, unsigned long)
:63
122x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 3ul> >::adjust(boost::capy::mutable_buffer const&, unsigned long, unsigned long)
:63
2x
100.0%
100.0%
boost::capy::detail::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::adjust(boost::capy::const_buffer const&, unsigned long, unsigned long)
:63
858x
100.0%
100.0%
boost::capy::detail::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::adjust(boost::capy::mutable_buffer const&, unsigned long, unsigned long)
:63
858x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::const_buffer>::const_iterator::const_iterator(boost::capy::const_buffer const*, boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long)
:95
500x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, false> >::const_iterator::const_iterator(boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, unsigned long, unsigned long)
:95
23936x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, true> >::const_iterator::const_iterator(boost::capy::const_buffer const*, boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long)
:95
23936x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> > >::const_iterator::const_iterator(boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> >::const_iterator, boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> >::const_iterator, boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> >::const_iterator, unsigned long, unsigned long)
:95
8x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::mutable_buffer>::const_iterator::const_iterator(boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, unsigned long, unsigned long)
:95
396x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 100ul> >::const_iterator::const_iterator(boost::capy::const_buffer const*, boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long)
:95
0
0.0%
0.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> >::const_iterator::const_iterator(boost::capy::const_buffer const*, boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long)
:95
194x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator::const_iterator(boost::capy::const_buffer const*, boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long)
:95
56x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 4ul> >::const_iterator::const_iterator(boost::capy::const_buffer const*, boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long)
:95
0
0.0%
0.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 5ul> >::const_iterator::const_iterator(boost::capy::const_buffer const*, boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long)
:95
2x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 1ul> >::const_iterator::const_iterator(boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, unsigned long, unsigned long)
:95
15x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 2ul> >::const_iterator::const_iterator(boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, unsigned long, unsigned long)
:95
214x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 3ul> >::const_iterator::const_iterator(boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, unsigned long, unsigned long)
:95
5x
100.0%
100.0%
boost::capy::detail::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> >, __gnu_cxx::__normal_iterator<boost::capy::const_buffer const*, std::span<boost::capy::const_buffer const, 18446744073709551615ul> >, __gnu_cxx::__normal_iterator<boost::capy::const_buffer const*, std::span<boost::capy::const_buffer const, 18446744073709551615ul> >, unsigned long, unsigned long)
:95
968x
100.0%
100.0%
boost::capy::detail::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> >, __gnu_cxx::__normal_iterator<boost::capy::mutable_buffer const*, std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >, __gnu_cxx::__normal_iterator<boost::capy::mutable_buffer const*, std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >, unsigned long, unsigned long)
:95
968x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::const_buffer>::const_iterator::operator==(boost::capy::detail::slice_of<boost::capy::const_buffer>::const_iterator const&) const
:107
325x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, false> >::const_iterator::operator==(boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, false> >::const_iterator const&) const
:107
27808x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, true> >::const_iterator::operator==(boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, true> >::const_iterator const&) const
:107
27808x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> > >::const_iterator::operator==(boost::capy::detail::slice_of<boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> > >::const_iterator const&) const
:107
8x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::mutable_buffer>::const_iterator::operator==(boost::capy::detail::slice_of<boost::capy::mutable_buffer>::const_iterator const&) const
:107
211x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 100ul> >::const_iterator::operator==(boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 100ul> >::const_iterator const&) const
:107
0
0.0%
0.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> >::const_iterator::operator==(boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> >::const_iterator const&) const
:107
191x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator::operator==(boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator const&) const
:107
76x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 4ul> >::const_iterator::operator==(boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 4ul> >::const_iterator const&) const
:107
0
0.0%
0.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 5ul> >::const_iterator::operator==(boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 5ul> >::const_iterator const&) const
:107
6x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 1ul> >::const_iterator::operator==(boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 1ul> >::const_iterator const&) const
:107
10x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 2ul> >::const_iterator::operator==(boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 2ul> >::const_iterator const&) const
:107
144x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 3ul> >::const_iterator::operator==(boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 3ul> >::const_iterator const&) const
:107
4x
100.0%
100.0%
boost::capy::detail::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator==(boost::capy::detail::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator const&) const
:107
1342x
100.0%
100.0%
boost::capy::detail::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator==(boost::capy::detail::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator const&) const
:107
1342x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::const_buffer>::const_iterator::operator!=(boost::capy::detail::slice_of<boost::capy::const_buffer>::const_iterator const&) const
:112
325x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, false> >::const_iterator::operator!=(boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, false> >::const_iterator const&) const
:112
27808x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, true> >::const_iterator::operator!=(boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, true> >::const_iterator const&) const
:112
27808x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> > >::const_iterator::operator!=(boost::capy::detail::slice_of<boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> > >::const_iterator const&) const
:112
8x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::mutable_buffer>::const_iterator::operator!=(boost::capy::detail::slice_of<boost::capy::mutable_buffer>::const_iterator const&) const
:112
211x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 100ul> >::const_iterator::operator!=(boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 100ul> >::const_iterator const&) const
:112
0
0.0%
0.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> >::const_iterator::operator!=(boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> >::const_iterator const&) const
:112
171x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator::operator!=(boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator const&) const
:112
76x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 4ul> >::const_iterator::operator!=(boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 4ul> >::const_iterator const&) const
:112
0
0.0%
0.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 5ul> >::const_iterator::operator!=(boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 5ul> >::const_iterator const&) const
:112
6x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 1ul> >::const_iterator::operator!=(boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 1ul> >::const_iterator const&) const
:112
10x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 2ul> >::const_iterator::operator!=(boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 2ul> >::const_iterator const&) const
:112
144x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 3ul> >::const_iterator::operator!=(boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 3ul> >::const_iterator const&) const
:112
4x
100.0%
100.0%
boost::capy::detail::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator!=(boost::capy::detail::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator const&) const
:112
1342x
100.0%
100.0%
boost::capy::detail::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator!=(boost::capy::detail::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator const&) const
:112
1342x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::const_buffer>::const_iterator::operator*() const
:117
250x
100.0%
78.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, false> >::const_iterator::operator*() const
:117
15840x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, true> >::const_iterator::operator*() const
:117
15840x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> > >::const_iterator::operator*() const
:117
6x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::mutable_buffer>::const_iterator::operator*() const
:117
198x
100.0%
78.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 100ul> >::const_iterator::operator*() const
:117
0
0.0%
0.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> >::const_iterator::operator*() const
:117
155x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator::operator*() const
:117
48x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 4ul> >::const_iterator::operator*() const
:117
0
0.0%
0.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 5ul> >::const_iterator::operator*() const
:117
5x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 1ul> >::const_iterator::operator*() const
:117
3x
100.0%
78.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 2ul> >::const_iterator::operator*() const
:117
122x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 3ul> >::const_iterator::operator*() const
:117
2x
100.0%
78.0%
boost::capy::detail::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator*() const
:117
858x
100.0%
100.0%
boost::capy::detail::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator*() const
:117
858x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::const_buffer>::const_iterator::operator++()
:127
217x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, false> >::const_iterator::operator++()
:127
10080x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, true> >::const_iterator::operator++()
:127
10080x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> > >::const_iterator::operator++()
:127
6x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::mutable_buffer>::const_iterator::operator++()
:127
179x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 100ul> >::const_iterator::operator++()
:127
0
0.0%
0.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> >::const_iterator::operator++()
:127
161x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 3ul> >::const_iterator::operator++()
:127
48x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 4ul> >::const_iterator::operator++()
:127
0
0.0%
0.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 5ul> >::const_iterator::operator++()
:127
5x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 1ul> >::const_iterator::operator++()
:127
3x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 2ul> >::const_iterator::operator++()
:127
112x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 3ul> >::const_iterator::operator++()
:127
2x
100.0%
100.0%
boost::capy::detail::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator++()
:127
546x
100.0%
100.0%
boost::capy::detail::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator++()
:127
546x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::const_buffer>::const_iterator::operator++(int)
:128
115x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, false> >::const_iterator::operator++(int)
:128
2880x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, true> >::const_iterator::operator++(int)
:128
2880x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::mutable_buffer>::const_iterator::operator++(int)
:128
141x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> >::const_iterator::operator++(int)
:128
66x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 1ul> >::const_iterator::operator++(int)
:128
0
50.0%
0.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 2ul> >::const_iterator::operator++(int)
:128
56x
100.0%
100.0%
boost::capy::detail::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator++(int)
:128
156x
100.0%
100.0%
boost::capy::detail::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator++(int)
:128
156x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, false> >::const_iterator::operator--()
:130
5760x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, true> >::const_iterator::operator--()
:130
5760x
100.0%
100.0%
boost::capy::detail::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator--()
:130
312x
100.0%
100.0%
boost::capy::detail::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator--()
:130
312x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, false> >::const_iterator::operator--(int)
:131
2880x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, true> >::const_iterator::operator--(int)
:131
2880x
100.0%
100.0%
boost::capy::detail::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::const_iterator::operator--(int)
:131
156x
100.0%
100.0%
boost::capy::detail::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::const_iterator::operator--(int)
:131
156x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, false> >::slice_of(boost::capy::detail::buffer_array<4ul, false> const&, unsigned long, unsigned long)
:144
1088x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, true> >::slice_of(boost::capy::detail::buffer_array<4ul, true> const&, unsigned long, unsigned long)
:144
1088x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 1ul> >::slice_of(std::array<boost::capy::const_buffer, 1ul> const&, unsigned long, unsigned long)
:144
1x
41.9%
55.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> >::slice_of(std::array<boost::capy::const_buffer, 2ul> const&, unsigned long, unsigned long)
:144
2x
93.9%
91.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 3ul> >::slice_of(std::array<boost::capy::const_buffer, 3ul> const&, unsigned long, unsigned long)
:144
14x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 1ul> >::slice_of(std::array<boost::capy::mutable_buffer, 1ul> const&, unsigned long, unsigned long)
:144
4x
83.9%
91.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 2ul> >::slice_of(std::array<boost::capy::mutable_buffer, 2ul> const&, unsigned long, unsigned long)
:144
7x
93.5%
91.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 3ul> >::slice_of(std::array<boost::capy::mutable_buffer, 3ul> const&, unsigned long, unsigned long)
:144
1x
48.4%
59.0%
boost::capy::detail::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::slice_of(std::span<boost::capy::const_buffer const, 18446744073709551615ul> const&, unsigned long, unsigned long)
:144
44x
100.0%
100.0%
boost::capy::detail::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::slice_of(std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> const&, unsigned long, unsigned long)
:144
44x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::const_buffer>::slice_of(boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long)
:199
132x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> > >::slice_of(boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> >::const_iterator, boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> >::const_iterator, unsigned long, unsigned long)
:199
2x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::mutable_buffer>::slice_of(boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, unsigned long, unsigned long)
:199
110x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 100ul> >::slice_of(boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long)
:199
0
0.0%
0.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 1ul> >::slice_of(boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long)
:199
0
0.0%
0.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 256ul> >::slice_of(boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long)
:199
0
0.0%
0.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> >::slice_of(boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long)
:199
55x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 4ul> >::slice_of(boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long)
:199
0
0.0%
0.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 5ul> >::slice_of(boost::capy::const_buffer const*, boost::capy::const_buffer const*, unsigned long, unsigned long)
:199
1x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 1ul> >::slice_of(boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, unsigned long, unsigned long)
:199
2x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 2ul> >::slice_of(boost::capy::mutable_buffer const*, boost::capy::mutable_buffer const*, unsigned long, unsigned long)
:199
60x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::const_buffer>::begin() const
:210
250x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, false> >::begin() const
:210
11968x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::buffer_array<4ul, true> >::begin() const
:210
11968x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> > >::begin() const
:210
4x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::mutable_buffer>::begin() const
:210
198x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 100ul> >::begin() const
:210
0
0.0%
0.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 2ul> >::begin() const
:210
97x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 3ul> >::begin() const
:210
28x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 4ul> >::begin() const
:210
0
0.0%
0.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 5ul> >::begin() const
:210
1x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 1ul> >::begin() const
:210
7x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 2ul> >::begin() const
:210
98x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::mutable_buffer, 3ul> >::begin() const
:210
2x
100.0%
100.0%
boost::capy::detail::slice_of<std::span<boost::capy::const_buffer const, 18446744073709551615ul> >::begin() const
:210
484x
100.0%
100.0%
boost::capy::detail::slice_of<std::span<boost::capy::mutable_buffer const, 18446744073709551615ul> >::begin() const
:210
484x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::const_buffer>::end() const
:217
28x
100.0%
100.0%
boost::capy::detail::slice_of<boost::capy::mutable_buffer>::end() const
:217
99x
100.0%
100.0%
boost::capy::detail::slice_of<std::array<boost::capy::const_buffer, 3ul> >::end() const
:217
28x
100.0%
100.0%
| Line | TLA | Hits | Source Code |
|---|---|---|---|
| 1 | // | ||
| 2 | // Copyright (c) 2026 Steve Gerbino | ||
| 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_DETAIL_SLICE_OF_HPP | ||
| 11 | #define BOOST_CAPY_DETAIL_SLICE_OF_HPP | ||
| 12 | |||
| 13 | #include <boost/capy/detail/config.hpp> | ||
| 14 | #include <boost/capy/buffers.hpp> | ||
| 15 | |||
| 16 | #include <cstddef> | ||
| 17 | #include <iterator> | ||
| 18 | #include <limits> | ||
| 19 | #include <type_traits> | ||
| 20 | |||
| 21 | namespace boost { | ||
| 22 | namespace capy { | ||
| 23 | namespace detail { | ||
| 24 | |||
| 25 | /** A borrowed view over a byte sub-range of a buffer sequence. | ||
| 26 | |||
| 27 | `slice_of<BS>` is the generic result of `buffer_slice` for a sequence | ||
| 28 | that is not closed under sub-ranging (everything except a single | ||
| 29 | buffer). It models the same buffer-sequence concept as `BS`: | ||
| 30 | `MutableBufferSequence` if `BS` is mutable, otherwise | ||
| 31 | `ConstBufferSequence`. It can therefore be passed anywhere a buffer | ||
| 32 | sequence is expected. | ||
| 33 | |||
| 34 | It stores iterators into the underlying sequence plus front/back byte | ||
| 35 | offsets; it neither owns nor copies the descriptors. The underlying | ||
| 36 | sequence must outlive the view. | ||
| 37 | |||
| 38 | @par Complexity | ||
| 39 | Construction is a single forward pass to the cut points. It is | ||
| 40 | O(buffers up to `offset`) for a to-end slice, and O(buffers up to | ||
| 41 | `offset + length`) for a bounded slice. It never sums the whole | ||
| 42 | sequence. | ||
| 43 | */ | ||
| 44 | template<class BS> | ||
| 45 | requires MutableBufferSequence<BS> || ConstBufferSequence<BS> | ||
| 46 | class slice_of | ||
| 47 | { | ||
| 48 | public: | ||
| 49 | /// The buffer type yielded by iteration. | ||
| 50 | using buffer_type = capy::buffer_type<BS>; | ||
| 51 | |||
| 52 | /// The underlying sequence's iterator type. | ||
| 53 | using iterator_type = | ||
| 54 | decltype(capy::begin(std::declval<BS const&>())); | ||
| 55 | |||
| 56 | private: | ||
| 57 | iterator_type first_{}; | ||
| 58 | iterator_type last_{}; | ||
| 59 | std::size_t front_skip_ = 0; // bytes trimmed from *first_ | ||
| 60 | std::size_t back_skip_ = 0; // bytes trimmed from the final buffer | ||
| 61 | |||
| 62 | static buffer_type | ||
| 63 | 34185x | adjust(buffer_type const& b, | |
| 64 | std::size_t front_n, std::size_t back_n) noexcept | ||
| 65 | { | ||
| 66 | if constexpr (std::is_same_v<buffer_type, mutable_buffer>) | ||
| 67 | 17023x | return mutable_buffer( | |
| 68 | 17023x | static_cast<char*>(b.data()) + front_n, | |
| 69 | 34046x | b.size() - front_n - back_n); | |
| 70 | else | ||
| 71 | 17162x | return const_buffer( | |
| 72 | 17162x | static_cast<char const*>(b.data()) + front_n, | |
| 73 | 34324x | b.size() - front_n - back_n); | |
| 74 | } | ||
| 75 | |||
| 76 | public: | ||
| 77 | /// Bidirectional iterator that adjusts the first and last buffers. | ||
| 78 | class const_iterator | ||
| 79 | { | ||
| 80 | iterator_type cur_{}; | ||
| 81 | iterator_type anchor_first_{}; | ||
| 82 | iterator_type anchor_last_{}; | ||
| 83 | std::size_t front_skip_ = 0; | ||
| 84 | std::size_t back_skip_ = 0; | ||
| 85 | |||
| 86 | public: | ||
| 87 | using iterator_category = std::bidirectional_iterator_tag; | ||
| 88 | using value_type = buffer_type; | ||
| 89 | using difference_type = std::ptrdiff_t; | ||
| 90 | using pointer = value_type*; | ||
| 91 | using reference = value_type; | ||
| 92 | |||
| 93 | const_iterator() noexcept = default; | ||
| 94 | |||
| 95 | 51198x | const_iterator( | |
| 96 | iterator_type cur, iterator_type anchor_first, | ||
| 97 | iterator_type anchor_last, std::size_t front_skip, | ||
| 98 | std::size_t back_skip) noexcept | ||
| 99 | 51198x | : cur_(cur) | |
| 100 | 51198x | , anchor_first_(anchor_first) | |
| 101 | 51198x | , anchor_last_(anchor_last) | |
| 102 | 51198x | , front_skip_(front_skip) | |
| 103 | 51198x | , back_skip_(back_skip) | |
| 104 | { | ||
| 105 | 51198x | } | |
| 106 | |||
| 107 | 59275x | bool operator==(const_iterator const& o) const noexcept | |
| 108 | { | ||
| 109 | 59275x | return cur_ == o.cur_; | |
| 110 | } | ||
| 111 | |||
| 112 | 59255x | bool operator!=(const_iterator const& o) const noexcept | |
| 113 | { | ||
| 114 | 59255x | return !(*this == o); | |
| 115 | } | ||
| 116 | |||
| 117 | 34185x | value_type operator*() const noexcept | |
| 118 | { | ||
| 119 | 34185x | buffer_type buf = *cur_; | |
| 120 | 34185x | auto const front_n = (cur_ == anchor_first_) ? front_skip_ : 0; | |
| 121 | 34185x | auto next = cur_; | |
| 122 | 34185x | ++next; | |
| 123 | 34185x | auto const back_n = (next == anchor_last_) ? back_skip_ : 0; | |
| 124 | 34185x | return adjust(buf, front_n, back_n); | |
| 125 | } | ||
| 126 | |||
| 127 | 21985x | const_iterator& operator++() noexcept { ++cur_; return *this; } | |
| 128 | 6450x | const_iterator operator++(int) noexcept | |
| 129 | 6450x | { auto t = *this; ++*this; return t; } | |
| 130 | 12144x | const_iterator& operator--() noexcept { --cur_; return *this; } | |
| 131 | 6072x | const_iterator operator--(int) noexcept | |
| 132 | 6072x | { auto t = *this; --*this; return t; } | |
| 133 | }; | ||
| 134 | |||
| 135 | /// Construct an empty slice. | ||
| 136 | slice_of() noexcept = default; | ||
| 137 | |||
| 138 | /** Construct a view of `[offset, offset + length)` bytes of `bs`. | ||
| 139 | |||
| 140 | @param bs The underlying sequence (must outlive the view). | ||
| 141 | @param offset Bytes skipped from the front. Clamped to the total. | ||
| 142 | @param length Bytes exposed; the default exposes to the end. | ||
| 143 | */ | ||
| 144 | 2293x | slice_of( | |
| 145 | BS const& bs, | ||
| 146 | std::size_t offset, | ||
| 147 | std::size_t length = | ||
| 148 | (std::numeric_limits<std::size_t>::max)()) noexcept | ||
| 149 | 2293x | { | |
| 150 | 2293x | first_ = capy::begin(bs); | |
| 151 | 2293x | last_ = capy::end(bs); | |
| 152 | |||
| 153 | // Position first_/front_skip_ at byte `offset` (single forward pass). | ||
| 154 | 2293x | std::size_t skip = offset; | |
| 155 | 2961x | while (first_ != last_) | |
| 156 | { | ||
| 157 | 2856x | std::size_t const sz = buffer_type(*first_).size(); | |
| 158 | 2856x | if (skip < sz) | |
| 159 | { | ||
| 160 | 2188x | front_skip_ = skip; | |
| 161 | 2188x | break; | |
| 162 | } | ||
| 163 | 668x | skip -= sz; | |
| 164 | 668x | ++first_; | |
| 165 | } | ||
| 166 | |||
| 167 | 2293x | if (first_ == last_) | |
| 168 | 181x | return; // offset at or past the end: empty slice | |
| 169 | 2188x | if (length == (std::numeric_limits<std::size_t>::max)()) | |
| 170 | 1043x | return; // to-end: last_ already end(bs), back_skip_ == 0 | |
| 171 | |||
| 172 | // Walk `length` live bytes forward to fix last_/back_skip_. | ||
| 173 | 1145x | std::size_t left = length; | |
| 174 | 1145x | auto cursor = first_; | |
| 175 | 1145x | std::size_t cursor_front = front_skip_; | |
| 176 | 1643x | while (cursor != last_ && left > 0) | |
| 177 | { | ||
| 178 | 1538x | std::size_t const sz = buffer_type(*cursor).size(); | |
| 179 | 1538x | std::size_t const avail = sz - cursor_front; | |
| 180 | 1538x | if (left <= avail) | |
| 181 | { | ||
| 182 | 1040x | back_skip_ = avail - left; | |
| 183 | 1040x | ++cursor; | |
| 184 | 1040x | last_ = cursor; | |
| 185 | 1040x | return; | |
| 186 | } | ||
| 187 | 498x | left -= avail; | |
| 188 | 498x | ++cursor; | |
| 189 | 498x | cursor_front = 0; | |
| 190 | } | ||
| 191 | 105x | last_ = cursor; | |
| 192 | } | ||
| 193 | |||
| 194 | /** Construct directly from a positioned iterator range. | ||
| 195 | |||
| 196 | Used by `consuming_buffers::data()` to expose its current position | ||
| 197 | without re-walking from the start. | ||
| 198 | */ | ||
| 199 | 362x | slice_of( | |
| 200 | iterator_type first, iterator_type last, | ||
| 201 | std::size_t front_skip = 0, std::size_t back_skip = 0) noexcept | ||
| 202 | 362x | : first_(first) | |
| 203 | 362x | , last_(last) | |
| 204 | 362x | , front_skip_(front_skip) | |
| 205 | 362x | , back_skip_(back_skip) | |
| 206 | { | ||
| 207 | 362x | } | |
| 208 | |||
| 209 | /// Return an iterator to the first buffer. | ||
| 210 | 25589x | const_iterator begin() const noexcept | |
| 211 | { | ||
| 212 | return const_iterator( | ||
| 213 | 25589x | first_, first_, last_, front_skip_, back_skip_); | |
| 214 | } | ||
| 215 | |||
| 216 | /// Return an iterator past the last buffer. | ||
| 217 | 25609x | const_iterator end() const noexcept | |
| 218 | { | ||
| 219 | return const_iterator( | ||
| 220 | 25609x | last_, first_, last_, front_skip_, back_skip_); | |
| 221 | } | ||
| 222 | }; | ||
| 223 | |||
| 224 | } // namespace detail | ||
| 225 | } // namespace capy | ||
| 226 | } // namespace boost | ||
| 227 | |||
| 228 | #endif | ||
| 229 |