API documentation

#include <arrayHelpers.h>

Functions

template<class T, size_t n>
size_t arraySize(T const (&)[n])

Return the size of an arbitrary array.

Parameters:

- – Array reference.

Returns:

Array size.

Class definitions

template<class T>
class Span

A limited implementation of std::span.

Public Functions

template<size_t n>
Span(T (&arr)[n])

Create a Span with n elements.

Template Parameters:

n – Number of elements.

Parameters:

arr – Array.

T &operator[](size_t const idx)

Get a reference to the element indexed by idx.

Parameters:

idx – Index.

Returns:

Reference to element.

T const &operator[](size_t const idx) const

Get a reference to the element indexed by idx.

Parameters:

idx – Index.

Returns:

Reference to element.

T *begin()

Get a pointer to the start of the array.

Returns:

Pointer to the start of the array.

T *end()

Get a pointer to the end of the array.

Returns:

Pointer to the end of the array.

T const *begin() const

Get a pointer to the start of the array.

Returns:

Pointer to the start of the array.

T const *end() const

Get a pointer to the end of the array.

Returns:

Pointer to the end of the array.

T *data() const

Get the underlying data.

Returns:

data.

size_t size() const

Get the number of elements.

Returns:

Array size.