Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/TArray
Overloads
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
SizeType RemoveSwap
(
const ElementType& Item, |
Removes all instances of a given item from the array. | Containers/Array.h | |
SizeType RemoveSwap
(
const ElementType& Item, |
Containers/Array.h |
RemoveSwap(const ElementType &, EAllowShrinking)
Description
Removes all instances of a given item from the array.
This version is much more efficient, because it uses RemoveAtSwap internally which is O(Count) instead of RemoveAt which is O(ArrayNum), but does not preserve the order.
| Name | RemoveSwap |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Containers/Array.h |
| Include Path | #include "Containers/Array.h" |
SizeType RemoveSwap
(
const ElementType & Item,
EAllowShrinking AllowShrinking
)
Number of elements removed.
Parameters
| Name | Remarks |
|---|---|
| Item | The item to remove |
| AllowShrinking | (Optional) By default, arrays with large amounts of slack will automatically shrink. Use FNonshrinkingAllocator or pass EAllowShrinking::No to prevent this. |
See Also
RemoveSwap(const ElementType &, bool)
| Name | RemoveSwap |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Containers/Array.h |
| Include Path | #include "Containers/Array.h" |
SizeType RemoveSwap
(
const ElementType & Item,
bool bAllowShrinking
)