3#include "../macros.hpp"
14template<
size_t LookaheadCount,
typename Iterator>
21 using value_type = iterator_type::value_type;
22 using reference = iterator_type::reference;
23 using const_reference = iterator_type::const_reference;
24 using pointer = iterator_type::pointer;
25 using const_pointer = iterator_type::const_pointer;
35 for (; _it != std::default_sentinel
and _size != max_size; ++_it, ++_size) {
63 [[
nodiscard]]
constexpr bool operator==(std::default_sentinel_t
const &)
const noexcept
113 hi_axiom(_size != 0);
121 hi_axiom(_size != 0);
122 return _cache->
data();
129 hi_axiom(_size != 0);
146template<
size_t LookaheadCount,
typename Iterator>
147auto make_lookahead_iterator(
Iterator &&
it)
noexcept
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377
Lookahead iterator.
Definition lookahead_iterator.hpp:15
const_reference operator[](size_t i) const noexcept
Get a reference to an item at or beyond the iterator.
Definition lookahead_iterator.hpp:73
constexpr size_t size() const noexcept
The number of entries can be looked ahead.
Definition lookahead_iterator.hpp:44
std::optional< value_type > next(size_t i=1) const noexcept
Get a reference to an item at or beyond the iterator.
Definition lookahead_iterator.hpp:100
const_reference operator*() const noexcept
Get a reference to the value at the iterator.
Definition lookahead_iterator.hpp:111
lookahead_iterator & operator++() noexcept
Increment the iterator.
Definition lookahead_iterator.hpp:127
const_pointer operator->() const noexcept
Get a pointer to the value at the iterator.
Definition lookahead_iterator.hpp:119
constexpr bool empty() const noexcept
Check if the iterator is at end.
Definition lookahead_iterator.hpp:53
const_reference at(size_t i) const
Get a reference to an item at or beyond the iterator.
Definition lookahead_iterator.hpp:85