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

Functions

template<typename T >
int CountValid (const TArray< T > &Data, const TFunction< bool(T)> &Predicate, int MaxIndex=-1, int StartIndex=0)
 
template<typename T >
int FilterInPlace (TArray< T > &Data, const TFunction< bool(T)> &Predicate, int MaxIndex=-1, int StartIndex=0)
 
template<typename T , typename EnumerableType >
void AppendElements (TArray< T > &AppendTo, EnumerableType Enumerable)
 

Detailed Description

Utility functions for processing arrays of objects

Function Documentation

◆ AppendElements()

void BufferUtil::AppendElements ( TArray< T > &  AppendTo,
EnumerableType  Enumerable 
)

Append enumerable elements to an array

Parameters
Dataarray to append to
Enumerableobject that can be iterated over with a range-based for loop

◆ CountValid()

template<typename T >
int BufferUtil::CountValid ( const TArray< T > &  Data,
const TFunction< bool(T)> &  Predicate,
int  MaxIndex = -1,
int  StartIndex = 0 
)

Count number of elements in array (or within requested range) that pass Predicate test

Parameters
DataArray to process
Predicatefiltering function, return true indicates valid
MaxIndexoptional maximum index in array (exclusive, default is to use array size)
StartIndexoptional start index in array (default 0)
Returns
number of values in array that returned true for Predicate

◆ FilterInPlace()

template<typename T >
int BufferUtil::FilterInPlace ( TArray< T > &  Data,
const TFunction< bool(T)> &  Predicate,
int  MaxIndex = -1,
int  StartIndex = 0 
)

Removes elements of array (or within requested range) that do not pass Predicate, by shifting forward. Does not remove remaining elements

Parameters
DataArray to process
Predicatefiltering function, return true indicates valid
MaxIndexoptional maximum index in array (exclusive, default is to use array size)
StartIndexoptional start index in array (default 0)
Returns
Number of valid elements in Data after filtering