xtd 0.2.0
Loading...
Searching...
No Matches
xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::iterator Class Reference

Definition

template<typename type_t, typename enumerable_t>
class xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::iterator

Represents the iterator of enumarable value type.

Static Public Member Functions

static iterator begin (const enumerable_t *enumerable)
 Create begin xtd::collections::generic::iterator with specified enumerator.
 
static iterator end (const enumerable_t *enumerable)
 Create end xtd::collections::generic::iterator with specified enumerator.
 

Public Aliases

using iterator_category = std::forward_iterator_tag
 Represents the iterator category type.
 
using value_type = type_t
 Represents the value type.
 
using difference_type = xtd::ptrdiff
 Represents the value type.
 
using pointer = value_type *
 Represents the pointer of the value type.
 
using const_pointer = const value_type *
 Represents the const pointer of the value type.
 
using reference = value_type &
 Represents the reference of the value type.
 
using const_reference = const value_type &
 Represents the const reference of the value type.
 

Public Constructors

 iterator ()=default
 Initializes a new instance of the xtd::collections::generic::iterator class.
 

Public Operators

const_reference operator* () const
 Returns reference to the current element, or a proxy holding it.
 
reference operator* ()
 Returns reference to the current element, or a proxy holding it.
 
const_pointer operator-> () const
 Returns pointer to the current element, or a proxy holding it.
 
pointer operator-> ()
 Returns pointer to the current element, or a proxy holding it.
 
iteratoroperator++ () noexcept
 Pre increments the underlying iterator.
 
iterator operator++ (int) noexcept
 Post increments the underlying iterator.
 
template<typename value_t >
iterator operator+ (value_t value) const noexcept
 Add operator with specified value.
 
difference_type operator- (iterator value) const noexcept
 Subtract The specified iterator from the current iterator.
 

Member Typedef Documentation

◆ iterator_category

template<typename type_t , typename enumerable_t >
using xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::iterator::iterator_category = std::forward_iterator_tag

Represents the iterator category type.

◆ value_type

template<typename type_t , typename enumerable_t >
using xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::iterator::value_type = type_t

Represents the value type.

◆ difference_type

template<typename type_t , typename enumerable_t >
using xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::iterator::difference_type = xtd::ptrdiff

Represents the value type.

◆ pointer

template<typename type_t , typename enumerable_t >
using xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::iterator::pointer = value_type*

Represents the pointer of the value type.

◆ const_pointer

template<typename type_t , typename enumerable_t >
using xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::iterator::const_pointer = const value_type*

Represents the const pointer of the value type.

◆ reference

template<typename type_t , typename enumerable_t >
using xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::iterator::reference = value_type&

Represents the reference of the value type.

◆ const_reference

template<typename type_t , typename enumerable_t >
using xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::iterator::const_reference = const value_type&

Represents the const reference of the value type.

Constructor & Destructor Documentation

◆ iterator()

template<typename type_t , typename enumerable_t >
xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::iterator::iterator ( )
default

Initializes a new instance of the xtd::collections::generic::iterator class.

Member Function Documentation

◆ begin()

template<typename type_t , typename enumerable_t >
static iterator xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::iterator::begin ( const enumerable_t *  enumerable)
inlinestatic

Create begin xtd::collections::generic::iterator with specified enumerator.

Parameters
enumeratorThe enumerator to iterate with.
Returns
The begin xtd::collections::generic::iterator.

◆ end()

template<typename type_t , typename enumerable_t >
static iterator xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::iterator::end ( const enumerable_t *  enumerable)
inlinestatic

Create end xtd::collections::generic::iterator with specified enumerator.

Parameters
enumeratorThe enumerator to iterate with.
Returns
The end xtd::collections::generic::iterator.

◆ operator*() [1/2]

template<typename type_t , typename enumerable_t >
const_reference xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::iterator::operator* ( ) const
inline

Returns reference to the current element, or a proxy holding it.

Returns
The reference to the current element.

◆ operator*() [2/2]

template<typename type_t , typename enumerable_t >
reference xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::iterator::operator* ( )
inline

Returns reference to the current element, or a proxy holding it.

Returns
The reference to the current element.

◆ operator->() [1/2]

template<typename type_t , typename enumerable_t >
const_pointer xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::iterator::operator-> ( ) const
inline

Returns pointer to the current element, or a proxy holding it.

Returns
The pointer to the current element.

◆ operator->() [2/2]

template<typename type_t , typename enumerable_t >
pointer xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::iterator::operator-> ( )
inline

Returns pointer to the current element, or a proxy holding it.

Returns
The pointer to the current element.

◆ operator++() [1/2]

template<typename type_t , typename enumerable_t >
iterator & xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::iterator::operator++ ( )
inlinenoexcept

Pre increments the underlying iterator.

Returns
The underlying iterator.

◆ operator++() [2/2]

template<typename type_t , typename enumerable_t >
iterator xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::iterator::operator++ ( int  )
inlinenoexcept

Post increments the underlying iterator.

Returns
The underlying iterator.

◆ operator+()

template<typename type_t , typename enumerable_t >
template<typename value_t >
iterator xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::iterator::operator+ ( value_t  value) const
inlinenoexcept

Add operator with specified value.

Parameters
valueThe number to add to the underlying iterator.
Returns
The underlying iterator.

◆ operator-()

template<typename type_t , typename enumerable_t >
difference_type xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::iterator::operator- ( iterator  value) const
inlinenoexcept

Subtract The specified iterator from the current iterator.

Parameters
valueThe iterator to subtract from the current iterator.
Returns
The difference between current iterator and the specified iterator.

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