template<typename T>
RepeatArray class

Public types

class Iterator

Constructors, destructors, conversion operators

RepeatArray(const T& value, size_t size)

Public functions

auto operator[](size_t) const -> T
auto size() const -> size_t
auto begin() const -> Iterator
auto end() const -> Iterator

Function documentation

template<typename T>
RepeatArray<T>::RepeatArray(const T& value, size_t size)

Parameters
value in Value to initialize array elements with.
size in Number of elements in array.

Constructor for RepeatArray class.

Initializes a RepeatArray with the given value repeated size number of times.

template<typename T>
T RepeatArray<T>::operator[](size_t) const

Returns The value stored in the RepeatArray.

Overloads the subscript operator [] to return the value stored in the RepeatArray.

template<typename T>
size_t RepeatArray<T>::size() const

Returns the value of the variable "size" as a size_t data type.

Returns the number of elements in the RepeatArray.

template<typename T>
Iterator RepeatArray<T>::begin() const

Returns Iterator object pointing to the first element.

Returns an iterator pointing to the first element of the container.

This begins iteration at the start of the underlying container.

template<typename T>
Iterator RepeatArray<T>::end() const

Returns Iterator pointing past the last element.

Returns an iterator pointing to the past-the-end element of the container.

This ends iteration at the end of the underlying container. Trying to dereference the returned iterator results in undefined behavior.