TArray::RemoveAtSwap

Removes an element (or elements) at given location optionally shrinking the array.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Containers/Array.h

Include

#include "Containers/Array.h"

Syntax

template<typename CountType>
void RemoveAtSwap
(
    SizeType Index,
    CountType Count,
    bool bAllowShrinking
)

Remarks

Removes an element (or elements) at given location optionally shrinking the array.

This version is much more efficient than RemoveAt (O(Count) instead of O(ArrayNum)), but does not preserve the order.

Parameters

Parameter

Description

Index

Location in array of the element to remove.

Count

(Optional) Number of elements to remove. Default is 1.

bAllowShrinking

(Optional) Tells if this call can shrink array if suitable after remove. Default is true.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss