UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GuardedInt.h File Reference
#include "CoreTypes.h"
#include "Concepts/Integral.h"
#include "HAL/PlatformMath.h"
#include "Misc/AssertionMacros.h"
#include "Templates/Requires.h"
#include <limits>
#include <type_traits>

Go to the source code of this file.

Classes

class  TGuardedInt< IntType >
 

Macros

#define UE_GUARDED_SIGNED_INT_IMPL_BINARY_OPERATOR(OP)
 

Typedefs

template<typename SignedType >
using TGuardedSignedInt = TGuardedInt< SignedType >
 
using FGuardedInt32 = TGuardedInt< int32 >
 
using FGuardedInt64 = TGuardedInt< int64 >
 

Macro Definition Documentation

◆ UE_GUARDED_SIGNED_INT_IMPL_BINARY_OPERATOR

#define UE_GUARDED_SIGNED_INT_IMPL_BINARY_OPERATOR (   OP)
Value:
/* Mixed-type expressions that coerce both operands to guarded ints */ \
TGuardedInt operator OP(IntType InB) const { return *this OP TGuardedInt(InB); } \
friend TGuardedInt operator OP(IntType InA, TGuardedInt InB) { return TGuardedInt(InA) OP InB; } \
/* Assignment operators, direct and mixed */ \
TGuardedInt& operator OP##=(TGuardedInt InB) { return *this = *this OP InB; } \
TGuardedInt& operator OP##=(IntType InB) { return *this = *this OP TGuardedInt(InB); } \
/* end */
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition GuardedInt.h:56

Typedef Documentation

◆ FGuardedInt32

Guarded 32-bit integer class. Used to deal with integer data from untrusted sources in size computations etc.

◆ FGuardedInt64

Guarded 64-bit integer class. Used to deal with integer data from untrusted sources in size computations etc.

◆ TGuardedSignedInt

Legacy alias for the previously signed-integer-only implementation.