39#ifndef UE_ENABLE_NOTNULL_WRAPPER
40 #define UE_ENABLE_NOTNULL_WRAPPER (UE_BUILD_DEBUG || UE_BUILD_DEVELOPMENT)
45 #define UE_NOTNULL_FUNCTION_NON_NULL_RETURN_START _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wignored-attributes\"") FUNCTION_NON_NULL_RETURN_START _Pragma("clang diagnostic pop")
46 #define UE_NOTNULL_FUNCTION_NON_NULL_RETURN_END _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wignored-attributes\"") FUNCTION_NON_NULL_RETURN_END _Pragma("clang diagnostic pop")
48 #define UE_NOTNULL_FUNCTION_NON_NULL_RETURN_START FUNCTION_NON_NULL_RETURN_START
49 #define UE_NOTNULL_FUNCTION_NON_NULL_RETURN_END FUNCTION_NON_NULL_RETURN_END
52#if UE_ENABLE_NOTNULL_WRAPPER
62 template <
typename T,
typename =
void>
65 static constexpr bool Value =
false;
71 static constexpr bool Value =
true;
84 static constexpr bool Value =
false;
90 static constexpr bool Value =
true;
104 return ((
Sub*)
this)->Val;
108 return (T&&)((
Sub*)
this)->Val;
112 const T& operator->()
const
114 return ((
Sub*)
this)->Val;
118 template <
typename T>
133 T* operator->() const
136 return ((
Sub*)
this)->Val;
141 template <
typename T>
142 struct TNotNull : UE::Core::Private::TNotNullBase<T>
145 using Super = UE::Core::Private::TNotNullBase<T>;
162 requires (std::is_constructible_v<T,
ArgTypes...> && !UE::Core::Private::TIsTNotNullParam_V<std::decay_t<ArgTypes>...>)
167 if constexpr (UE::Core::Private::TSupportsNotOperator_V<T>)
171 UE::Core::Private::ReportNotNullPtr();
181 using IntrusiveUnsetOptionalStateType =
TNotNull;
184 requires(bHasIntrusiveUnsetOptionalState)
189 requires(bHasIntrusiveUnsetOptionalState)
200 UE_REQUIRES(std::is_convertible_v<const OtherType&, T>)
222 operator bool()
const =
delete;
225 decltype(
auto)
operator*()
const
244 template <
typename U>
249 template <
typename U>
250 [[
nodiscard]]
auto UEOpEquals(
const U& Rhs)
const ->
decltype(
Val ==
Rhs)
252 static_assert(!std::is_same_v<U, TYPE_OF_NULLPTR>,
"Comparing a TNotNull to nullptr is illegal");
261 template <
typename T>
264 if constexpr (std::is_void_v<
decltype(Ar << (T&)
Val)>)
267 if constexpr (UE::Core::Private::TSupportsNotOperator_V<T>)
271 UE::Core::Private::CheckLoadingNotNullPtr(Ar);
277 decltype(
auto) Result = Ar << (T&)
Val;
278 if constexpr (UE::Core::Private::TSupportsNotOperator_V<T>)
282 UE::Core::Private::CheckLoadingNotNullPtr(Ar);
290 template <
typename T>
295 template <
typename T>
301#undef UE_NOTNULL_FUNCTION_NON_NULL_RETURN_END
302#undef UE_NOTNULL_FUNCTION_NON_NULL_RETURN_START
306 template <
typename T>
310 template <
typename T>
#define CA_NO_RETURN
Definition CoreMiscDefines.h:124
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
FArchive & operator<<(FArchive &Ar, FEnvQueryDebugProfileData::FStep &Data)
Definition EnvQueryTypes.cpp:489
T && NotNullGet(T &&NotNull)
Definition NotNull.h:311
#define UE_NOTNULL_FUNCTION_NON_NULL_RETURN_START
Definition NotNull.h:48
T TNotNull
Definition NotNull.h:307
#define UE_NOTNULL_FUNCTION_NON_NULL_RETURN_END
Definition NotNull.h:49
const bool
Definition NetworkReplayStreaming.h:178
#define UE_REQUIRES(...)
Definition Requires.h:86
UE_FORCEINLINE_HINT uint32 GetTypeHashHelper(const T &V)
Definition TypeHash.h:215
float Val(const FString &Value)
Definition UnrealMath.cpp:3163
Definition Archive.h:1208
uint32 GetTypeHash(const FKey &Key)
Definition BlackboardKey.h:35
bool operator==(const FCachedAssetKey &A, const FCachedAssetKey &B)
Definition AssetDataMap.h:501
implementation
Definition PlayInEditorLoadingScope.h:8
FORCEINLINE UE_STRING_CLASS RhsType && Rhs
Definition String.cpp.inl:718
UE_STRING_CLASS Result(Forward< LhsType >(Lhs), RhsLen)
Definition String.cpp.inl:732
Definition IntrusiveUnsetOptionalState.h:71