TSharedFromThis::SharedThis

Provides access to a shared reference to an object, given the object's 'this' pointer.

Windows
MacOS
Linux

References

Module

Core

Header

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

Include

#include "Templates/SharedPointer.h"

Syntax

template<class OtherType>
static TSharedRef< OtherType, Mode > SharedThis
(
    OtherType * ThisPtr
)

Remarks

Provides access to a shared reference to an object, given the object's 'this' pointer. Uses the 'this' pointer to derive the object's actual type, then casts and returns an appropriately typed shared reference. Intentionally declared 'protected', as should only be called when the 'this' pointer can be passed.

Returns

Returns this object as a shared pointer

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