Belle II Software development
span< T >::iterator Class Reference

Public Types

using iterator_category = std::forward_iterator_tag
 
using value_type = T
 
using difference_type = std::ptrdiff_t
 
using pointer = T *
 
using reference = T &
 

Public Member Functions

 iterator (std::byte *ptr, size_type stride)
 
reference operator* () const
 
pointer operator-> () const
 
iteratoroperator++ ()
 
iterator operator++ (int)
 

Private Attributes

std::byte * m_ptr
 
size_type m_stride
 

Friends

bool operator== (const iterator &a, const iterator &b)
 
bool operator!= (const iterator &a, const iterator &b)
 

Detailed Description

template<typename T>
class nt::span< T >::iterator

Definition at line 43 of file ntuples_full.h.

Member Typedef Documentation

◆ difference_type

using difference_type = std::ptrdiff_t

Definition at line 47 of file ntuples_full.h.

◆ iterator_category

using iterator_category = std::forward_iterator_tag

Definition at line 45 of file ntuples_full.h.

◆ pointer

using pointer = T*

Definition at line 48 of file ntuples_full.h.

◆ reference

using reference = T&

Definition at line 49 of file ntuples_full.h.

◆ value_type

using value_type = T

Definition at line 46 of file ntuples_full.h.

Constructor & Destructor Documentation

◆ iterator()

iterator ( std::byte *  ptr,
size_type  stride 
)
inline

Definition at line 51 of file ntuples_full.h.

52 : m_ptr(ptr), m_stride(stride) {}

Member Function Documentation

◆ operator*()

reference operator* ( ) const
inline

Definition at line 54 of file ntuples_full.h.

54{ return *reinterpret_cast<pointer>(m_ptr); }

◆ operator++() [1/2]

iterator & operator++ ( )
inline

Definition at line 57 of file ntuples_full.h.

58 {
59 m_ptr += m_stride;
60 return *this;
61 }

◆ operator++() [2/2]

iterator operator++ ( int  )
inline

Definition at line 63 of file ntuples_full.h.

64 {
65 iterator temp = *this;
66 m_ptr += m_stride;
67 return temp;
68 }

◆ operator->()

pointer operator-> ( ) const
inline

Definition at line 55 of file ntuples_full.h.

55{ return reinterpret_cast<pointer>(m_ptr); }

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const iterator a,
const iterator b 
)
friend

Definition at line 75 of file ntuples_full.h.

76 {
77 return a.m_ptr != b.m_ptr;
78 }

◆ operator==

bool operator== ( const iterator a,
const iterator b 
)
friend

Definition at line 70 of file ntuples_full.h.

71 {
72 return a.m_ptr == b.m_ptr;
73 }

Member Data Documentation

◆ m_ptr

std::byte* m_ptr
private

Definition at line 81 of file ntuples_full.h.

◆ m_stride

size_type m_stride
private

Definition at line 82 of file ntuples_full.h.


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