UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Chaos::TCArray< T, N > Class Template Reference

A c-style array of objects with non-shipping bounds checking. More...

#include <UncheckedArray.h>

Public Types

using ElementType = T
 

Public Member Functions

 TCArray ()
 
int32 Num () const
 
int32 Max () const
 
bool IsEmpty () const
 
bool IsFull () const
 
ElementTypeoperator[] (const int32 Index)
 
const ElementTypeoperator[] (const int32 Index) const
 
void SetNum (const int32 InNum)
 Set the number of elements in the array.
 
void Reset ()
 Set the number of elements to 0.
 
void Empty ()
 Set the number of elements to 0.
 
int32 Add ()
 Increase the size of the array without re-initializing the new element.
 
int32 AddUninitialized ()
 Increase the size of the array without re-initializing the new element.
 
int32 Add (const ElementType &V)
 Copy the element to the end of the array.
 
int32 Add (ElementType &&V)
 Move the element to the end of the array.
 
int32 Emplace (ElementType &&V)
 Move the element to the end of the array.
 
void RemoveAt (const int32 Index)
 Remove the element at the specified index Moves all higher elements down to fill the gap.
 
void RemoveAtSwap (const int32 Index)
 Remove the element at the specified index Moves the last element into the gap.
 
ElementTypeGetData ()
 
const ElementTypeGetData () const
 
ElementTypebegin ()
 
const ElementTypebegin () const
 
ElementTypeend ()
 
const ElementTypeend () const
 

Static Public Member Functions

static TCArray< T, N > MakeFull ()
 
static TCArray< T, N > MakeEmpty ()
 

Static Public Attributes

static const int32 MaxElements = N
 

Detailed Description

template<typename T, int32 N>
class Chaos::TCArray< T, N >

A c-style array of objects with non-shipping bounds checking.

This behaves exactly like a C-style array, although it also keeps track of the number of elements in the array. This element count is artficial - all elements in the array are default constructed and will not be destructed until the array itself is destroyed.

Note
the element type must have a default constructor

Member Typedef Documentation

◆ ElementType

template<typename T , int32 N>
using Chaos::TCArray< T, N >::ElementType = T

Constructor & Destructor Documentation

◆ TCArray()

template<typename T , int32 N>
Chaos::TCArray< T, N >::TCArray ( )
inline

Member Function Documentation

◆ Add() [1/3]

template<typename T , int32 N>
int32 Chaos::TCArray< T, N >::Add ( )
inline

Increase the size of the array without re-initializing the new element.

◆ Add() [2/3]

template<typename T , int32 N>
int32 Chaos::TCArray< T, N >::Add ( const ElementType V)
inline

Copy the element to the end of the array.

◆ Add() [3/3]

template<typename T , int32 N>
int32 Chaos::TCArray< T, N >::Add ( ElementType &&  V)
inline

Move the element to the end of the array.

◆ AddUninitialized()

template<typename T , int32 N>
int32 Chaos::TCArray< T, N >::AddUninitialized ( )
inline

Increase the size of the array without re-initializing the new element.

◆ begin() [1/2]

template<typename T , int32 N>
ElementType * Chaos::TCArray< T, N >::begin ( )
inline

◆ begin() [2/2]

template<typename T , int32 N>
const ElementType * Chaos::TCArray< T, N >::begin ( ) const
inline

◆ Emplace()

template<typename T , int32 N>
int32 Chaos::TCArray< T, N >::Emplace ( ElementType &&  V)
inline

Move the element to the end of the array.

◆ Empty()

template<typename T , int32 N>
void Chaos::TCArray< T, N >::Empty ( )
inline

Set the number of elements to 0.

Note
Does not reset any elements

◆ end() [1/2]

template<typename T , int32 N>
ElementType * Chaos::TCArray< T, N >::end ( )
inline

◆ end() [2/2]

template<typename T , int32 N>
const ElementType * Chaos::TCArray< T, N >::end ( ) const
inline

◆ GetData() [1/2]

template<typename T , int32 N>
ElementType * Chaos::TCArray< T, N >::GetData ( )
inline

◆ GetData() [2/2]

template<typename T , int32 N>
const ElementType * Chaos::TCArray< T, N >::GetData ( ) const
inline

◆ IsEmpty()

template<typename T , int32 N>
bool Chaos::TCArray< T, N >::IsEmpty ( ) const
inline

◆ IsFull()

template<typename T , int32 N>
bool Chaos::TCArray< T, N >::IsFull ( ) const
inline

◆ MakeEmpty()

template<typename T , int32 N>
static TCArray< T, N > Chaos::TCArray< T, N >::MakeEmpty ( )
inlinestatic

◆ MakeFull()

template<typename T , int32 N>
static TCArray< T, N > Chaos::TCArray< T, N >::MakeFull ( )
inlinestatic

◆ Max()

template<typename T , int32 N>
int32 Chaos::TCArray< T, N >::Max ( ) const
inline

◆ Num()

template<typename T , int32 N>
int32 Chaos::TCArray< T, N >::Num ( ) const
inline

◆ operator[]() [1/2]

template<typename T , int32 N>
ElementType & Chaos::TCArray< T, N >::operator[] ( const int32  Index)
inline

◆ operator[]() [2/2]

template<typename T , int32 N>
const ElementType & Chaos::TCArray< T, N >::operator[] ( const int32  Index) const
inline

◆ RemoveAt()

template<typename T , int32 N>
void Chaos::TCArray< T, N >::RemoveAt ( const int32  Index)
inline

Remove the element at the specified index Moves all higher elements down to fill the gap.

◆ RemoveAtSwap()

template<typename T , int32 N>
void Chaos::TCArray< T, N >::RemoveAtSwap ( const int32  Index)
inline

Remove the element at the specified index Moves the last element into the gap.

◆ Reset()

template<typename T , int32 N>
void Chaos::TCArray< T, N >::Reset ( )
inline

Set the number of elements to 0.

Note
Does not reset any elements

◆ SetNum()

template<typename T , int32 N>
void Chaos::TCArray< T, N >::SetNum ( const int32  InNum)
inline

Set the number of elements in the array.

Note
Does not reset any added or removed elements, it only changes the number-of-elements counter

Member Data Documentation

◆ MaxElements

template<typename T , int32 N>
const int32 Chaos::TCArray< T, N >::MaxElements = N
static

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