Namespaces
Variants
Views
Actions

std::array

From cppreference.com
< cpp‎ | container
Revision as of 01:35, 12 June 2012 by P12bot (Talk | contribs)

Template:cpp/container/array/sidebar

Defined in header <array>
template<

    class T,
    size_t N

> struct array;
(since C++11)

array is a container that encapsulates constant size arrays.

This struct is designed to provide the benefits of a standard container (an array knows its own size, supports assignment, random access iterators, etc.) while still providing the aggregate type semantics of C-style arrays.

There is a special case for a zero-length array (N == 0). In that case, array.begin() == array.end(), which is some unique value. The effect of calling front() or back() on a zero-sized array is undefined.

array is a class aggregate which allows it to use aggregate-initialization.

Contents

Member types

Template:cpp/container/tdcl list value typeTemplate:cpp/container/tdcl list size typeTemplate:cpp/container/tdcl list difference typeTemplate:cpp/container/tdcl list referenceTemplate:cpp/container/tdcl list const referenceTemplate:cpp/container/tdcl list pointerTemplate:cpp/container/tdcl list const pointerTemplate:cpp/container/tdcl list iteratorTemplate:cpp/container/tdcl list const iteratorTemplate:cpp/container/tdcl list reverse iteratorTemplate:cpp/container/tdcl list const reverse iterator
Member type Definition

Member functions

Template:cpp/container/dcl list atTemplate:cpp/container/dcl list operator atTemplate:cpp/container/dcl list frontTemplate:cpp/container/dcl list backTemplate:cpp/container/dcl list dataTemplate:cpp/container/dcl list beginTemplate:cpp/container/dcl list endTemplate:cpp/container/dcl list rbeginTemplate:cpp/container/dcl list rendTemplate:cpp/container/dcl list emptyTemplate:cpp/container/dcl list sizeTemplate:cpp/container/dcl list max sizeTemplate:cpp/container/dcl list fillTemplate:cpp/container/dcl list swap
Element access
Iterators
Capacity
Operations

Non-member functions

Template:cpp/container/dcl list operator cmpTemplate:cpp/container/array/dcl list getTemplate:cpp/container/dcl list swap2

Helper classes

Template:cpp/container/array/dcl list tuple sizeTemplate:cpp/container/array/dcl list tuple element