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 DeleterType, typename>
TSharedPtr
(
    OtherType * InObject,
    DeleterType && InDeleter
)

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

InDeleter

Deleter object used to destroy the object when it is no longer referenced.

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