This assertion is checked only in the INDEX_CHECKS compilation mode.
Either a functor class satisfying the extended requirements for unary operations, or an untyped template of such a class wrapped into BuildUnary or BuildUnaryIt (preferably expressed via the convenience typedef from namespace polymake::operations.
Either a functor class satisfying the extended requirements for binary operations, or an untyped template of such a class wrapped into BuildBinary or BuildBinaryIt (preferably expressed via the convenience typedef from namespace polymake::operations.

### Prerequisits

    #include <Array.h>
    using namespace polymake;

### Introduction

template <typename ElementType> class Array;

Offers practically the same as std::vector. The only significant differences are that the data array is attached via a smart pointer with reference counting, and the set of operations changing the size of the array is reduced to the minimum.

### Construction

Array();
Create an empty array.
explicit Array(int n);
Create an array with n elements, initialized with the default constructor.
explicit Array(int n, const ElementType&);
Create an array with n elements, initialized with the same value.
template <typename Iterator> Array(int n, Iterator src);
Create an array with n, initialized from a data sequence.
template <int n> explicit Array(const ElementType (&a)[n]); template <typename OtherElementType, int n> explicit Array(const OtherElementType (&a)[n]);
Create an array with n elements, initialized from a built-in array. The second variant supposes an explicit element conversion.

### Modification

Array::operator= (const ElementType (&a)[n]);
Resize to n elements, assign values from the built-in array.
void std::swap(Array&, Array&);
Swap the contents of two arrays in a most efficient way.
Array::assign (int n, const ElementType& x);
Resize to n elements, fill with copies of the given value x.
template <typename Iterator> Array::append (int n, Iterator src);
Keep the old elements, add n new elements to the tail, assign them values from the data sequence.
void Array::resize(int n); void Array::resize(int n, const ElementType& x);
If n is less than the current array length, delete the trailing elements. If greater, add new elements initialized with the default constructor resp. the copies of the given value x.
Unlike std::vector, Array never allocates extra stock storage. Each resize operation causes the data area reallocation.
void Array::fill (const ElementType& x);
Assign x to all elements.

### Element access

Array inplements the Random Access Container interface. The element index in the random access method (operator[]) should lie in the valid range, the array doesn't grow implicitly.