MakeShared

MakeShared utility function.

Windows
MacOS
Linux

References

Module

Core

Header

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

Include

#include "Templates/SharedPointer.h"

Syntax

template<typename InObjectType, ESPMode InMode, typename... InArgTypes>
TSharedRef< InObjectType, InMode > MakeShared
(
    InArgTypes &&... Args
)

Remarks

MakeShared utility function. Allocates a new ObjectType and reference controller in a single memory block. Equivalent to std::make_shared.

If the constructor is private/protected you will need to friend the intrusive reference controller in your class. e.g. template =""> friend class SharedPointerInternals::TIntrusiveReferenceController;

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