BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsl::array< VALUE_TYPE, SIZE > Struct Template Reference

#include <bslstl_array.h>

Public Types

typedef VALUE_TYPE value_type
 
typedef VALUE_TYPE * pointer
 
typedef const VALUE_TYPE * const_pointer
 
typedef VALUE_TYPE & reference
 
typedef const VALUE_TYPE & const_reference
 
typedef size_t size_type
 
typedef ptrdiff_t difference_type
 
typedef pointer iterator
 
typedef const_pointer const_iterator
 
typedef bsl::reverse_iterator< iteratorreverse_iterator
 
typedef bsl::reverse_iterator< const_iteratorconst_reverse_iterator
 

Public Member Functions

 array ()=default
 
 array (const array &original)=default
 
 array (array &&original)=default
 
 ~array ()=default
 
void fill (const VALUE_TYPE &value)
 
BSLS_KEYWORD_CONSTEXPR_CPP14 iterator end () BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP17 reverse_iterator rbegin () BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP17 reverse_iterator rend () BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 reference operator[] (size_type position)
 
BSLS_KEYWORD_CONSTEXPR_CPP14 reference at (size_type position)
 
BSLS_KEYWORD_CONSTEXPR_CPP14 reference front ()
 
BSLS_KEYWORD_CONSTEXPR_CPP14 reference back ()
 
BSLS_KEYWORD_CONSTEXPR_CPP14 pointer data () BSLS_KEYWORD_NOEXCEPT
 
arrayoperator= (const array &other)
 
arrayoperator= (array &&other)
 
BSLS_KEYWORD_CONSTEXPR_CPP14 const_iterator begin () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 const_iterator cbegin () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 const_iterator end () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 const_iterator cend () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP17 const_reverse_iterator rbegin () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP17 const_reverse_iterator crbegin () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP17 const_reverse_iterator rend () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP17 const_reverse_iterator crend () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR bool empty () const BSLS_KEYWORD_NOEXCEPT
 Return true if the array has size 0, and false otherwise.
 
BSLS_KEYWORD_CONSTEXPR size_type size () const BSLS_KEYWORD_NOEXCEPT
 Return the number of elements in this array.
 
BSLS_KEYWORD_CONSTEXPR size_type max_size () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 const_reference operator[] (size_type position) const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 const_reference at (size_type position) const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 const_reference front () const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 const_reference back () const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 const_pointer data () const BSLS_KEYWORD_NOEXCEPT
 

Public Attributes

VALUE_TYPE d_data [(0==SIZE) ? 1 :SIZE]
 
void swap(array &rhs) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(bsl BSLS_KEYWORD_CONSTEXPR_CPP14 iterator begin () BSLS_KEYWORD_NOEXCEPT
 

Detailed Description

template<class VALUE_TYPE, size_t SIZE>
struct bsl::array< VALUE_TYPE, SIZE >

This class template provides a standard conforming implementation of std::array. array is an aggregate wrapper around a raw array, supporting aggregate initialization and an iterator interface as required for a standard container.

Member Typedef Documentation

◆ const_iterator

template<class VALUE_TYPE , size_t SIZE>
typedef const_pointer bsl::array< VALUE_TYPE, SIZE >::const_iterator

◆ const_pointer

template<class VALUE_TYPE , size_t SIZE>
typedef const VALUE_TYPE* bsl::array< VALUE_TYPE, SIZE >::const_pointer

◆ const_reference

template<class VALUE_TYPE , size_t SIZE>
typedef const VALUE_TYPE& bsl::array< VALUE_TYPE, SIZE >::const_reference

◆ const_reverse_iterator

template<class VALUE_TYPE , size_t SIZE>
typedef bsl::reverse_iterator<const_iterator> bsl::array< VALUE_TYPE, SIZE >::const_reverse_iterator

◆ difference_type

template<class VALUE_TYPE , size_t SIZE>
typedef ptrdiff_t bsl::array< VALUE_TYPE, SIZE >::difference_type

◆ iterator

template<class VALUE_TYPE , size_t SIZE>
typedef pointer bsl::array< VALUE_TYPE, SIZE >::iterator

◆ pointer

template<class VALUE_TYPE , size_t SIZE>
typedef VALUE_TYPE* bsl::array< VALUE_TYPE, SIZE >::pointer

◆ reference

template<class VALUE_TYPE , size_t SIZE>
typedef VALUE_TYPE& bsl::array< VALUE_TYPE, SIZE >::reference

◆ reverse_iterator

template<class VALUE_TYPE , size_t SIZE>
typedef bsl::reverse_iterator<iterator> bsl::array< VALUE_TYPE, SIZE >::reverse_iterator

◆ size_type

template<class VALUE_TYPE , size_t SIZE>
typedef size_t bsl::array< VALUE_TYPE, SIZE >::size_type

◆ value_type

template<class VALUE_TYPE , size_t SIZE>
typedef VALUE_TYPE bsl::array< VALUE_TYPE, SIZE >::value_type

Constructor & Destructor Documentation

◆ array() [1/3]

template<class VALUE_TYPE , size_t SIZE>
bsl::array< VALUE_TYPE, SIZE >::array ( )
default

Create an array object. Every element is default constructed if VALUE_TYPE is default constructible; otherwise, array is not default constructible.

◆ array() [2/3]

template<class VALUE_TYPE , size_t SIZE>
bsl::array< VALUE_TYPE, SIZE >::array ( const array< VALUE_TYPE, SIZE > &  original)
default

Create an array object having the same value as the specified original object. Every element is copy constructed from the corresponding element in the specified original if VALUE_TYPE is copy constructible; otherwise, array is not copy constructible. Only in C++11 and later.

◆ array() [3/3]

template<class VALUE_TYPE , size_t SIZE>
bsl::array< VALUE_TYPE, SIZE >::array ( array< VALUE_TYPE, SIZE > &&  original)
default

Create an array object having the same value as the specified original object. Every element is move constructed from the corresponding element in the specified original if VALUE_TYPE is move constructible; otherwise, array is not move constructible.

◆ ~array()

template<class VALUE_TYPE , size_t SIZE>
bsl::array< VALUE_TYPE, SIZE >::~array ( )
default

Destroy this object. Evert element is destroyed if VALUE_TYPE is destructible; otherwise, array is not destructible.

Member Function Documentation

◆ at() [1/2]

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP14 array< VALUE_TYPE, SIZE >::reference bsl::array< VALUE_TYPE, SIZE >::at ( size_type  position)

Return a reference to the element at the specified position in this array. Throw an out_of_range exception if position >= size().

◆ at() [2/2]

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP14 array< VALUE_TYPE, SIZE >::const_reference bsl::array< VALUE_TYPE, SIZE >::at ( size_type  position) const

Return a reference providing non-modifiable access to the element at the specified position in this array. Throw an out_of_range exception if position >= size().

◆ back() [1/2]

template<class VALUE_TYPE , size_t SIZE>
array< VALUE_TYPE, SIZE >::reference BSLS_KEYWORD_CONSTEXPR_CPP14 bsl::array< VALUE_TYPE, SIZE >::back ( )

Return a reference to the last element in this array. The behavior is undefined unless SIZE > 0.

◆ back() [2/2]

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP14 array< VALUE_TYPE, SIZE >::const_reference bsl::array< VALUE_TYPE, SIZE >::back ( ) const

Return a reference providing non-modifiable access to the last element in this array. Behavior is undefined unless SIZE > 0.

◆ begin()

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP14 const_iterator bsl::array< VALUE_TYPE, SIZE >::begin ( ) const

Return an iterator providing non-modifiable access to the first element in this array; return a past-the-end iterator if this array has size 0.

◆ cbegin()

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP14 array< VALUE_TYPE, SIZE >::const_iterator bsl::array< VALUE_TYPE, SIZE >::cbegin ( ) const

◆ cend()

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP14 array< VALUE_TYPE, SIZE >::const_iterator bsl::array< VALUE_TYPE, SIZE >::cend ( ) const

◆ crbegin()

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP17 array< VALUE_TYPE, SIZE >::const_reverse_iterator bsl::array< VALUE_TYPE, SIZE >::crbegin ( ) const

◆ crend()

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP17 array< VALUE_TYPE, SIZE >::const_reverse_iterator bsl::array< VALUE_TYPE, SIZE >::crend ( ) const

◆ data() [1/2]

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP14 array< VALUE_TYPE, SIZE >::iterator bsl::array< VALUE_TYPE, SIZE >::data ( )

Return the address of the first element of the underlying raw array. Return a valid T* which cannot be dereferenced if the SIZE is 0.

◆ data() [2/2]

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP14 array< VALUE_TYPE, SIZE >::const_iterator bsl::array< VALUE_TYPE, SIZE >::data ( ) const

Return the address of the first element of the underlying raw array. Return a valid T* which cannot be dereferenced if the SIZE is 0.

◆ empty()

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR bool bsl::array< VALUE_TYPE, SIZE >::empty ( ) const

◆ end() [1/2]

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP14 array< VALUE_TYPE, SIZE >::iterator bsl::array< VALUE_TYPE, SIZE >::end ( )

Return a past-the-end iterator providing modifiable access to this array.

◆ end() [2/2]

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP14 array< VALUE_TYPE, SIZE >::const_iterator bsl::array< VALUE_TYPE, SIZE >::end ( ) const

Return a past-the-end iterator providing non-modifiable access to this array.

◆ fill()

template<class VALUE_TYPE , size_t SIZE>
void bsl::array< VALUE_TYPE, SIZE >::fill ( const VALUE_TYPE &  value)

Set every element in this array to the specified value using the operator= of value_type.

◆ front() [1/2]

template<class VALUE_TYPE , size_t SIZE>
array< VALUE_TYPE, SIZE >::reference BSLS_KEYWORD_CONSTEXPR_CPP14 bsl::array< VALUE_TYPE, SIZE >::front ( )

Return a reference to the first element in this array. The behavior is undefined unless SIZE > 0.

◆ front() [2/2]

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP14 array< VALUE_TYPE, SIZE >::const_reference bsl::array< VALUE_TYPE, SIZE >::front ( ) const

Return a reference providing non-modifiable access to the first element in this array. The behavior is undefined unless SIZE > 0.

◆ max_size()

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR size_t bsl::array< VALUE_TYPE, SIZE >::max_size ( ) const

◆ operator=() [1/2]

template<class VALUE_TYPE , size_t SIZE>
array & bsl::array< VALUE_TYPE, SIZE >::operator= ( array< VALUE_TYPE, SIZE > &&  other)

Moves every element in the specified other into the corresponding element in this array in the if VALUE_TYPE is moves assignable; otherwise, array is not move assignable.

◆ operator=() [2/2]

template<class VALUE_TYPE , size_t SIZE>
array & bsl::array< VALUE_TYPE, SIZE >::operator= ( const array< VALUE_TYPE, SIZE > &  other)

Sets every element in this array to the corresponding element in the specified other if VALUE_TYPE is copy assignable; otherwise, array is not copy assignable.

◆ operator[]() [1/2]

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP14 array< VALUE_TYPE, SIZE >::reference bsl::array< VALUE_TYPE, SIZE >::operator[] ( size_type  position)

Return a reference providing modifiable access to the element at the specified position in this array. The behavior is undefined unless position < size().

◆ operator[]() [2/2]

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP14 array< VALUE_TYPE, SIZE >::const_reference bsl::array< VALUE_TYPE, SIZE >::operator[] ( size_type  position) const

Return a reference providing non-modifiable access to the element at the specified position in this array. The behavior is undefined unless position < size().

◆ rbegin() [1/2]

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP17 array< VALUE_TYPE, SIZE >::reverse_iterator bsl::array< VALUE_TYPE, SIZE >::rbegin ( )

Return a reverse iterator providing modifiable access to the last element in this array; return a past-the-end iterator if this array has size 0.

◆ rbegin() [2/2]

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP17 array< VALUE_TYPE, SIZE >::const_reverse_iterator bsl::array< VALUE_TYPE, SIZE >::rbegin ( ) const

Return a reverse iterator providing non-modifiable access to the last element in this array, and the past-the-end reverse iterator if this array has size 0.

◆ rend() [1/2]

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP17 array< VALUE_TYPE, SIZE >::reverse_iterator bsl::array< VALUE_TYPE, SIZE >::rend ( )

Return the past-the-end reverse iterator providing modifiable access to this array.

◆ rend() [2/2]

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP17 array< VALUE_TYPE, SIZE >::const_reverse_iterator bsl::array< VALUE_TYPE, SIZE >::rend ( ) const

Return the past-the-end reverse iterator providing non-modifiable access to this array.

◆ size()

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR size_t bsl::array< VALUE_TYPE, SIZE >::size ( ) const

Member Data Documentation

◆ begin

template<class VALUE_TYPE , size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP14 array< VALUE_TYPE, SIZE >::const_iterator bsl::array< VALUE_TYPE, SIZE >::begin

Exchange each corresponding element between this array and the specified rhs array by calling swap(a,b) where swap is found by overload resolution including at least the namespaces std and the associated namespaces of VALUE_TYPE. Return an iterator providing modifiable access to the first element in this array; return a past-the-end iterator if this array has size 0.

◆ d_data

template<class VALUE_TYPE , size_t SIZE>
VALUE_TYPE bsl::array< VALUE_TYPE, SIZE >::d_data[(0==SIZE) ? 1 :SIZE]

The documentation for this struct was generated from the following file: