STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Public Attributes | List of all members
array< _Ty, _Size > Class Template Reference

Public Types

typedef array< _Ty, _Size_Myt
 
typedef _Ty value_type
 
typedef size_t size_type
 
typedef ptrdiff_t difference_type
 
typedef _Ty * pointer
 
typedef const _Ty * const_pointer
 
typedef _Ty & reference
 
typedef const _Ty & const_reference
 
typedef _Array_iterator< _Ty, _Sizeiterator
 
typedef _Array_const_iterator< _Ty, _Sizeconst_iterator
 
typedef _STD reverse_iterator< iteratorreverse_iterator
 
typedef _STD reverse_iterator< const_iteratorconst_reverse_iterator
 

Public Member Functions

void fill (const _Ty &_Value)
 
void swap (_Myt &_Other) _NOEXCEPT_OP(_Is_nothrow_swappable< _Ty >
 
iterator begin () _NOEXCEPT
 
const_iterator begin () const _NOEXCEPT
 
iterator end () _NOEXCEPT
 
const_iterator end () const _NOEXCEPT
 
reverse_iterator rbegin () _NOEXCEPT
 
const_reverse_iterator rbegin () const _NOEXCEPT
 
reverse_iterator rend () _NOEXCEPT
 
const_reverse_iterator rend () const _NOEXCEPT
 
const_iterator cbegin () const _NOEXCEPT
 
const_iterator cend () const _NOEXCEPT
 
const_reverse_iterator crbegin () const _NOEXCEPT
 
const_reverse_iterator crend () const _NOEXCEPT
 
constexpr size_type size () const _NOEXCEPT
 
constexpr size_type max_size () const _NOEXCEPT
 
constexpr bool empty () const _NOEXCEPT
 
reference at (size_type _Pos)
 
constexpr const_reference at (size_type _Pos) const
 
reference operator[] (_In_range_(0, _Size-1) size_type _Pos)
 
constexpr const_reference operator[] (_In_range_(0, _Size-1) size_type _Pos) const
 
reference front ()
 
constexpr const_reference front () const
 
reference back ()
 
constexpr const_reference back () const
 
_Ty * data () _NOEXCEPT
 
const _Ty * data () const _NOEXCEPT
 
void _Xran () const
 

Public Attributes

_Ty _Elems [_Size]
 

Member Typedef Documentation

template<class _Ty, size_t _Size>
typedef array<_Ty, _Size> array< _Ty, _Size >::_Myt
template<class _Ty, size_t _Size>
typedef _Array_const_iterator<_Ty, _Size> array< _Ty, _Size >::const_iterator
template<class _Ty, size_t _Size>
typedef const _Ty* array< _Ty, _Size >::const_pointer
template<class _Ty, size_t _Size>
typedef const _Ty& array< _Ty, _Size >::const_reference
template<class _Ty, size_t _Size>
typedef _STD reverse_iterator<const_iterator> array< _Ty, _Size >::const_reverse_iterator
template<class _Ty, size_t _Size>
typedef ptrdiff_t array< _Ty, _Size >::difference_type
template<class _Ty, size_t _Size>
typedef _Array_iterator<_Ty, _Size> array< _Ty, _Size >::iterator
template<class _Ty, size_t _Size>
typedef _Ty* array< _Ty, _Size >::pointer
template<class _Ty, size_t _Size>
typedef _Ty& array< _Ty, _Size >::reference
template<class _Ty, size_t _Size>
typedef _STD reverse_iterator<iterator> array< _Ty, _Size >::reverse_iterator
template<class _Ty, size_t _Size>
typedef size_t array< _Ty, _Size >::size_type
template<class _Ty, size_t _Size>
typedef _Ty array< _Ty, _Size >::value_type

Member Function Documentation

template<class _Ty, size_t _Size>
void array< _Ty, _Size >::_Xran ( ) const
inline
216  { // report an out_of_range error
217  _Xout_of_range("invalid array<T, N> subscript");
218  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char *)
template<class _Ty, size_t _Size>
reference array< _Ty, _Size >::at ( size_type  _Pos)
inline
134  { // subscript mutable sequence with checking
135  if (_Size <= _Pos)
136  _Xran();
137  return (_Elems[_Pos]);
138  }
_CRT_BEGIN_C_HEADER _Check_return_ _Ret_maybenull_ _In_ size_t _Size
Definition: corecrt_malloc.h:58
void _Xran() const
Definition: array:215
_Ty _Elems[_Size]
Definition: array:220
template<class _Ty, size_t _Size>
constexpr const_reference array< _Ty, _Size >::at ( size_type  _Pos) const
inline
141  { // subscript nonmutable sequence with checking
142  return (_Size <= _Pos
143  ? (_Xran(), _Elems[_Pos]) // TRANSITION, _HAS_CONSTEXPR14
144  : _Elems[_Pos]);
145  }
_CRT_BEGIN_C_HEADER _Check_return_ _Ret_maybenull_ _In_ size_t _Size
Definition: corecrt_malloc.h:58
void _Xran() const
Definition: array:215
_Ty _Elems[_Size]
Definition: array:220
template<class _Ty, size_t _Size>
reference array< _Ty, _Size >::back ( )
inline
196  { // return last element of mutable sequence
197  return (_Elems[_Size - 1]);
198  }
_CRT_BEGIN_C_HEADER _Check_return_ _Ret_maybenull_ _In_ size_t _Size
Definition: corecrt_malloc.h:58
_Ty _Elems[_Size]
Definition: array:220
template<class _Ty, size_t _Size>
constexpr const_reference array< _Ty, _Size >::back ( ) const
inline
201  { // return last element of nonmutable sequence
202  return (_Elems[_Size - 1]);
203  }
_CRT_BEGIN_C_HEADER _Check_return_ _Ret_maybenull_ _In_ size_t _Size
Definition: corecrt_malloc.h:58
_Ty _Elems[_Size]
Definition: array:220
template<class _Ty, size_t _Size>
iterator array< _Ty, _Size >::begin ( )
inline
59  { // return iterator for beginning of mutable sequence
60  return (iterator(_STD addressof(_Elems[0]), 0));
61  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Ty _Elems[_Size]
Definition: array:220
_Array_iterator< _Ty, _Size > iterator
Definition: array:32
template<class _Ty, size_t _Size>
const_iterator array< _Ty, _Size >::begin ( ) const
inline
64  { // return iterator for beginning of nonmutable sequence
65  return (const_iterator(_STD addressof(_Elems[0]), 0));
66  }
_Array_const_iterator< _Ty, _Size > const_iterator
Definition: array:33
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Ty _Elems[_Size]
Definition: array:220
template<class _Ty, size_t _Size>
const_iterator array< _Ty, _Size >::cbegin ( ) const
inline
99  { // return iterator for beginning of nonmutable sequence
100  return (begin());
101  }
iterator begin() _NOEXCEPT
Definition: array:58
template<class _Ty, size_t _Size>
const_iterator array< _Ty, _Size >::cend ( ) const
inline
104  { // return iterator for end of nonmutable sequence
105  return (end());
106  }
iterator end() _NOEXCEPT
Definition: array:68
template<class _Ty, size_t _Size>
const_reverse_iterator array< _Ty, _Size >::crbegin ( ) const
inline
109  { // return iterator for beginning of reversed nonmutable sequence
110  return (rbegin());
111  }
reverse_iterator rbegin() _NOEXCEPT
Definition: array:78
template<class _Ty, size_t _Size>
const_reverse_iterator array< _Ty, _Size >::crend ( ) const
inline
114  { // return iterator for end of reversed nonmutable sequence
115  return (rend());
116  }
reverse_iterator rend() _NOEXCEPT
Definition: array:88
template<class _Ty, size_t _Size>
_Ty* array< _Ty, _Size >::data ( )
inline
206  { // return pointer to mutable data array
207  return (_Elems);
208  }
_Ty _Elems[_Size]
Definition: array:220
template<class _Ty, size_t _Size>
const _Ty* array< _Ty, _Size >::data ( ) const
inline
211  { // return pointer to nonmutable data array
212  return (_Elems);
213  }
_Ty _Elems[_Size]
Definition: array:220
template<class _Ty, size_t _Size>
constexpr bool array< _Ty, _Size >::empty ( ) const
inline
129  { // test if sequence is empty
130  return (false);
131  }
template<class _Ty, size_t _Size>
iterator array< _Ty, _Size >::end ( )
inline
69  { // return iterator for end of mutable sequence
70  return (iterator(_STD addressof(_Elems[0]), _Size));
71  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_CRT_BEGIN_C_HEADER _Check_return_ _Ret_maybenull_ _In_ size_t _Size
Definition: corecrt_malloc.h:58
_Ty _Elems[_Size]
Definition: array:220
_Array_iterator< _Ty, _Size > iterator
Definition: array:32
template<class _Ty, size_t _Size>
const_iterator array< _Ty, _Size >::end ( ) const
inline
74  { // return iterator for beginning of nonmutable sequence
75  return (const_iterator(_STD addressof(_Elems[0]), _Size));
76  }
_Array_const_iterator< _Ty, _Size > const_iterator
Definition: array:33
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_CRT_BEGIN_C_HEADER _Check_return_ _Ret_maybenull_ _In_ size_t _Size
Definition: corecrt_malloc.h:58
_Ty _Elems[_Size]
Definition: array:220
template<class _Ty, size_t _Size>
void array< _Ty, _Size >::fill ( const _Ty &  _Value)
inline
46  { // assign value to all elements
48  }
_OutIt _Fill_n_unchecked(_OutIt _Dest, _Diff _Count, const _Ty &_Val)
Definition: xutility:2743
_CRT_BEGIN_C_HEADER _Check_return_ _Ret_maybenull_ _In_ size_t _Size
Definition: corecrt_malloc.h:58
_Ty _Elems[_Size]
Definition: array:220
_In_ _Value
Definition: corecrt_wstdlib.h:65
template<class _Ty, size_t _Size>
reference array< _Ty, _Size >::front ( )
inline
186  { // return first element of mutable sequence
187  return (_Elems[0]);
188  }
_Ty _Elems[_Size]
Definition: array:220
template<class _Ty, size_t _Size>
constexpr const_reference array< _Ty, _Size >::front ( ) const
inline
191  { // return first element of nonmutable sequence
192  return (_Elems[0]);
193  }
_Ty _Elems[_Size]
Definition: array:220
template<class _Ty, size_t _Size>
constexpr size_type array< _Ty, _Size >::max_size ( ) const
inline
124  { // return maximum possible length of sequence
125  return (_Size);
126  }
_CRT_BEGIN_C_HEADER _Check_return_ _Ret_maybenull_ _In_ size_t _Size
Definition: corecrt_malloc.h:58
template<class _Ty, size_t _Size>
reference array< _Ty, _Size >::operator[] ( _In_range_(0, _Size-1) size_type  _Pos)
inline
148  { // subscript mutable sequence
149  #if _ITERATOR_DEBUG_LEVEL == 2
150  if (_Size <= _Pos)
151  {
152  _DEBUG_ERROR("array subscript out of range");
153  }
154  #elif _ITERATOR_DEBUG_LEVEL == 1
156  #endif /* _ITERATOR_DEBUG_LEVEL */
157 
158  return (_Elems[_Pos]);
159  }
_CRT_BEGIN_C_HEADER _Check_return_ _Ret_maybenull_ _In_ size_t _Size
Definition: corecrt_malloc.h:58
_Ty _Elems[_Size]
Definition: array:220
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:432
#define _DEBUG_ERROR(mesg)
Definition: xutility:33
template<class _Ty, size_t _Size>
constexpr const_reference array< _Ty, _Size >::operator[] ( _In_range_(0, _Size-1) size_type  _Pos) const
inline
174  { // subscript nonmutable sequence
175  #if _ITERATOR_DEBUG_LEVEL == 0
176  return (_Elems[_Pos]);
177 
178  #else /* _ITERATOR_DEBUG_LEVEL == 0 */
179  return (_Size <= _Pos
180  ? (_Bad_subscript(), _Elems[_Pos]) // TRANSITION, _HAS_CONSTEXPR14
181  : _Elems[_Pos]);
182  #endif /* _ITERATOR_DEBUG_LEVEL == 0 */
183  }
_CRT_BEGIN_C_HEADER _Check_return_ _Ret_maybenull_ _In_ size_t _Size
Definition: corecrt_malloc.h:58
_Ty _Elems[_Size]
Definition: array:220
template<class _Ty, size_t _Size>
reverse_iterator array< _Ty, _Size >::rbegin ( )
inline
79  { // return iterator for beginning of reversed mutable sequence
80  return (reverse_iterator(end()));
81  }
_STD reverse_iterator< iterator > reverse_iterator
Definition: array:35
iterator end() _NOEXCEPT
Definition: array:68
template<class _Ty, size_t _Size>
const_reverse_iterator array< _Ty, _Size >::rbegin ( ) const
inline
84  { // return iterator for beginning of reversed nonmutable sequence
85  return (const_reverse_iterator(end()));
86  }
iterator end() _NOEXCEPT
Definition: array:68
_STD reverse_iterator< const_iterator > const_reverse_iterator
Definition: array:36
template<class _Ty, size_t _Size>
reverse_iterator array< _Ty, _Size >::rend ( )
inline
89  { // return iterator for end of reversed mutable sequence
90  return (reverse_iterator(begin()));
91  }
_STD reverse_iterator< iterator > reverse_iterator
Definition: array:35
iterator begin() _NOEXCEPT
Definition: array:58
template<class _Ty, size_t _Size>
const_reverse_iterator array< _Ty, _Size >::rend ( ) const
inline
94  { // return iterator for end of reversed nonmutable sequence
95  return (const_reverse_iterator(begin()));
96  }
iterator begin() _NOEXCEPT
Definition: array:58
_STD reverse_iterator< const_iterator > const_reverse_iterator
Definition: array:36
template<class _Ty, size_t _Size>
constexpr size_type array< _Ty, _Size >::size ( ) const
inline
119  { // return length of sequence
120  return (_Size);
121  }
_CRT_BEGIN_C_HEADER _Check_return_ _Ret_maybenull_ _In_ size_t _Size
Definition: corecrt_malloc.h:58
template<class _Ty, size_t _Size>
void array< _Ty, _Size >::swap ( _Myt _Other)
inline
52  { // swap contents with _Other
54  _STD addressof(_Elems[0]) + _Size,
55  _STD addressof(_Other._Elems[0]));
56  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_FwdIt2 _Swap_ranges_unchecked(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _Dest)
Definition: algorithm:903
_CRT_BEGIN_C_HEADER _Check_return_ _Ret_maybenull_ _In_ size_t _Size
Definition: corecrt_malloc.h:58
_Ty _Elems[_Size]
Definition: array:220

Member Data Documentation

template<class _Ty, size_t _Size>
_Ty array< _Ty, _Size >::_Elems[_Size]

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