Flecs v4.1
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
flecs::array< T, Size, enable_if_t< Size !=0 > > Struct Template Referencefinal

Array class specialization for non-zero sizes. More...

#include <array.hpp>

Public Member Functions

 array ()
 Default constructor.
 array (const T(&elems)[Size])
 Construct from a C array.
T & operator[] (int index)
 Element access by int index.
T & operator[] (size_t index)
 Element access by size_t index.
array_iterator< T > begin ()
 Return an iterator to the beginning.
array_iterator< T > end ()
 Return an iterator to the end.
size_t size ()
 Return the number of elements.
T * ptr ()
 Return a pointer to the underlying data.
template<typename Func>
void each (const Func &func)
 Invoke a function for each element.

Detailed Description

template<typename T, size_t Size>
struct flecs::array< T, Size, enable_if_t< Size !=0 > >

Array class specialization for non-zero sizes.

Definition at line 51 of file array.hpp.

Constructor & Destructor Documentation

◆ array() [1/2]

template<typename T, size_t Size>
flecs::array< T, Size, enable_if_t< Size !=0 > >::array ( )
inline

Default constructor.

Definition at line 53 of file array.hpp.

◆ array() [2/2]

template<typename T, size_t Size>
flecs::array< T, Size, enable_if_t< Size !=0 > >::array ( const T(&) elems[Size])
inline

Construct from a C array.

Definition at line 56 of file array.hpp.

Member Function Documentation

◆ begin()

template<typename T, size_t Size>
array_iterator< T > flecs::array< T, Size, enable_if_t< Size !=0 > >::begin ( )
inline

Return an iterator to the beginning.

Definition at line 74 of file array.hpp.

◆ each()

template<typename T, size_t Size>
template<typename Func>
void flecs::array< T, Size, enable_if_t< Size !=0 > >::each ( const Func & func)
inline

Invoke a function for each element.

Definition at line 95 of file array.hpp.

◆ end()

template<typename T, size_t Size>
array_iterator< T > flecs::array< T, Size, enable_if_t< Size !=0 > >::end ( )
inline

Return an iterator to the end.

Definition at line 79 of file array.hpp.

◆ operator[]() [1/2]

template<typename T, size_t Size>
T & flecs::array< T, Size, enable_if_t< Size !=0 > >::operator[] ( int index)
inline

Element access by int index.

Definition at line 64 of file array.hpp.

◆ operator[]() [2/2]

template<typename T, size_t Size>
T & flecs::array< T, Size, enable_if_t< Size !=0 > >::operator[] ( size_t index)
inline

Element access by size_t index.

Definition at line 69 of file array.hpp.

◆ ptr()

template<typename T, size_t Size>
T * flecs::array< T, Size, enable_if_t< Size !=0 > >::ptr ( )
inline

Return a pointer to the underlying data.

Definition at line 89 of file array.hpp.

◆ size()

template<typename T, size_t Size>
size_t flecs::array< T, Size, enable_if_t< Size !=0 > >::size ( )
inline

Return the number of elements.

Definition at line 84 of file array.hpp.


The documentation for this struct was generated from the following file: