UDocumentation
UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IntrusiveUnsetOptionalState.h
Go to the documentation of this file.
1
// Copyright Epic Games, Inc. All Rights Reserved.
2
3
#pragma once
4
61
#include "
Misc/OptionalFwd.h
"
62
#include "
Concepts/DecaysTo.h
"
63
#include "
Concepts/SameAs.h
"
64
65
namespace
UE::Core::Private
66
{
67
struct
FOptional;
68
}
69
70
struct
FIntrusiveUnsetOptionalState
71
{
72
// Defined in the global namespace for convenience and consistency
73
// with TOptional which is also global.
74
75
template
<
typename
>
76
friend
struct
TOptional
;
77
78
friend
struct
UE::Core::Private::FOptional
;
79
80
private
:
81
explicit
FIntrusiveUnsetOptionalState
() =
default
;
82
};
83
84
template
<
typename
T>
85
constexpr
bool
HasIntrusiveUnsetOptionalState
()
86
{
87
// Ensure the type has a nested bHasIntrusiveUnsetOptionalState, and as derived types are not guaranteed to have
88
// an intrusive state even if the base does, ensure IntrusiveUnsetOptionalStateType matches the type in the optional.
89
if
constexpr
(
requires
{ { T::bHasIntrusiveUnsetOptionalState } ->
UE::CDecaysTo<bool>
;
requires
UE::CSameAs<const typename T::IntrusiveUnsetOptionalStateType, const T>
; })
90
{
91
return
T::bHasIntrusiveUnsetOptionalState;
92
}
93
else
94
{
95
return
false
;
96
}
97
}
DecaysTo.h
HasIntrusiveUnsetOptionalState
constexpr bool HasIntrusiveUnsetOptionalState()
Definition
IntrusiveUnsetOptionalState.h:85
OptionalFwd.h
SameAs.h
UE::CDecaysTo
Definition
DecaysTo.h:16
UE::CSameAs
Definition
SameAs.h:16
UE::Core::Private
implementation
Definition
PlayInEditorLoadingScope.h:8
FIntrusiveUnsetOptionalState
Definition
IntrusiveUnsetOptionalState.h:71
TOptional
Definition
Optional.h:131
UE::Core::Private::FOptional
Definition
Optional.h:25
Engine
Source
Runtime
Core
Public
Misc
IntrusiveUnsetOptionalState.h
Generated by
1.9.8