EraseIterator< COLLECTION, SWAP_ERASE, IS_FOREACH_ITERATOR > Class Template Reference Data Structures
#include <foreach.h>
An EraseIterator is returned by Iterable::EraseIterator . It provides the Erase function which allows to erase the current iteration value from the underlying collection.
Public Types |
|
using | Super = ForEachIterator < EraseIterator , typename 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) |
![]() |
|
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 MAXON_ATTRIBUTE_FORCE_INLINE | PRIVATE_MAXON_RBF_SENTINEL (Wrapper) end() |
using Super = ForEachIterator < EraseIterator , typename COLLECTION::Iterator> |
|
explicit |
EraseIterator | ( | EraseIterator < COLLECTION, SWAP_ERASE, IS_FOREACH_ITERATOR > && | src | ) |
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(); }void operator++ | ( | ) |
void operator++ | ( | int | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
COLLECTION* _collection | private |
|
private |