UDocumentation
UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AllowShrinking.h
Go to the documentation of this file.
1
// Copyright Epic Games, Inc. All Rights Reserved.
2
3
#pragma once
4
5
#include "
CoreTypes.h
"
6
#include "
Containers/ContainerAllocationPolicies.h
"
7
8
// Specifies whether or not a container's removal operation should attempt to auto-shrink the container's reserved memory usage
9
enum class
EAllowShrinking
:
uint8
10
{
11
No
,
12
Yes
,
13
14
Default
=
Yes
/* Prefer UE::Core::Private::AllowShrinkingByDefault<T>() in new code */
15
};
16
17
namespace
UE::Core::Private
18
{
19
// Given a container allocation policy, returns EAllowShrinking::Yes or No based on `AllocatorType::ShrinkByDefault`.
20
template
<
typename
AllocatorType>
21
consteval
EAllowShrinking
AllowShrinkingByDefault
()
22
{
23
// Convert the ShrinkByDefault enum into an EAllowShrinking.
24
// For backwards compatibility, failure to specify `ShrinkByDefault` means Yes.
25
return
UE::Core::Private::ShrinkByDefaultOr<true, AllocatorType>()
26
?
EAllowShrinking::Yes
27
:
EAllowShrinking::No
;
28
}
29
}
30
31
#define UE_ALLOWSHRINKING_BOOL_DEPRECATED(FunctionName) UE_DEPRECATED(5.6, FunctionName " with a boolean bAllowShrinking has been deprecated - please use the EAllowShrinking enum instead")
EAllowShrinking
EAllowShrinking
Definition
AllowShrinking.h:10
EAllowShrinking::Default
@ Default
EAllowShrinking::Yes
@ Yes
EAllowShrinking::No
@ No
ContainerAllocationPolicies.h
CoreTypes.h
uint8
uint8_t uint8
Definition
binka_ue_file_header.h:8
UE::Core::Private
implementation
Definition
PlayInEditorLoadingScope.h:8
UE::Core::Private::AllowShrinkingByDefault
consteval EAllowShrinking AllowShrinkingByDefault()
Definition
AllowShrinking.h:21
Engine
Source
Runtime
Core
Public
Containers
AllowShrinking.h
Generated by
1.9.8