UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TAtomic< T > Class Template Reference

#include <Atomic.h>

+ Inheritance diagram for TAtomic< T >:

Public Types

using ElementType = T
 

Public Member Functions

FORCEINLINE TAtomic ()=default
 
constexpr TAtomic (T Arg)
 
FORCEINLINE operator T () const
 
FORCEINLINEoperator= (T Value)
 

Detailed Description

template<typename T>
class TAtomic< T >

DEPRECATED! UE atomics are not maintained and potentially will be physically deprecated. Use std::atomic<T> for new code

Atomic object wrapper class which wraps an element of T. This allows the following benefits:

  • Changes made to the element on one thread can never be observed as a partial state by other threads. (atomicity)
  • Memory accesses within a thread are not reordered across any access of the element. (acquire/release semantics)
  • There is a single, visible, global order of atomic accesses throughout the system. (sequential consistency)

Member Typedef Documentation

◆ ElementType

template<typename T >
using TAtomic< T >::ElementType = T

Constructor & Destructor Documentation

◆ TAtomic() [1/2]

template<typename T >
FORCEINLINE TAtomic< T >::TAtomic ( )
default

Default initializes the element type. NOTE: This will leave the value uninitialized if it has no constructor.

◆ TAtomic() [2/2]

template<typename T >
constexpr TAtomic< T >::TAtomic ( Arg)
inlineconstexpr

Initializes the element type with the given argument types.

Parameters
ArgThe value to initialize the element counter to
Note
This constructor is not atomic.

Member Function Documentation

◆ operator T()

template<typename T >
FORCEINLINE TAtomic< T >::operator T ( ) const
inline

Gets a copy of the current value of the element.

Returns
The current value.

◆ operator=()

template<typename T >
FORCEINLINE T TAtomic< T >::operator= ( Value)
inline

Sets the element to a specific value, returning a copy of the value.

Parameters
ValueThe value to set the element to.
Returns
A copy of Value.

The documentation for this class was generated from the following files: