TScopeGuard

Not meant for direct consumption : use ON_SCOPE_EXIT instead.

Windows
MacOS
Linux

Inheritance Hierarchy

FNoncopyable

TScopeGuard

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Misc/ScopeExit.h

Include

#include "Misc/ScopeExit.h"

Syntax

template<typename FuncType>
class TScopeGuard : public FNoncopyable

Remarks

Not meant for direct consumption : use ON_SCOPE_EXIT instead.

RAII class that calls a lambda when it is destroyed.

Constructors

Name Description

Public function

TScopeGuard

(
    FuncType&& InFunc
)

Given a lambda, constructs an RAII scope guard.

Public function

TScopeGuard

(
    TScopeGuard&& Other
)

This constructor needs to be available for the code to compile.

Destructors

Name Description

Public function

~TScopeGuard()

Causes.

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