TSharedPtr::TSharedPtr

Constructs a shared pointer that owns the specified object.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Templates/SharedPointer.h

Include

#include "Templates/SharedPointer.h"

Syntax

template<typename OtherType, typename>
TSharedPtr
(
    OtherType * InObject
)

Remarks

Constructs a shared pointer that owns the specified object.

that passing nullptr here will still create a tracked reference to a nullptr pointer. (Consistent with std::shared_ptr)

Parameters

Parameter

Description

InObject

Object this shared pointer to retain a reference to

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss