TArray::RemoveSingleSwap

Removes the first occurrence of the specified item in the array.

Windows
MacOS
Linux

References

Module

Core

Header

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

Include

#include "Containers/Array.h"

Syntax

SizeType RemoveSingleSwap
(
    const ElementType & Item,
    bool bAllowShrinking
)

Remarks

Removes the first occurrence of the specified item in the array. This version is much more efficient O(Count) instead of O(ArrayNum), but does not preserve the order

Returns

The number of items removed. For RemoveSingleItem, this is always either 0 or 1.

Parameters

Parameter

Description

Item

The item to remove

bAllowShrinking

Tell if this function can shrink the memory in-use if suitable.

See Also

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