Array Library

The Array Library is split into two classes. UNihiloArrayLibrary is a templated C++ library covering the full operation set. UNihiloArrayLibrary_BP exposes a typed Blueprint subset for common element types: Int32, Float, String, Vector, Object, and Actor.
info
All functions are stateless and return new arrays — none mutate the input. In C++, pass any element type via the templated versions. In Blueprint, use the typed suffix variants (e.g. Take_Int32).
Function Description
Navigation
IncrementIndex Advances CurrentIndex by 1. Behavior at the upper boundary is controlled by EArrayCycleMethodRevolve wraps back to 0, Clamped stays at the last element. Outputs bPositionUpdated and BoundaryPosition.
DecrementIndex Retreats CurrentIndex by 1 with the same boundary options as IncrementIndex.
IsValidArrayIndex Returns true if Index is within [0, ArraySize).
Function Description
Query (C++ only where noted)
TryGet Returns the element at Index via OutResult and outputs true if the index is valid. Blueprint typed variants available.
GetOrDefault Returns the element at Index, or DefaultValue if the index is out of bounds. Blueprint typed variants available.
FindFirst Returns the first element matching a predicate via OutResult. C++ only.
FindLast Returns the last element matching a predicate. C++ only.
FindAll Returns all elements matching a predicate. C++ only.
FindIndex Returns the index of the first matching element, or INDEX_NONE. C++ only.
FindIndices Returns all indices of matching elements. C++ only.
Function Description
Transformation
Filter Returns a new array containing only elements that satisfy the predicate. C++ only.
Map Projects each element to a new type via a transformer function, returning a TArray<U>. C++ only.
Flatten Collapses a TArray<TArray<T>> into a single TArray<T>. C++ only.
Distinct Removes duplicate elements, preserving first-occurrence order. Blueprint typed variants available.
DistinctBy Removes duplicates using a key selector function rather than direct equality. C++ only.
Reverse Returns a reversed copy of the array. Blueprint typed variants available.
Function Description
Slicing
Take / TakeLast Returns the first or last N elements. Clamped to array length. Blueprint typed variants available.
Skip / SkipLast Returns all elements after skipping the first or last N. Blueprint typed variants available.
Slice Returns a sub-array starting at StartIndex for up to Count elements. Blueprint typed variants available.
Chunk Splits the array into a TArray<TArray<T>> of sub-arrays, each at most ChunkSize elements. C++ only.
Function Description
Aggregate
CountWhere Returns the number of elements matching a predicate. C++ only.
AnyMatch / AllMatch / NoneMatch Predicate-based boolean checks against the array. C++ only.
Reduce Left-folds the array into a single value using an accumulator and an initial seed. C++ only.
Sum / Average Numeric aggregation. Average returns float; returns 0 on an empty array. Blueprint typed variants available for Int32 and Float.
Min / Max Returns the smallest or largest element via an out parameter. Returns false on empty arrays. Blueprint typed variants available for Int32 and Float.
Function Description
Set Operations
Union Returns all unique elements from both arrays combined. Blueprint typed variants available.
Intersect Returns elements present in both arrays. Blueprint typed variants available.
Difference Returns elements in the first array that are absent from the second. Blueprint typed variants available.
SymmetricDifference Returns elements present in either array but not both. Blueprint typed variants available.
Function Description
Sorting
Sort Sorts using a custom comparator function. C++ only. Blueprint typed variants (Int32, Float, String) sort by ESortDirection.
SortBy Sorts by a key selector with Ascending or Descending direction. C++ only.
Function Description
Utility
Shuffle Returns a randomly reordered copy of the array using a Fisher-Yates pass. Blueprint typed variants available.
Sample Returns N randomly selected elements. Internally shuffles then takes. Blueprint typed variants available.
Partition Splits the array into two by predicate — matching elements first, non-matching second — returned as a TPair. C++ only.
Zip Combines two arrays element-wise into a TArray<TPair<T, U>>. Length is clamped to the shorter array. C++ only.
Extract Plucks a single member field from every element using a member pointer, returning a TArray of that field type. C++ only.
ExtractPtr Same as Extract but operates on pointer arrays with a null check, returning a TSet. C++ only.
ExtractWith Plucks a field using a lambda extractor instead of a member pointer, for cases where the field isn't directly accessible. C++ only.