Navigation
Unreal Engine C++ API Reference > Runtime > Core > Templates > TSharedRef
References
Module | Core |
Header | /Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
Include | #include "Templates/SharedPointer.h" |
bool IsUnique() const
Remarks
Returns true if this is the only shared reference to this object. Note that there may be outstanding weak references left.
IMPORTANT: This has different behavior to GetSharedReferenceCount() == 1 in a multithreaded context. The expectation is that this will be used when a user wants exclusive write-access to an otherwise-immutable object. Care still needs to be taken when pinning TWeakPtrs to make new shared references. True if there is only one shared reference to the object, and this is it!