5#include "Templates/IdentityFunctor.h"
6#include "Templates/Invoke.h"
7#include "Templates/UnrealTemplate.h"
11 template <
typename RangeType,
typename ValueType,
typename ProjectionType>
12 auto IndexOfBy(RangeType&& Range,
const ValueType& Value, ProjectionType Proj)
14 auto Num = GetNum(Range);
15 auto Data = GetData(Range);
17 using SizeType =
decltype(Num);
18 for (SizeType Index = 0; Index < Num; ++Index)
20 if (Invoke(Proj, Data[Index]) == Value)
29 template <
typename RangeType,
typename PredicateType>
32 auto Num = GetNum(Range);
33 auto Data = GetData(Range);
35 using SizeType =
decltype(Num);
36 for (SizeType Index = 0; Index < Num; ++Index)
38 if (Invoke(Pred, Data[Index]))
51
52
53
54
55
56
57
58 template <
typename RangeType,
typename ValueType>
66
67
68
69
70
71
72
73
74 template <
typename RangeType,
typename ValueType,
typename ProjectionType>
78 return AlgoImpl::IndexOfBy(Forward<RangeType>(Range), Value, MoveTemp(Proj));
82
83
84
85
86
87
88
89 template <
typename RangeType,
typename PredicateType>
93 return AlgoImpl::IndexOfByPredicate(Forward<RangeType>(Range), MoveTemp(Pred));
FORCEINLINE auto IndexOf(RangeType &&Range, const ValueType &Value)
FORCEINLINE auto IndexOfByPredicate(RangeType &&Range, PredicateType Pred)
FORCEINLINE auto IndexOfBy(RangeType &&Range, const ValueType &Value, ProjectionType Proj)
auto IndexOfByPredicate(RangeType &&Range, PredicateType Pred)
auto IndexOfBy(RangeType &&Range, const ValueType &Value, ProjectionType Proj)