template<typename ElementT, std::size_t fixed_capacity = 0u, typename Container = typename std::conditional_t<(fixed_capacity >= 1u), std::array<ElementT, fixed_capacity>, std::vector<ElementT>>>
template<typename BufferPointer>
class gul14::SlidingBuffer< ElementT, fixed_capacity, Container >::SlidingBufferIterator< BufferPointer >
Iterator of the SlidingBuffer container.
This is a random access iterator.
- Invalidation
- An iterator is considered invalid if at least one of these conditions is true:
- it can not be safely dereferenced (implementation dependent or undefined behavior)
- it points to junk data
- it does not point to the element which it is supposed to point to
- Depending on what supposed means two specifications can be given:
- Iterator is supposed to point to a specific logical position/index in the buffer
- Iterator is supposed to point to a specific value held in the buffer
- It has the following guarantees for case 1:
- It has the following guarantees for case 2:
- No invalidation on any read
- All iterators invalidated by push_front()
- All iterators invalidated by push_back() after the container is filled
- Only end() invalidated on size increase by push_back()
- All iterators invalidated on size change
The SlidingBufferIterator represents a logical index in the SlidingBuffer. In other words, the iterator does not "follow" the sliding data when push_back() or push_front() are used.
- Template Parameters
-
BufferPointer | Type of the pointer used to access the SlidingBuffer |
- Since
- GUL version 2.0, SlidingBufferIterator fulfills the requirements of a LegacyRandomAccessIterator. In previous versions, it only fulfilled the requirements of a LegacyBidirectionalIterator.
|
auto | operator+ (const SlidingBufferIterator &it, difference_type d) noexcept -> SlidingBufferIterator |
| Add an integer to an iterator.
|
|
auto | operator+ (difference_type d, const SlidingBufferIterator &it) noexcept -> SlidingBufferIterator |
| Add an integer and an iterator.
|
|
auto | operator- (const SlidingBufferIterator &it, difference_type d) noexcept -> SlidingBufferIterator |
| Subtract an integer from an iterator.
|
|
auto | operator- (const SlidingBufferIterator &lhs, const SlidingBufferIterator &rhs) noexcept -> difference_type |
| Subtract two iterators.
|
|
auto | operator== (const SlidingBufferIterator &lhs, const SlidingBufferIterator &rhs) noexcept -> bool |
| Compare two iterators for equality. More...
|
|
auto | operator!= (const SlidingBufferIterator &lhs, const SlidingBufferIterator &rhs) noexcept -> bool |
| Compare two iterators for inequality. More...
|
|
auto | operator> (const SlidingBufferIterator &lhs, const SlidingBufferIterator &rhs) noexcept -> bool |
| Determine if the left iterator refers to a greater position than the right one.
|
|
auto | operator< (const SlidingBufferIterator &lhs, const SlidingBufferIterator &rhs) noexcept -> bool |
| Determine if the left iterator refers to a lower position than the right one.
|
|
auto | operator>= (const SlidingBufferIterator &lhs, const SlidingBufferIterator &rhs) noexcept -> bool |
| Determine if the left iterator refers to position that is greater than or equal to than the right one.
|
|
auto | operator<= (const SlidingBufferIterator &lhs, const SlidingBufferIterator &rhs) noexcept -> bool |
| Determine if the left iterator refers to a position that is less than or equal to than the right one.
|
|
template<typename ElementT , std::size_t fixed_capacity = 0u, typename Container = typename std::conditional_t<(fixed_capacity >= 1u), std::array<ElementT, fixed_capacity>, std::vector<ElementT>>>
template<typename BufferPointer >
Compare two iterators for inequality.
Both iterators must be from the same container, or the result is undefined.
template<typename ElementT , std::size_t fixed_capacity = 0u, typename Container = typename std::conditional_t<(fixed_capacity >= 1u), std::array<ElementT, fixed_capacity>, std::vector<ElementT>>>
template<typename BufferPointer >
Compare two iterators for equality.
Both iterators must be from the same container, or the result is undefined.