kblib 0.2.3
General utilities library for modern C++
kblib::enumerate_iterator< It > Struct Template Reference

#include <kblib/enumerate-contrib-tw.h>

Public Types

using nested_reference = typename std::iterator_traits< It >::reference
 
using difference_type = std::ptrdiff_t
 
using value_type = std::pair< nested_reference, std::size_t >
 
using pointer = void
 
using reference = value_type
 
using iterator_category = std::input_iterator_tag
 

Public Member Functions

constexpr auto operator* () -> value_type
 
constexpr auto operator++ () &-> enumerate_iterator &
 
constexpr auto operator++ (int) -> enumerate_iterator
 
template<typename OIt >
constexpr auto operator== (OIt rhs) -> decltype(std::declval< It & >()==std::declval< OIt & >())
 
template<typename OIt >
constexpr auto operator!= (OIt rhs) -> decltype(std::declval< It & >() !=std::declval< OIt & >())
 

Public Attributes

It it
 
std::size_t idx
 

Friends

constexpr friend auto operator== (enumerate_iterator lhs, enumerate_iterator rhs) -> bool
 
constexpr friend auto operator!= (enumerate_iterator lhs, enumerate_iterator rhs) -> bool
 

Detailed Description

template<typename It>
struct kblib::enumerate_iterator< It >
Author
Tobias Widlund, killerbee
Date
2018-2020

Definition at line 44 of file enumerate-contrib-tw.h.

Member Typedef Documentation

◆ difference_type

template<typename It >
using kblib::enumerate_iterator< It >::difference_type = std::ptrdiff_t

Definition at line 50 of file enumerate-contrib-tw.h.

◆ iterator_category

template<typename It >
using kblib::enumerate_iterator< It >::iterator_category = std::input_iterator_tag

Definition at line 54 of file enumerate-contrib-tw.h.

◆ nested_reference

template<typename It >
using kblib::enumerate_iterator< It >::nested_reference = typename std::iterator_traits<It>::reference

Definition at line 48 of file enumerate-contrib-tw.h.

◆ pointer

template<typename It >
using kblib::enumerate_iterator< It >::pointer = void

Definition at line 52 of file enumerate-contrib-tw.h.

◆ reference

template<typename It >
using kblib::enumerate_iterator< It >::reference = value_type

Definition at line 53 of file enumerate-contrib-tw.h.

◆ value_type

template<typename It >
using kblib::enumerate_iterator< It >::value_type = std::pair<nested_reference, std::size_t>

Definition at line 51 of file enumerate-contrib-tw.h.

Member Function Documentation

◆ operator!=()

template<typename It >
template<typename OIt >
constexpr auto kblib::enumerate_iterator< It >::operator!= ( OIt  rhs) -> decltype(std::declval<It&>() != std::declval<OIt&>())
inlineconstexpr

Definition at line 75 of file enumerate-contrib-tw.h.

◆ operator*()

template<typename It >
constexpr auto kblib::enumerate_iterator< It >::operator* ( ) -> value_type
inlineconstexpr

Definition at line 56 of file enumerate-contrib-tw.h.

◆ operator++() [1/2]

template<typename It >
constexpr auto kblib::enumerate_iterator< It >::operator++ ( ) & -> enumerate_iterator&
inlineconstexpr

Definition at line 58 of file enumerate-contrib-tw.h.

◆ operator++() [2/2]

template<typename It >
constexpr auto kblib::enumerate_iterator< It >::operator++ ( int  ) -> enumerate_iterator
inlineconstexpr

Definition at line 63 of file enumerate-contrib-tw.h.

◆ operator==()

template<typename It >
template<typename OIt >
constexpr auto kblib::enumerate_iterator< It >::operator== ( OIt  rhs) -> decltype(std::declval<It&>() == std::declval<OIt&>())
inlineconstexpr

Definition at line 70 of file enumerate-contrib-tw.h.

Friends And Related Function Documentation

◆ operator!=

template<typename It >
constexpr friend auto operator!= ( enumerate_iterator< It >  lhs,
enumerate_iterator< It >  rhs 
) -> bool
friend

Definition at line 84 of file enumerate-contrib-tw.h.

◆ operator==

template<typename It >
constexpr friend auto operator== ( enumerate_iterator< It >  lhs,
enumerate_iterator< It >  rhs 
) -> bool
friend

Definition at line 80 of file enumerate-contrib-tw.h.

Member Data Documentation

◆ idx

template<typename It >
std::size_t kblib::enumerate_iterator< It >::idx

Definition at line 46 of file enumerate-contrib-tw.h.

◆ it

template<typename It >
It kblib::enumerate_iterator< It >::it

Definition at line 45 of file enumerate-contrib-tw.h.


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