System.StaticArray
C++
template <typename T, int size> struct StaticArray
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
class | public | sysmac.h | System | System |
Description
A fixed-length array of T. T is any type.
A StaticArray is a fixed-length collection implemented as an array. The size of a static array is constant and must be known at compile time.
Template parameters
Parameter | Usage |
---|---|
T | Type of the elements |
size | Size of the array |
Access the static array elements using the subscript operator:
// C++ example
StaticArray<int, 5>a;
a[0] = 100;
printf("%d", a[0]); // value of element 0
The index used for accessing an element is not checked for validity.
Note: The StaticArray class is designed for Delphi functions that return static arrays.