|
HikoGUI
A low latency retained GUI
|
#include <hikogui/parser/lookahead_iterator.hpp>
Data Structures | |
| class | proxy |
Public Types | |
| using | value_type = std::iterator_traits<It>::value_type |
| using | reference = value_type const & |
| using | pointer = value_type const * |
| using | difference_type = std::ptrdiff_t |
| using | iterator_category = std::forward_iterator_tag |
Public Member Functions | |
| constexpr | lookahead_iterator (lookahead_iterator const &) noexcept=delete |
| constexpr | lookahead_iterator (lookahead_iterator &&) noexcept=default |
| constexpr lookahead_iterator & | operator= (lookahead_iterator const &) noexcept=delete |
| constexpr lookahead_iterator & | operator= (lookahead_iterator &&) noexcept=default |
| constexpr | lookahead_iterator (It first, ItEnd last) noexcept |
| constexpr size_t | size () const noexcept |
| The number of entries can be looked ahead. | |
| constexpr bool | empty () const noexcept |
| Check if the iterator is at end. | |
| constexpr | operator bool () const noexcept |
| constexpr bool | operator== (std::default_sentinel_t) const noexcept |
| constexpr reference | operator[] (size_t i) const noexcept |
| Get a reference to an item at or beyond the iterator. | |
| constexpr reference | at (size_t i) const |
| Get a reference to an item at or beyond the iterator. | |
| constexpr std::optional< value_type > | next (size_t i=1) const noexcept |
| Get a reference to an item at or beyond the iterator. | |
| constexpr reference | operator* () const noexcept |
| Get a reference to the value at the iterator. | |
| constexpr pointer | operator-> () const noexcept |
| Get a pointer to the value at the iterator. | |
| constexpr lookahead_iterator & | operator++ () noexcept |
| Increment the iterator. | |
| constexpr lookahead_iterator & | operator+= (size_t n) noexcept |
| constexpr proxy | operator++ (int) noexcept |
Static Public Attributes | |
| static constexpr size_t | max_size = LookaheadCount |
Lookahead iterator.
This iterator adapter takes a forward input iterator and adapts it so that you can look ahead beyond the current position of the iterator. This is useful when writing a parser.
|
inlineconstexpr |
Get a reference to an item at or beyond the iterator.
| i | Index to lookahead, 0 means the current iterator, larger than zero is lookahead. |
| std::out_of_range | when index beyond the lookahead buffer. |
|
inlineconstexprnoexcept |
Check if the iterator is at end.
| true | Iterator at end. |
|
inlineconstexprnoexcept |
Get a reference to an item at or beyond the iterator.
| i | Index to lookahead, 0 means the current iterator, larger than zero is lookahead. |
| std::nullopt | When the index points beyond the lookahead buffer. |
|
inlineconstexprnoexcept |
Get a reference to the value at the iterator.
|
inlineconstexprnoexcept |
Increment the iterator.
|
inlineconstexprnoexcept |
Get a pointer to the value at the iterator.
|
inlineconstexprnoexcept |
Get a reference to an item at or beyond the iterator.
| i | Index to lookahead, 0 means the current iterator, larger than zero is lookahead. |
|
inlineconstexprnoexcept |
The number of entries can be looked ahead.