sparrow 0.9.0
Loading...
Searching...
No Matches
sparrow::empty_iterator< T > Class Template Reference

Iterator for null arrays where all elements are null. More...

#include <null_array.hpp>

Inheritance diagram for sparrow::empty_iterator< T >:
[legend]
Collaboration diagram for sparrow::empty_iterator< T >:
[legend]

Public Types

using self_type = empty_iterator<T>
 
using base_type = iterator_base<self_type, T, std::contiguous_iterator_tag, T>
 
using reference = typename base_type::reference
 
using difference_type = typename base_type::difference_type
 

Public Member Functions

 empty_iterator (difference_type index=difference_type()) noexcept
 Constructs an empty iterator at the specified position.
 

Friends

class iterator_access
 

Detailed Description

template<class T>
class sparrow::empty_iterator< T >

Iterator for null arrays where all elements are null.

This iterator provides a memory-efficient way to iterate over null arrays without storing actual data. It generates null values on-demand and maintains position information to support all iterator operations.

The iterator satisfies the contiguous iterator concept despite not pointing to actual memory, as it represents a conceptually contiguous sequence of identical null values.

Template Parameters
TThe value type of the iterator (typically nullable<null_type>)
Precondition
T must be default constructible to represent null values
Postcondition
Iterator provides contiguous iterator semantics
Dereferencing always yields default-constructed T (null value)
Iterator operations have O(1) complexity
auto null_val = *it; // Always returns default-constructed nullable
++it; // Advances position counter
empty_iterator(difference_type index=difference_type()) noexcept
Constructs an empty iterator at the specified position.

Definition at line 58 of file null_array.hpp.

Member Typedef Documentation

◆ base_type

template<class T>
using sparrow::empty_iterator< T >::base_type = iterator_base<self_type, T, std::contiguous_iterator_tag, T>

Definition at line 63 of file null_array.hpp.

◆ difference_type

template<class T>
using sparrow::empty_iterator< T >::difference_type = typename base_type::difference_type

Definition at line 65 of file null_array.hpp.

◆ reference

template<class T>
using sparrow::empty_iterator< T >::reference = typename base_type::reference

Definition at line 64 of file null_array.hpp.

◆ self_type

template<class T>
using sparrow::empty_iterator< T >::self_type = empty_iterator<T>

Definition at line 62 of file null_array.hpp.

Constructor & Destructor Documentation

◆ empty_iterator()

template<class T>
sparrow::empty_iterator< T >::empty_iterator ( difference_type index = difference_type())
explicitnoexcept

Constructs an empty iterator at the specified position.

Parameters
indexPosition index for the iterator (defaults to 0)
Postcondition
Iterator is positioned at the specified index
Iterator is ready for all iterator operations

Definition at line 585 of file null_array.hpp.

Friends And Related Symbol Documentation

◆ iterator_access

template<class T>
friend class iterator_access
friend

Definition at line 148 of file null_array.hpp.


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