# 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

### const_iterator

typedef const T * const_iterator;

### const_reference

typedef const T & const_reference;

### const_reverse_iterator

typedef std::reverse_iterator < const_iterator > const_reverse_iterator;

### difference_type

typedef std::ptrdiff_t difference_type;

### iterator

typedef T * iterator;

### reference

typedef T & reference;

### reverse_iterator

typedef std::reverse_iterator < iterator > reverse_iterator;

### size_type

typedef std::size_t size_type;

### value_type

typedef T value_type;

## 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
);

## Variables

### elems

T elems[N];

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