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"
7
8// Specifies whether or not a container's removal operation should attempt to auto-shrink the container's reserved memory usage
10{
11 No,
12 Yes,
13
14 Default = Yes /* Prefer UE::Core::Private::AllowShrinkingByDefault<T>() in new code */
15};
16
17namespace UE::Core::Private
18{
19 // Given a container allocation policy, returns EAllowShrinking::Yes or No based on `AllocatorType::ShrinkByDefault`.
20 template <typename AllocatorType>
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>()
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
Definition AllowShrinking.h:10
uint8_t uint8
Definition binka_ue_file_header.h:8
implementation
Definition PlayInEditorLoadingScope.h:8
consteval EAllowShrinking AllowShrinkingByDefault()
Definition AllowShrinking.h:21