Navigation
API > API/Runtime > API/Runtime/CoreUObject > API/Runtime/CoreUObject/UObject
References
| Module | CoreUObject |
| Header | /Engine/Source/Runtime/CoreUObject/Public/UObject/ObjectPtr.h |
| Include | #include "UObject/ObjectPtr.h" |
template<typename T>
decltype(auto) MutableView
(
T & A
)
Remarks
MutableView: safely obtain temporary mutable access to a TObjectPtr's underlying storage.
Basic Usage: void MutatingFunc(TArray
TArray
MutatingFunc(MutableView(Array)); // ok; Array will safely "catch up" on TObjectPtr semantics when MutatingFunc returns.
/ it's generally preferable to pass references around (to avoid nullptr), / but for compat with existing functions that take a pointer: void NeedsAPointer(TArray
Scoped Usage: TObjectPtr
UObject*& MyHardToFindBug = MutableView(MyPtr); // not ok }