TStructOnScope

Typed [FStructOnScope](API\Runtime\CoreUObject\UObject\FStructOnScope) that exposes type-safe access to the wrapped struct

Windows
MacOS
Linux

Inheritance Hierarchy

FStructOnScope

TStructOnScope

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/UObject/StructOnScope.h

Include

#include "UObject/StructOnScope.h"

Syntax

template<typename T, typename>
class TStructOnScope : public FStructOnScope

Remarks

Typed FStructOnScope that exposes type-safe access to the wrapped struct

The second template argument is there to restrict to type that are actually USTRUCT. It will be replaced to a static_assert with a better compiler error with a "is ustruct" type trait

Constructors

Name Description

Public function

TStructOnScope()

Public function

TStructOnScope

(
    TStructOnScope&& InOther
)

Public function

TStructOnScope

(
    U&& InStruct
)

Destructors

Name Description

Public function Virtual

~TStructOnScope()

Functions

Name Description

Public function Const

const U *...

 

Cast()

Public function

U *

 

Cast()

Public function

U *

 

CastChecked()

Public function Const

const U *...

 

CastChecked()

Public function Const

T *

 

Get()

Public function

void

 

InitializeAs

(
    TArgs&&... InArgs
)

Initialize the TStructOnScope as a struct of type U which needs to derive from T InArgs The arguments to pass to the constructor of type U

Public function

bool

 

InitializeFrom

(
    const FStructOnScope& InOther
)

Initialize the TStructOnScope from a FStructOnScope containing data that derives from T InOther The FStructOnScope to initialize from

Public function

bool

 

InitializeFrom

(
    FStructOnScope&& InOther
)

Initialize the TStructOnScope from a FStructOnScope containing data that derives from T InOther The FStructOnScope to initialize from

Public function

void

 

InitializeFromChecked

(
    const FStructOnScope& InOther
)

Initialize the TStructOnScope from a FStructOnScope containing data that derives from T InOther The FStructOnScope to initialize from (will assert if it contains an invalid type to store for T)

Public function

void

 

InitializeFromChecked

(
    FStructOnScope&& InOther
)

Initialize the TStructOnScope from a FStructOnScope containing data that derives from T InOther The FStructOnScope to initialize from (will assert if it contains an invalid type to store for T)

Operators

Name Description

Public function Const

 

operator bool()

Public function

TStructOnSco...

 

operator=

(
    TStructOnScope&& InOther
)

Public function

TStructOnSco...

 

operator=

(
    U&& InStruct
)

Public function Const

T *

 

operator->()

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback