Ginger 1.1.5; VERSION ${PROJECT_VERSION}
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
fun::Robin< T > Struct Template Reference

Robin Hood iterator for cycle iteration. More...

#include <robin.hpp>

Public Member Functions

 Robin (T num_parts)
 Construct a new Robin cycle.
 
auto exclude (T from_part) const -> detail::RobinIterableWrapper< T >
 Get an iterable that excludes a specific element.
 

Public Attributes

std::vector< detail::RobinSlNode< T > > cycle
 

Detailed Description

template<typename T>
struct fun::Robin< T >

Robin Hood iterator for cycle iteration.

A data structure that creates a circular linked list allowing iteration over all elements except a specified one (the "exclude" operation).

Template Parameters
TThe type of indices in the cycle

Constructor & Destructor Documentation

◆ Robin()

template<typename T >
fun::Robin< T >::Robin ( num_parts)
inlineexplicit

Construct a new Robin cycle.

Creates a circular linked list containing all indices from 0 to num_parts-1.

Parameters
num_partsThe number of elements in the cycle

Member Function Documentation

◆ exclude()

template<typename T >
auto fun::Robin< T >::exclude ( from_part) const -> detail::RobinIterableWrapper<T>
inline

Get an iterable that excludes a specific element.

Returns an iterable that allows iterating over all elements in the cycle except the one at the specified index.

Parameters
from_partThe index to exclude from iteration
Returns
detail::RobinIterableWrapper<T> An iterable over the remaining elements

Member Data Documentation

◆ cycle

template<typename T >
std::vector<detail::RobinSlNode<T> > fun::Robin< T >::cycle

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