Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
EnumerateRange.h File Reference
#include "Templates/UnrealTemplate.h"
#include <iterator>
#include <type_traits>
+ Include dependency graph for EnumerateRange.h:

Go to the source code of this file.

Classes

struct  TEnumerateRef< ElementType, SizeType >
 
struct  UE::Core::Private::TEnumerateIter< IteratorType, SizeType >
 
struct  TEnumerateRange< RangeType, SizeType >
 

Namespaces

namespace  UE
 
namespace  UE::Core
 
namespace  UE::Core::Private
 

Typedefs

template<typename ElementType , typename SizeType = int32>
using TConstEnumerateRef = TEnumerateRef<const ElementType, SizeType>
 

Functions

template<typename RangeType >
auto EnumerateRange (RangeType &&Range) -> TEnumerateRange< RangeType, decltype(GetNum(Range))>
 

Variables

template<typename T , SIZE_T N>
TEnumerateRange< T(&) EnumerateRange [N], int32 >(T(&Range)[N])
 

Typedef Documentation

◆ TConstEnumerateRef

template<typename ElementType , typename SizeType = int32>
using TConstEnumerateRef = TEnumerateRef<const ElementType, SizeType>

Definition at line 45 of file EnumerateRange.h.

Function Documentation

◆ EnumerateRange()

template<typename RangeType >
auto EnumerateRange ( RangeType && Range) -> TEnumerateRange<RangeType, decltype(GetNum(Range))>

Allows iterating over a range while also keeping track of the current iteration index.

Usage:

for (TEnumerateRef<T> Elem : EnumerateRange(Container)) { Elem->MemberFunctionOfT(); FunctionTakingT(*Elem); int32 Index = Elem.GetIndex(); }

TEnumerateRef<const T> or TConstEnumerateRef<T> can be used for const iteration.

Iterating over larger containers like TArray64 will require an explicit SizeType parameter: TEnumerateRef<T, int64>

Definition at line 108 of file EnumerateRange.h.

Variable Documentation

◆ EnumerateRange

template<typename T , SIZE_T N>
TEnumerateRange< T(&) EnumerateRange[N], int32 >(T(&Range)[N]) ( T(&) Range[N])

Definition at line 113 of file EnumerateRange.h.