Pointer and Reference Conversion
Shared references convert to shared pointers implicitly so it is always safe to make a pointer from a reference, i.e. you can assign a shared reference to a shared pointer or pass a shared reference to a method expecting a shared pointer.
TSharedPtr<FTreeNode> SomeNodePtr = NodeRef;
However, conversion from a pointer is potentially unsafe, and you are forced to explicitly perform the conversion using the ToSharedRef() function.
// Explicitly reference a pointer. Will assert if the pointer is not valid!
NodeRef = SomeNodePtr.ToSharedRef();
In a similar manner to the * operator with C++ pointers, using ToSharedRef() will assert if the object is not valid.