Hey UObject friends!
Looking at TStrongObjectPtr, I see
`template <typename ObjectType, typename ReferencerNameProvider>
class TStrongObjectPtr
{
public:
using ElementType = ObjectType;
TStrongObjectPtr(TStrongObjectPtr&& InOther)
{
Reset();
Object = InOther.Object;
InOther.Object = nullptr;
}`
Why does the Reset need to be there? If I understand correctly, the object is being constructed, so Object is already null (from the member variable initializer inline) so there’s no need to check for null / ReleaseRef.
on a similar note…shouldn’t we instead use an initializer in this constructor to set Object to avoid the unnecessary assignment to nullptr? I’d expect something like
TStrongObjectPtr(TStrongObjectPtr&& InOther) : Object(InOther.Object) { InOther.Object = nullptr; }
BUT very good chance I’m missing something!! What am I missing?