Navigation
Unreal Engine C++ API Reference > Runtime > Core > Templates > TSharedPtr > TSharedPtr
References
Module | Core |
Header | /Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h |
Include | #include "Templates/SharedPointer.h" |
template<typename OtherType, typename>
TSharedPtr
&40;
TWeakPtr< OtherType, Mode > const & InWeakPtr
&41;
Remarks
Constructs a shared pointer from a weak pointer, allowing you to access the object (if it hasn't expired yet.) Remember, if there are no more shared references to the object, the shared pointer will not be valid. You should always check to make sure this shared pointer is valid before trying to dereference the shared pointer!
NOTE: This constructor is private to force users to be explicit when converting a weak pointer to a shared pointer. Use the weak pointer's Pin() method instead!