TScopeCounter

Commonly used to make sure a value is incremented, and then decremented anyway the function can terminate.

Windows
MacOS
Linux

Inheritance Hierarchy

FNoncopyable

TScopeCounter

References

Module

Core

Header

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

Include

#include "Templates/UnrealTemplate.h"

Syntax

template<typename Type>
struct TScopeCounter : private FNoncopyable

Remarks

Commonly used to make sure a value is incremented, and then decremented anyway the function can terminate. Usage: TScopeCounter<int32> BeginProcessing(ProcessingCount); // increments ProcessingCount, and decrements it in the dtor

Constructors

Name Description

Public function

TScopeCounter

(
    Type& ReferenceValue
)

Destructors

Name Description

Public function

~TScopeCounter()

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