Module |
|
Header |
/Engine/Source/Runtime/Core/Public/Algo/BinarySearch.h |
Include |
#include "Algo/BinarySearch.h" |
namespace Algo
{
template<typename RangeType, typename ValueType, typename ProjectionType, typename SortPredicateType>
auto Algo::BinarySearchBy
(
RangeType & Range,
const ValueType & Value,
ProjectionType Projection,
SortPredicateType SortPredicate
)
}
Returns index to the first found element with projected value matching Value in a range, the range must be sorted by predicate
Index of found element, or INDEX_NONE
Parameter |
Description |
---|---|
Range |
The range to search, must be already sorted by SortPredicate |
Value |
The value to search for |
Projection |
Functor or data member pointer, called via Invoke to compare to Value |
SortPredicate |
Predicate for sort comparison, defaults to < |