Algo::UpperBoundBy

Performs binary search, resulting in position of the first element with projected value > 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 ProjectionType, typename SortPredicateType>
    auto Algo::UpperBoundBy
    (
        RangeType & Range,
        const ValueType & Value,
        ProjectionType Projection,
        SortPredicateType SortPredicate
    )
}

Remarks

Performs binary search, resulting in position of the first element with projected value > Value using predicate

Returns

Position of the first element > Value, may be past end of range

Parameters

Parameter

Description

Range

Range to search through, must be already sorted by SortPredicate

Value

Value to look for

Projection

Functor or data member pointer, called via Invoke to compare to Value

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