Algo::LowerBound

Performs binary search, resulting in position of the first element >= Value using predicate

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::LowerBound
    (
        RangeType & Range,
        const ValueType & Value,
        SortPredicateType SortPredicate
    )
}

Remarks

Performs binary search, resulting in position of the first element >= Value using predicate

Returns

Position of the first element >= Value, may be position after last element in range

Parameters

Parameter

Description

Range

Range to search through, must be already sorted by SortPredicate

Value

Value to look 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