UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
uLang::Algo Namespace Reference

Functions

template<typename RangeType , typename ValueType , typename SortPredicateType >
ULANG_FORCEINLINE auto LowerBound (const RangeType &Range, const ValueType &Value, SortPredicateType SortPredicate) -> decltype(GetNum(Range))
 
template<typename RangeType , typename ValueType >
ULANG_FORCEINLINE auto LowerBound (const RangeType &Range, const ValueType &Value) -> decltype(GetNum(Range))
 
template<typename RangeType , typename ValueType , typename ProjectionType , typename SortPredicateType >
ULANG_FORCEINLINE auto LowerBoundBy (const RangeType &Range, const ValueType &Value, ProjectionType Projection, SortPredicateType SortPredicate) -> decltype(GetNum(Range))
 
template<typename RangeType , typename ValueType , typename ProjectionType >
ULANG_FORCEINLINE auto LowerBoundBy (const RangeType &Range, const ValueType &Value, ProjectionType Projection) -> decltype(GetNum(Range))
 
template<typename RangeType , typename ValueType , typename SortPredicateType >
ULANG_FORCEINLINE auto UpperBound (const RangeType &Range, const ValueType &Value, SortPredicateType SortPredicate) -> decltype(GetNum(Range))
 
template<typename RangeType , typename ValueType >
ULANG_FORCEINLINE auto UpperBound (const RangeType &Range, const ValueType &Value) -> decltype(GetNum(Range))
 
template<typename RangeType , typename ValueType , typename ProjectionType , typename SortPredicateType >
ULANG_FORCEINLINE auto UpperBoundBy (const RangeType &Range, const ValueType &Value, ProjectionType Projection, SortPredicateType SortPredicate) -> decltype(GetNum(Range))
 
template<typename RangeType , typename ValueType , typename ProjectionType >
ULANG_FORCEINLINE auto UpperBoundBy (const RangeType &Range, const ValueType &Value, ProjectionType Projection) -> decltype(GetNum(Range))
 
template<typename RangeType , typename ValueType , typename SortPredicateType >
ULANG_FORCEINLINE auto BinarySearch (const RangeType &Range, const ValueType &Value, SortPredicateType SortPredicate) -> decltype(GetNum(Range))
 
template<typename RangeType , typename ValueType >
ULANG_FORCEINLINE auto BinarySearch (const RangeType &Range, const ValueType &Value)
 
template<typename RangeType , typename ValueType , typename ProjectionType , typename SortPredicateType >
ULANG_FORCEINLINE auto BinarySearchBy (const RangeType &Range, const ValueType &Value, ProjectionType Projection, SortPredicateType SortPredicate) -> decltype(GetNum(Range))
 
template<typename RangeType , typename ValueType , typename ProjectionType >
ULANG_FORCEINLINE auto BinarySearchBy (const RangeType &Range, const ValueType &Value, ProjectionType Projection)
 
template<typename RangeType >
ULANG_FORCEINLINE void HeapSort (RangeType &Range)
 
template<typename RangeType , typename PredicateType >
ULANG_FORCEINLINE void HeapSort (RangeType &Range, PredicateType Predicate)
 
template<typename RangeType , typename ProjectionType >
ULANG_FORCEINLINE void HeapSortBy (RangeType &Range, ProjectionType Projection)
 
template<typename RangeType , typename ProjectionType , typename PredicateType >
ULANG_FORCEINLINE void HeapSortBy (RangeType &Range, ProjectionType Projection, PredicateType Predicate)
 
template<typename RangeType >
ULANG_FORCEINLINE void IntroSort (RangeType &&Range)
 
template<typename RangeType , typename PredicateType >
ULANG_FORCEINLINE void IntroSort (RangeType &&Range, PredicateType Predicate)
 
template<typename RangeType , typename ProjectionType >
ULANG_FORCEINLINE void IntroSortBy (RangeType &&Range, ProjectionType Projection)
 
template<typename RangeType , typename ProjectionType , typename PredicateType >
ULANG_FORCEINLINE void IntroSortBy (RangeType &&Range, ProjectionType Projection, PredicateType Predicate)
 
template<typename RangeType >
ULANG_FORCEINLINE size_t Rotate (RangeType &&Range, size_t Count)
 
template<typename RangeType >
ULANG_FORCEINLINE void Sort (RangeType &&Range)
 
template<typename RangeType , typename PredicateType >
ULANG_FORCEINLINE void Sort (RangeType &&Range, PredicateType Pred)
 
template<typename RangeType , typename ProjectionType >
ULANG_FORCEINLINE void SortBy (RangeType &&Range, ProjectionType Proj)
 
template<typename RangeType , typename ProjectionType , typename PredicateType >
ULANG_FORCEINLINE void SortBy (RangeType &&Range, ProjectionType Proj, PredicateType Pred)
 
template<typename RangeType >
ULANG_FORCEINLINE void StableSort (RangeType &&Range)
 
template<typename RangeType , typename PredicateType >
ULANG_FORCEINLINE void StableSort (RangeType &&Range, PredicateType Pred)
 
template<typename RangeType , typename ProjectionType >
ULANG_FORCEINLINE void StableSortBy (RangeType &&Range, ProjectionType Proj)
 
template<typename RangeType , typename ProjectionType , typename PredicateType >
ULANG_FORCEINLINE void StableSortBy (RangeType &&Range, ProjectionType Proj, PredicateType Pred)
 

Function Documentation

◆ BinarySearch() [1/2]

template<typename RangeType , typename ValueType >
ULANG_FORCEINLINE auto uLang::Algo::BinarySearch ( const RangeType &  Range,
const ValueType &  Value 
)

◆ BinarySearch() [2/2]

template<typename RangeType , typename ValueType , typename SortPredicateType >
ULANG_FORCEINLINE auto uLang::Algo::BinarySearch ( const RangeType &  Range,
const ValueType &  Value,
SortPredicateType  SortPredicate 
) -> decltype(GetNum(Range))

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

Parameters
RangeThe range to search, must be already sorted by SortPredicate
ValueThe value to search for
SortPredicatePredicate for sort comparison, defaults to <
Returns
Index of found element, or IndexNone

◆ BinarySearchBy() [1/2]

template<typename RangeType , typename ValueType , typename ProjectionType >
ULANG_FORCEINLINE auto uLang::Algo::BinarySearchBy ( const RangeType &  Range,
const ValueType &  Value,
ProjectionType  Projection 
)

◆ BinarySearchBy() [2/2]

template<typename RangeType , typename ValueType , typename ProjectionType , typename SortPredicateType >
ULANG_FORCEINLINE auto uLang::Algo::BinarySearchBy ( const RangeType &  Range,
const ValueType &  Value,
ProjectionType  Projection,
SortPredicateType  SortPredicate 
) -> decltype(GetNum(Range))

Returns index to the first found element with projected value matching Value in a range, the range must be sorted by predicate

Parameters
RangeThe range to search, must be already sorted by SortPredicate
ValueThe value to search for
ProjectionFunctor or data member pointer, called via Invoke to compare to Value
SortPredicatePredicate for sort comparison, defaults to <
Returns
Index of found element, or IndexNone

◆ HeapSort() [1/2]

template<typename RangeType >
ULANG_FORCEINLINE void uLang::Algo::HeapSort ( RangeType &  Range)

Performs heap sort on the elements. Assumes < operator is defined for the element type.

Parameters
RangeThe range to sort.

◆ HeapSort() [2/2]

template<typename RangeType , typename PredicateType >
ULANG_FORCEINLINE void uLang::Algo::HeapSort ( RangeType &  Range,
PredicateType  Predicate 
)

Performs heap sort on the elements.

Parameters
RangeThe range to sort.
PredicateA binary predicate object used to specify if one element should precede another.

◆ HeapSortBy() [1/2]

template<typename RangeType , typename ProjectionType >
ULANG_FORCEINLINE void uLang::Algo::HeapSortBy ( RangeType &  Range,
ProjectionType  Projection 
)

Performs heap sort on the elements. Assumes < operator is defined for the projected element type.

Parameters
RangeThe range to sort.
ProjectionThe projection to sort by when applied to the element.

◆ HeapSortBy() [2/2]

ULANG_FORCEINLINE void uLang::Algo::HeapSortBy ( RangeType &  Range,
ProjectionType  Projection,
PredicateType  Predicate 
)

Performs heap sort on the elements.

Parameters
RangeThe range to sort.
ProjectionThe projection to sort by when applied to the element.
PredicateA binary predicate object, applied to the projection, used to specify if one element should precede another.

◆ IntroSort() [1/2]

template<typename RangeType >
ULANG_FORCEINLINE void uLang::Algo::IntroSort ( RangeType &&  Range)

Sort a range of elements using its operator<. The sort is unstable.

Parameters
RangeThe range to sort.

◆ IntroSort() [2/2]

template<typename RangeType , typename PredicateType >
ULANG_FORCEINLINE void uLang::Algo::IntroSort ( RangeType &&  Range,
PredicateType  Predicate 
)

Sort a range of elements using a user-defined predicate class. The sort is unstable.

Parameters
RangeThe range to sort.
PredicateA binary predicate object used to specify if one element should precede another.

◆ IntroSortBy() [1/2]

template<typename RangeType , typename ProjectionType >
ULANG_FORCEINLINE void uLang::Algo::IntroSortBy ( RangeType &&  Range,
ProjectionType  Projection 
)

Sort a range of elements by a projection using the projection's operator<. The sort is unstable.

Parameters
RangeThe range to sort.
ProjectionThe projection to sort by when applied to the element.

◆ IntroSortBy() [2/2]

ULANG_FORCEINLINE void uLang::Algo::IntroSortBy ( RangeType &&  Range,
ProjectionType  Projection,
PredicateType  Predicate 
)

Sort a range of elements by a projection using a user-defined predicate class. The sort is unstable.

Parameters
RangeThe range to sort.
ProjectionThe projection to sort by when applied to the element.
PredicateA binary predicate object, applied to the projection, used to specify if one element should precede another.

◆ LowerBound() [1/2]

template<typename RangeType , typename ValueType >
ULANG_FORCEINLINE auto uLang::Algo::LowerBound ( const RangeType &  Range,
const ValueType &  Value 
) -> decltype(GetNum(Range))

◆ LowerBound() [2/2]

template<typename RangeType , typename ValueType , typename SortPredicateType >
ULANG_FORCEINLINE auto uLang::Algo::LowerBound ( const RangeType &  Range,
const ValueType &  Value,
SortPredicateType  SortPredicate 
) -> decltype(GetNum(Range))

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

Parameters
RangeRange to search through, must be already sorted by SortPredicate
ValueValue to look for
SortPredicatePredicate for sort comparison, defaults to <
Returns
Position of the first element >= Value, may be position after last element in range

◆ LowerBoundBy() [1/2]

template<typename RangeType , typename ValueType , typename ProjectionType >
ULANG_FORCEINLINE auto uLang::Algo::LowerBoundBy ( const RangeType &  Range,
const ValueType &  Value,
ProjectionType  Projection 
) -> decltype(GetNum(Range))

◆ LowerBoundBy() [2/2]

template<typename RangeType , typename ValueType , typename ProjectionType , typename SortPredicateType >
ULANG_FORCEINLINE auto uLang::Algo::LowerBoundBy ( const RangeType &  Range,
const ValueType &  Value,
ProjectionType  Projection,
SortPredicateType  SortPredicate 
) -> decltype(GetNum(Range))

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

Parameters
RangeRange to search through, must be already sorted by SortPredicate
ValueValue to look for
ProjectionFunctor or data member pointer, called via Invoke to compare to Value
SortPredicatePredicate for sort comparison, defaults to <
Returns
Position of the first element >= Value, may be position after last element in range

◆ Rotate()

template<typename RangeType >
ULANG_FORCEINLINE size_t uLang::Algo::Rotate ( RangeType &&  Range,
size_t  Count 
)

Rotates a given amount of elements from the front of the range to the end of the range.

Parameters
RangeThe range to rotate.
NumThe number of elements to rotate from the front of the range.
Returns
The new index of the element that was previously at the start of the range.

◆ Sort() [1/2]

template<typename RangeType >
ULANG_FORCEINLINE void uLang::Algo::Sort ( RangeType &&  Range)

Sort a range of elements using its operator<. The sort is unstable.

Parameters
RangeThe range to sort.

◆ Sort() [2/2]

template<typename RangeType , typename PredicateType >
ULANG_FORCEINLINE void uLang::Algo::Sort ( RangeType &&  Range,
PredicateType  Pred 
)

Sort a range of elements using a user-defined predicate class. The sort is unstable.

Parameters
RangeThe range to sort.
PredicateA binary predicate object used to specify if one element should precede another.

◆ SortBy() [1/2]

template<typename RangeType , typename ProjectionType >
ULANG_FORCEINLINE void uLang::Algo::SortBy ( RangeType &&  Range,
ProjectionType  Proj 
)

Sort a range of elements by a projection using the projection's operator<. The sort is unstable.

Parameters
RangeThe range to sort.
ProjThe projection to sort by when applied to the element.

◆ SortBy() [2/2]

ULANG_FORCEINLINE void uLang::Algo::SortBy ( RangeType &&  Range,
ProjectionType  Proj,
PredicateType  Pred 
)

Sort a range of elements by a projection using a user-defined predicate class. The sort is unstable.

Parameters
RangeThe range to sort.
ProjThe projection to sort by when applied to the element.
PredicateA binary predicate object, applied to the projection, used to specify if one element should precede another.

◆ StableSort() [1/2]

template<typename RangeType >
ULANG_FORCEINLINE void uLang::Algo::StableSort ( RangeType &&  Range)

Sort a range of elements using its operator<. The sort is stable.

Parameters
RangeThe range to sort.

◆ StableSort() [2/2]

template<typename RangeType , typename PredicateType >
ULANG_FORCEINLINE void uLang::Algo::StableSort ( RangeType &&  Range,
PredicateType  Pred 
)

Sort a range of elements using a user-defined predicate class. The sort is stable.

Parameters
RangeThe range to sort.
PredicateA binary predicate object used to specify if one element should precede another.

◆ StableSortBy() [1/2]

template<typename RangeType , typename ProjectionType >
ULANG_FORCEINLINE void uLang::Algo::StableSortBy ( RangeType &&  Range,
ProjectionType  Proj 
)

Sort a range of elements by a projection using the projection's operator<. The sort is stable.

Parameters
RangeThe range to sort.
ProjThe projection to sort by when applied to the element.

◆ StableSortBy() [2/2]

ULANG_FORCEINLINE void uLang::Algo::StableSortBy ( RangeType &&  Range,
ProjectionType  Proj,
PredicateType  Pred 
)

Sort a range of elements by a projection using a user-defined predicate class. The sort is stable.

Parameters
RangeThe range to sort.
ProjThe projection to sort by when applied to the element.
PredicateA binary predicate object, applied to the projection, used to specify if one element should precede another.

◆ UpperBound() [1/2]

template<typename RangeType , typename ValueType >
ULANG_FORCEINLINE auto uLang::Algo::UpperBound ( const RangeType &  Range,
const ValueType &  Value 
) -> decltype(GetNum(Range))

◆ UpperBound() [2/2]

template<typename RangeType , typename ValueType , typename SortPredicateType >
ULANG_FORCEINLINE auto uLang::Algo::UpperBound ( const RangeType &  Range,
const ValueType &  Value,
SortPredicateType  SortPredicate 
) -> decltype(GetNum(Range))

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

Parameters
RangeRange to search through, must be already sorted by SortPredicate
ValueValue to look for
SortPredicatePredicate for sort comparison, defaults to <
Returns
Position of the first element > Value, may be past end of range

◆ UpperBoundBy() [1/2]

template<typename RangeType , typename ValueType , typename ProjectionType >
ULANG_FORCEINLINE auto uLang::Algo::UpperBoundBy ( const RangeType &  Range,
const ValueType &  Value,
ProjectionType  Projection 
) -> decltype(GetNum(Range))

◆ UpperBoundBy() [2/2]

template<typename RangeType , typename ValueType , typename ProjectionType , typename SortPredicateType >
ULANG_FORCEINLINE auto uLang::Algo::UpperBoundBy ( const RangeType &  Range,
const ValueType &  Value,
ProjectionType  Projection,
SortPredicateType  SortPredicate 
) -> decltype(GetNum(Range))

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

Parameters
RangeRange to search through, must be already sorted by SortPredicate
ValueValue to look for
ProjectionFunctor or data member pointer, called via Invoke to compare to Value
SortPredicatePredicate for sort comparison, defaults to <
Returns
Position of the first element > Value, may be past end of range