System::Collections::Generic::IEnumerable< T >::EnumeratorBasedIterator< Value, Enumerator > Class Template Reference

Inherits iterator< std::forward_iterator_tag, Value, std::ptrdiff_t, Value *, MakeConstRef_t< Value > >.

Public Types

using reference = MakeConstRef_t< Value >
 

Public Member Functions

 EnumeratorBasedIterator (const EnumeratorBasedIterator &)=delete
 
EnumeratorBasedIteratoroperator= (const EnumeratorBasedIterator &)=delete
 
 EnumeratorBasedIterator (EnumeratorBasedIterator &&other)
 
EnumeratorBasedIteratoroperator= (EnumeratorBasedIterator &&other)
 
 EnumeratorBasedIterator (IEnumerable< Value > *enumerable, int position=-1)
 
EnumeratorBasedIteratoroperator++ ()
 
reference operator* () const
 

Friends

bool operator== (const EnumeratorBasedIterator &lhs, const EnumeratorBasedIterator &rhs)
 
bool operator!= (const EnumeratorBasedIterator &lhs, const EnumeratorBasedIterator &rhs)
 

Detailed Description

template<typename T>
template<typename Value, typename Enumerator>
class System::Collections::Generic::IEnumerable< T >::EnumeratorBasedIterator< Value, Enumerator >

Represents a base iterator implementation. For internal use only.

#include <system/collections/list.h>
#include <system/smart_ptr.h>
#include <algorithm>
#include <iterator>
using namespace System;
int main()
{
// Create the List-class instance.
auto collection = MakeObject<List<int>>();
// Fill the list.
collection->Add(1);
collection->Add(2);
collection->Add(3);
// Iterate over the collection using EnumeratorBasedIterator and print items.
std::ostream_iterator<int> osi(std::cout, " ");
std::copy(collection->begin(), collection->end(), osi);
return 0;
}
/*
* This code example produces the following output:
* 1 2 3
*/
Template Parameters
ValueThe type of the iterated items.
EnumeratorThe type of the enumerator.

Member Typedef Documentation

◆ reference

template<typename T>
template<typename Value , typename Enumerator >
using System::Collections::Generic::IEnumerable< T >::EnumeratorBasedIterator< Value, Enumerator >::reference = MakeConstRef_t<Value>

Constructor & Destructor Documentation

◆ EnumeratorBasedIterator() [1/3]

template<typename T>
template<typename Value , typename Enumerator >
System::Collections::Generic::IEnumerable< T >::EnumeratorBasedIterator< Value, Enumerator >::EnumeratorBasedIterator ( const EnumeratorBasedIterator< Value, Enumerator > &  )
delete

◆ EnumeratorBasedIterator() [2/3]

template<typename T>
template<typename Value , typename Enumerator >
System::Collections::Generic::IEnumerable< T >::EnumeratorBasedIterator< Value, Enumerator >::EnumeratorBasedIterator ( EnumeratorBasedIterator< Value, Enumerator > &&  other)
inline

◆ EnumeratorBasedIterator() [3/3]

template<typename T>
template<typename Value , typename Enumerator >
System::Collections::Generic::IEnumerable< T >::EnumeratorBasedIterator< Value, Enumerator >::EnumeratorBasedIterator ( IEnumerable< Value > *  enumerable,
int  position = -1 
)
inline

Member Function Documentation

◆ operator*()

template<typename T>
template<typename Value , typename Enumerator >
reference System::Collections::Generic::IEnumerable< T >::EnumeratorBasedIterator< Value, Enumerator >::operator* ( ) const
inline

◆ operator++()

template<typename T>
template<typename Value , typename Enumerator >
EnumeratorBasedIterator& System::Collections::Generic::IEnumerable< T >::EnumeratorBasedIterator< Value, Enumerator >::operator++ ( )
inline

◆ operator=() [1/2]

template<typename T>
template<typename Value , typename Enumerator >
EnumeratorBasedIterator& System::Collections::Generic::IEnumerable< T >::EnumeratorBasedIterator< Value, Enumerator >::operator= ( const EnumeratorBasedIterator< Value, Enumerator > &  )
delete

◆ operator=() [2/2]

template<typename T>
template<typename Value , typename Enumerator >
EnumeratorBasedIterator& System::Collections::Generic::IEnumerable< T >::EnumeratorBasedIterator< Value, Enumerator >::operator= ( EnumeratorBasedIterator< Value, Enumerator > &&  other)
inline

Friends And Related Function Documentation

◆ operator!=

template<typename T>
template<typename Value , typename Enumerator >
bool operator!= ( const EnumeratorBasedIterator< Value, Enumerator > &  lhs,
const EnumeratorBasedIterator< Value, Enumerator > &  rhs 
)
friend

◆ operator==

template<typename T>
template<typename Value , typename Enumerator >
bool operator== ( const EnumeratorBasedIterator< Value, Enumerator > &  lhs,
const EnumeratorBasedIterator< Value, Enumerator > &  rhs 
)
friend