# Poco

# template < class T, std::size_t N >

# class Array

Library: Foundation
Package: Core
Header: Poco/Array.h

## Description

STL container like C-style array replacement class.

This implementation is based on the idea of Nicolai Josuttis. His original implementation can be found at http://www.josuttis.com/cppcode/array.html .

## Member Summary

Member Functions: assign, at, back, begin, c_array, data, empty, end, front, max_size, operator =, operator [], rbegin, rend, size, swap

## Types Aliases

### const_iterator

using const_iterator = const T *;

### const_reference

using const_reference = const T &;

### const_reverse_iterator

using const_reverse_iterator = std::reverse_iterator < const_iterator >;

### difference_type

using difference_type = std::ptrdiff_t;

### iterator

using iterator = T *;

### reference

using reference = T &;

### reverse_iterator

using reverse_iterator = std::reverse_iterator < iterator >;

### size_type

using size_type = std::size_t;

### value_type

using value_type = T;

## Enumerations

### Anonymous

static_size = N

## Member Functions

### assign

void assign(
const T & value
);

Assign one value to all elements

### at

reference at(
size_type i
);

Element access with range check. Throws Poco::InvalidArgumentException if the index is over range.

### at

const_reference at(
size_type i
) const;

Element access with range check. Throws Poco::InvalidArgumentException if the index is over range.

### back

reference back();

### back

const_reference back() const;

### begin

iterator begin();

### begin

const_iterator begin() const;

### c_array

T * c_array();

Use array as C array (direct read/write access to data)

### data

const T * data() const;

Direct access to data (read-only)

### data

T * data();

### empty

static bool empty();

### end

iterator end();

### end

const_iterator end() const;

### front

reference front();

### front

const_reference front() const;

### max_size

static size_type max_size();

### operator =

template < typename Other > Array < T, N > & operator = (
const Array < Other, N > & rhs
);

Assignment with type conversion

### operator []

reference operator[] (
size_type i
);

Element access without range check. If the index is not small than the given size, the behavior is undefined.

### operator []

const_reference operator[] (
size_type i
) const;

Element access without range check. If the index is not small than the given size, the behavior is undefined.

### rbegin

reverse_iterator rbegin();

### rbegin

const_reverse_iterator rbegin() const;

### rend

reverse_iterator rend();

### rend

const_reverse_iterator rend() const;

### size

static size_type size();

### swap

void swap(
Array < T, N > & y
) noexcept;

## Variables

### elems

T elems[N];

Fixed-size array of elements of type T, public specifier used to make this class a aggregate.