March 2019
Intermediate to advanced
708 pages
17h 9m
English
Shared pointers are thread-safe. This means that the underlying object can safely be manipulated on separate threads.
Always remember that you cannot use TSharedRef with UObjects or UObject derivatives; you can only use them on your custom C++ classes. Your FStructures can use the TSharedPtr, TSharedRef, and TWeakPtr classes to wrap up a raw pointer.
If you want to use smart pointers to point to an object, you must use TWeakObjectPointer or UPROPERTY().
You can use TAutoPtr if you do not need the thread-safety guarantee of TSharedPtr. TAutoPtr will automatically delete an object when the number of references to it drops to 0.
Read now
Unlock full access