gz-cpp-util 1.3
A c++20 library containing various utilities
gz::RingBuffer< T >::Iterator Struct Reference

Bidirectonal iterator for the RingBuffer. More...

#include <ringbuffer.hpp>

Public Types

using value_type = T
 

Public Member Functions

 Iterator (const RingBuffer< T > &b, size_t index)
 
 Iterator (const Iterator &other)
 
T & operator* () const
 
Iteratoroperator= (const Iterator &other)
 
Iteratoroperator++ ()
 
Iterator operator++ (int)
 
 Iterator ()
 
bool operator== (const Iterator &other) const
 
Iteratoroperator-- ()
 
Iterator operator-- (int)
 
std::string to_string () const
 Get the index of the vector that ptr points to.
 

Private Member Functions

size_t getCurrentIndex () const
 

Private Attributes

T * ptr
 
const RingBuffer< T > & b
 

Friends

int operator- (Iterator lhs, Iterator rhs)
 

Detailed Description

template<std::swappable T>
struct gz::RingBuffer< T >::Iterator

Bidirectonal iterator for the RingBuffer.

Todo:
make a const and non-const version, since const here is all over the place

Constructor & Destructor Documentation

◆ Iterator()

template<std::swappable T>
gz::RingBuffer< T >::Iterator::Iterator ( )
inline
Warning
Default constructor has to be defined for std::forward_iterator but can not be used, since reference to RingBuffer<T> can not be initialized! Your compiler should (hopefully) not allow it.

The documentation for this struct was generated from the following file: