TIndexedContainerIterator

Generic iterator which can operate on types that expose the following:

Windows
MacOS
Linux

Syntax

template<typename ContainerType, typename ElementType, typename IndexType>
class TIndexedContainerIterator

Remarks

Generic iterator which can operate on types that expose the following:

  • A type called ElementType representing the contained type.

  • A method IndexType Num() const that returns the number of items in the container.

  • A method bool IsValidIndex(IndexType index) which returns whether a given index is valid in the container.

  • A method T& operator[](IndexType index) which returns a reference to a contained object by index.

  • A method void RemoveAt(IndexType index) which removes the element at index

Constructors

Name Description

Public function

TIndexedContainerIterator

(
    ContainerType& InContainer,
    IndexType StartIndex
)

Functions

Name Description

Public function Const

IndexType

 

GetIndex()

Returns an index to the current element.

Public function

void

 

RemoveCurrent()

Removes current element in array.

Public function

void

 

Reset()

Resets the iterator to the first element.

Public function

void

 

SetToEnd()

Sets iterator to the last element.

Operators

Name Description

Public function Const

TIndexedCont...

 

operator-

(
    int32 Offset
)

Public function

TIndexedCont...

 

operator--()

Moves iterator to the previous element in the container.

Public function

TIndexedCont...

 

operator--

(
    int
)

Public function Const

 

operator bool()

Conversion to "bool" returning true if the iterator has not reached the last element.

Public function Const

ElementType ...

 

operator*()

Public function Const

TIndexedCont...

 

operator+

(
    int32 Offset
)

Public function

TIndexedCont...

 

operator++

(
    int
)

Public function

TIndexedCont...

 

operator++()

Advances iterator to the next element in the container.

Public function

TIndexedCont...

 

operator+=

(
    int32 Offset
)

Iterator arithmetic support

Public function

TIndexedCont...

 

operator-=

(
    int32 Offset
)

Public function Const

ElementType ...

 

operator->()

References

Module

Core

Header

Runtime/Core/Public/Containers/Array.h

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback