EraseIterator< COLLECTION, SWAP_ERASE, IS_FOREACH_ITERATOR > Class Template Reference Data Structures

#include <foreach.h>

Inheritance diagram for EraseIterator< COLLECTION, SWAP_ERASE, IS_FOREACH_ITERATOR >:

详细描述

template<typename COLLECTION, Bool SWAP_ERASE, Bool IS_FOREACH_ITERATOR = IsForEachIterator<typename COLLECTION::Iterator>::value>
class maxon::EraseIterator< COLLECTION, SWAP_ERASE, IS_FOREACH_ITERATOR >

An EraseIterator is returned by Iterable::EraseIterator . It provides the Erase function which allows to erase the current iteration value from the underlying collection.

另请参阅
Iterable::EraseIterator
Iterable::SwapEraseIterator

Public Types

using  Super = ForEachIterator < EraseIterator , typename COLLECTION::Iterator >
-  Public Types inherited from ForEachIterator< EraseIterator< COLLECTION, SWAP_ERASE, IsForEachIterator< typename COLLECTION::Iterator >::value >, COLLECTION::Iterator >
using  IsForEachIterator = std::true_type

公共成员函数

  EraseIterator (COLLECTION &collection)
  EraseIterator ( EraseIterator && src )
template<typename... ARGS>
void  Erase (ARGS &&... args)
void  operator++ ()
void  operator++ (int)
-  Public Member Functions inherited from ForEachIterator< EraseIterator< COLLECTION, SWAP_ERASE, IsForEachIterator< typename COLLECTION::Iterator >::value >, COLLECTION::Iterator >
MAXON_ATTRIBUTE_FORCE_INLINE   ForEachIterator (ARGS &&... args)
String   ToString (const FormatStatement *formatStatement=nullptr)
EraseIterator < COLLECTION, SWAP_ERASE, IsForEachIterator < typename COLLECTION::Iterator >::value > &  Find (const T &v)
Int   FindIndex (const T &v)
MAXON_ATTRIBUTE_FORCE_INLINE Bool   Contains (const T &v)
MAXON_ATTRIBUTE_FORCE_INLINE Wrapper  begin ()

私有成员函数

void  operator-- ()
void  operator-- (int)
void  operator+= (int)
void  operator-= (int)
void  operator+ (int)
void  operator- (int)
  MAXON_DISALLOW_COPY_AND_ASSIGN ( EraseIterator )

Private Attributes

COLLECTION *  _collection
Bool   _erased

Additional Inherited Members

-  Static Public Member Functions inherited from ForEachIterator< EraseIterator< COLLECTION, SWAP_ERASE, IsForEachIterator< typename COLLECTION::Iterator >::value >, COLLECTION::Iterator >
static MAXON_ATTRIBUTE_FORCE_INLINE   PRIVATE_MAXON_RBF_SENTINEL (Wrapper) end()

Member Typedef Documentation

◆  Super

using Super = ForEachIterator < EraseIterator , typename COLLECTION::Iterator>

构造函数 & 析构函数文档编制

◆  EraseIterator() [1/2]

EraseIterator ( COLLECTION &  collection )
explicit

◆  EraseIterator() [2/2]

EraseIterator ( EraseIterator < COLLECTION, SWAP_ERASE, IS_FOREACH_ITERATOR > &&  src )

成员函数文档编制

◆  Erase()

void Erase ( ARGS &&...  args )

Removes the current iteration value from the underlying collection. This is a simple and safe way to remove a value from a collection within a for loop. You must not access the removed iteration value afterwards, the only valid operation on an iterator after Erase is ++iterator. Example:

for ( auto it = Iterable::EraseIterator (array); it; ++it) { if (*it == valueToErase) it.Erase(); }

◆  operator++() [1/2]

void operator++ ( )

◆  operator++() [2/2]

void operator++ ( int  )

◆  operator--() [1/2]

void operator-- ( )
private

◆  operator--() [2/2]

void operator-- ( int  )
private

◆  operator+=()

void operator+= ( int  )
private

◆  operator-=()

void operator-= ( int  )
private

◆  operator+()

void operator+ ( int  )
private

◆  operator-()

void operator- ( int  )
private

◆  MAXON_DISALLOW_COPY_AND_ASSIGN()

MAXON_DISALLOW_COPY_AND_ASSIGN ( EraseIterator < COLLECTION, SWAP_ERASE, IS_FOREACH_ITERATOR >  )
private

Member Data Documentation

◆  _collection

COLLECTION* _collection private

◆  _erased

Bool _erased
private
maxon::Iterable::EraseIterator
static MAXON_ATTRIBUTE_FORCE_INLINE maxon::EraseIterator< COLLECTION, false > EraseIterator(COLLECTION &c)
定义: foreach.h:1321