Algo::BinarySearch

Returns index to the first found element matching a value in a range, the range must be sorted by <

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Algo/BinarySearch.h

Include

#include "Algo/BinarySearch.h"

Syntax

namespace Algo
{
    template<typename RangeType, typename ValueType, typename SortPredicateType>
    auto Algo::BinarySearch
    (
        RangeType & Range,
        const ValueType & Value,
        SortPredicateType SortPredicate
    )
}

Remarks

Returns index to the first found element matching a value in a range, the range must be sorted by <

Returns

Index of found element, or INDEX_NONE

Parameters

Parameter

Description

Range

The range to search, must be already sorted by SortPredicate

Value

The value to search for

SortPredicate

Predicate for sort comparison, defaults to <

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss