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
65namespace UE::Core::Private
66{
67 struct FOptional;
68}
69
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
79
80private:
81 explicit FIntrusiveUnsetOptionalState() = default;
82};
83
84template <typename T>
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}
constexpr bool HasIntrusiveUnsetOptionalState()
Definition IntrusiveUnsetOptionalState.h:85
Definition DecaysTo.h:16
Definition SameAs.h:16
implementation
Definition PlayInEditorLoadingScope.h:8
Definition IntrusiveUnsetOptionalState.h:71
Definition Optional.h:131
Definition Optional.h:25