UDocumentation
UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IsTriviallyRelocatable.h
Go to the documentation of this file.
1
// Copyright Epic Games, Inc. All Rights Reserved.
2
3
#pragma once
4
5
#include <type_traits>
6
15
template
<
typename
T>
16
struct
TIsTriviallyRelocatable
17
{
18
// We allow bitwise relocation of types containing e.g. const and reference members, but we don't want to allow
19
// relocation of types which are UE_NONCOPYABLE or equivalent.
20
//
21
// See note above as to why this is why it is. In C++26, we should be able to catch more
22
// by using this: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2786r4.pdf
23
//
24
// Should be the test below by default, but there are a lot of existing violations that will need to be fixed first.
25
26
// static inline constexpr bool Value = std::is_move_constructible_v<T>;
27
static
inline
constexpr
bool
Value
=
true
;
28
};
29
30
template
<
typename
T>
struct
TIsTriviallyRelocatable
<const T> :
TIsTriviallyRelocatable
<T> {};
31
template
<
typename
T>
struct
TIsTriviallyRelocatable
<
volatile
T> :
TIsTriviallyRelocatable
<T> {};
32
template
<
typename
T>
struct
TIsTriviallyRelocatable
<const
volatile
T> :
TIsTriviallyRelocatable
<T> {};
33
34
template
<
typename
T>
35
inline
constexpr
bool
TIsTriviallyRelocatable_V
=
TIsTriviallyRelocatable<T>::Value
;
StaticCastSharedRef
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition
SharedPointer.h:127
TIsTriviallyRelocatable_V
constexpr bool TIsTriviallyRelocatable_V
Definition
IsTriviallyRelocatable.h:35
TIsTriviallyRelocatable
Definition
IsTriviallyRelocatable.h:17
TIsTriviallyRelocatable::Value
static constexpr bool Value
Definition
IsTriviallyRelocatable.h:27
Engine
Source
Runtime
Core
Public
Traits
IsTriviallyRelocatable.h
Generated by
1.9.8