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
15template <typename T>
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
30template <typename T> struct TIsTriviallyRelocatable<const T> : TIsTriviallyRelocatable<T> {};
31template <typename T> struct TIsTriviallyRelocatable< volatile T> : TIsTriviallyRelocatable<T> {};
32template <typename T> struct TIsTriviallyRelocatable<const volatile T> : TIsTriviallyRelocatable<T> {};
33
34template <typename T>
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
constexpr bool TIsTriviallyRelocatable_V
Definition IsTriviallyRelocatable.h:35
Definition IsTriviallyRelocatable.h:17
static constexpr bool Value
Definition IsTriviallyRelocatable.h:27