UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ArrayAlgorithm.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3#include "Chaos/Core.h"
4#include "Containers/Array.h"
5
6namespace Chaos
7{
11 template<typename TItemArray>
12 void MoveArrayItemsDown(TItemArray& Items, const int32 BeginIndex, const int32 EndIndex, const int32 DownShift)
13 {
14 check(DownShift >= 0);
15 check(BeginIndex - DownShift >= 0);
16 check(EndIndex >= BeginIndex);
17 check(EndIndex <= Items.Num());
18
19 if (DownShift > 0)
20 {
21 for (int32 SrcIndex = BeginIndex; SrcIndex < EndIndex; ++SrcIndex)
22 {
23 Items[SrcIndex - DownShift] = MoveTemp(Items[SrcIndex]);
24 }
25 }
26 }
27
34 template<typename TItemArray>
61
62}
#define check(expr)
Definition AssertionMacros.h:314
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
Definition ArrayView.h:139
Definition SkeletalMeshComponent.h:307
void MoveArrayItemsDown(TItemArray &Items, const int32 BeginIndex, const int32 EndIndex, const int32 DownShift)
Definition ArrayAlgorithm.h:12
void RemoveArrayItemsAtSortedIndices(TItemArray &Items, const TArrayView< const int32 > &SortedIndicesToRemove)
Definition ArrayAlgorithm.h:35