STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Static 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)
 
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[] (size_type _Pos)
 
constexpr const_reference operator[] (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
 
void swap (_Myt &_Other) _NOEXCEPT_OP(_Is_nothrow_swappable< _Ty >
 

Static Public Member Functions

static void _Bad_subscript ()
 

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>
static void array< _Ty, _Size >::_Bad_subscript ( )
inlinestatic
156  { // report invalid subscript
157  #if _ITERATOR_DEBUG_LEVEL == 2
158  _DEBUG_ERROR("array subscript out of range");
159 
160  #elif _ITERATOR_DEBUG_LEVEL == 1
162  #endif /* _ITERATOR_DEBUG_LEVEL */
163  }
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:392
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
template<class _Ty, size_t _Size>
void array< _Ty, _Size >::_Xran ( ) const
inline
208  { // report an out_of_range error
209  _Xout_of_range("invalid array<T, N> subscript");
210  }
_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
127  { // subscript mutable sequence with checking
128  if (_Size <= _Pos)
129  _Xran();
130  return (_Elems[_Pos]);
131  }
void _Xran() const
Definition: array:207
_Ty _Elems[_Size]
Definition: array:212
_Size
Definition: vcruntime_string.h:36
template<class _Ty, size_t _Size>
constexpr const_reference array< _Ty, _Size >::at ( size_type  _Pos) const
inline
134  { // subscript nonmutable sequence with checking
135  return (_Size <= _Pos
136  ? (_Xran(), _Elems[_Pos])
137  : _Elems[_Pos]);
138  }
void _Xran() const
Definition: array:207
_Ty _Elems[_Size]
Definition: array:212
_Size
Definition: vcruntime_string.h:36
template<class _Ty, size_t _Size>
reference array< _Ty, _Size >::back ( )
inline
188  { // return last element of mutable sequence
189  return (_Elems[_Size - 1]);
190  }
_Ty _Elems[_Size]
Definition: array:212
_Size
Definition: vcruntime_string.h:36
template<class _Ty, size_t _Size>
constexpr const_reference array< _Ty, _Size >::back ( ) const
inline
193  { // return last element of nonmutable sequence
194  return (_Elems[_Size - 1]);
195  }
_Ty _Elems[_Size]
Definition: array:212
_Size
Definition: vcruntime_string.h:36
template<class _Ty, size_t _Size>
iterator array< _Ty, _Size >::begin ( )
inline
52  { // return iterator for beginning of mutable sequence
53  return (iterator(_STD addressof(_Elems[0]), 0));
54  }
constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:723
_Ty _Elems[_Size]
Definition: array:212
_Array_iterator< _Ty, _Size > iterator
Definition: array:33
template<class _Ty, size_t _Size>
const_iterator array< _Ty, _Size >::begin ( ) const
inline
57  { // return iterator for beginning of nonmutable sequence
58  return (const_iterator(_STD addressof(_Elems[0]), 0));
59  }
_Array_const_iterator< _Ty, _Size > const_iterator
Definition: array:34
constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:723
_Ty _Elems[_Size]
Definition: array:212
template<class _Ty, size_t _Size>
const_iterator array< _Ty, _Size >::cbegin ( ) const
inline
92  { // return iterator for beginning of nonmutable sequence
93  return (begin());
94  }
iterator begin() _NOEXCEPT
Definition: array:51
template<class _Ty, size_t _Size>
const_iterator array< _Ty, _Size >::cend ( ) const
inline
97  { // return iterator for end of nonmutable sequence
98  return (end());
99  }
iterator end() _NOEXCEPT
Definition: array:61
template<class _Ty, size_t _Size>
const_reverse_iterator array< _Ty, _Size >::crbegin ( ) const
inline
102  { // return iterator for beginning of reversed nonmutable sequence
103  return (rbegin());
104  }
reverse_iterator rbegin() _NOEXCEPT
Definition: array:71
template<class _Ty, size_t _Size>
const_reverse_iterator array< _Ty, _Size >::crend ( ) const
inline
107  { // return iterator for end of reversed nonmutable sequence
108  return (rend());
109  }
reverse_iterator rend() _NOEXCEPT
Definition: array:81
template<class _Ty, size_t _Size>
_Ty* array< _Ty, _Size >::data ( )
inline
198  { // return pointer to mutable data array
199  return (_Elems);
200  }
_Ty _Elems[_Size]
Definition: array:212
template<class _Ty, size_t _Size>
const _Ty* array< _Ty, _Size >::data ( ) const
inline
203  { // return pointer to nonmutable data array
204  return (_Elems);
205  }
_Ty _Elems[_Size]
Definition: array:212
template<class _Ty, size_t _Size>
constexpr bool array< _Ty, _Size >::empty ( ) const
inline
122  { // test if sequence is empty
123  return (false);
124  }
template<class _Ty, size_t _Size>
iterator array< _Ty, _Size >::end ( )
inline
62  { // return iterator for end of mutable sequence
63  return (iterator(_STD addressof(_Elems[0]), _Size));
64  }
constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:723
_Ty _Elems[_Size]
Definition: array:212
_Array_iterator< _Ty, _Size > iterator
Definition: array:33
_Size
Definition: vcruntime_string.h:36
template<class _Ty, size_t _Size>
const_iterator array< _Ty, _Size >::end ( ) const
inline
67  { // return iterator for beginning of nonmutable sequence
68  return (const_iterator(_STD addressof(_Elems[0]), _Size));
69  }
_Array_const_iterator< _Ty, _Size > const_iterator
Definition: array:34
constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:723
_Ty _Elems[_Size]
Definition: array:212
_Size
Definition: vcruntime_string.h:36
template<class _Ty, size_t _Size>
void array< _Ty, _Size >::fill ( const _Ty &  _Value)
inline
47  { // assign value to all elements
49  }
_OutIt _Fill_n_unchecked(_OutIt _Dest, _Diff _Count, const _Ty &_Val)
Definition: xutility:2819
_Ty _Elems[_Size]
Definition: array:212
_In_ int _Value
Definition: setjmp.h:173
_Size
Definition: vcruntime_string.h:36
template<class _Ty, size_t _Size>
reference array< _Ty, _Size >::front ( )
inline
178  { // return first element of mutable sequence
179  return (_Elems[0]);
180  }
_Ty _Elems[_Size]
Definition: array:212
template<class _Ty, size_t _Size>
constexpr const_reference array< _Ty, _Size >::front ( ) const
inline
183  { // return first element of nonmutable sequence
184  return (_Elems[0]);
185  }
_Ty _Elems[_Size]
Definition: array:212
template<class _Ty, size_t _Size>
constexpr size_type array< _Ty, _Size >::max_size ( ) const
inline
117  { // return maximum possible length of sequence
118  return (_Size);
119  }
_Size
Definition: vcruntime_string.h:36
template<class _Ty, size_t _Size>
reference array< _Ty, _Size >::operator[] ( size_type  _Pos)
inline
141  { // subscript mutable sequence
142  #if _ITERATOR_DEBUG_LEVEL == 2
143  if (_Size <= _Pos)
144  _DEBUG_ERROR("array subscript out of range");
145 
146  #elif _ITERATOR_DEBUG_LEVEL == 1
148  #endif /* _ITERATOR_DEBUG_LEVEL */
149 
150  _Analysis_assume_(_Pos < _Size);
151 
152  return (_Elems[_Pos]);
153  }
#define _Analysis_assume_(expr)
Definition: sal.h:2896
_Ty _Elems[_Size]
Definition: array:212
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:392
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_Size
Definition: vcruntime_string.h:36
template<class _Ty, size_t _Size>
constexpr const_reference array< _Ty, _Size >::operator[] ( size_type  _Pos) const
inline
166  { // subscript nonmutable sequence
167  #if _ITERATOR_DEBUG_LEVEL == 0
168  return (_Elems[_Pos]);
169 
170  #else /* _ITERATOR_DEBUG_LEVEL == 0 */
171  return (_Size <= _Pos
172  ? (_Bad_subscript(), _Elems[_Pos])
173  : _Elems[_Pos]);
174  #endif /* _ITERATOR_DEBUG_LEVEL == 0 */
175  }
static void _Bad_subscript()
Definition: array:155
_Ty _Elems[_Size]
Definition: array:212
_Size
Definition: vcruntime_string.h:36
template<class _Ty, size_t _Size>
reverse_iterator array< _Ty, _Size >::rbegin ( )
inline
72  { // return iterator for beginning of reversed mutable sequence
73  return (reverse_iterator(end()));
74  }
_STD reverse_iterator< iterator > reverse_iterator
Definition: array:36
iterator end() _NOEXCEPT
Definition: array:61
template<class _Ty, size_t _Size>
const_reverse_iterator array< _Ty, _Size >::rbegin ( ) const
inline
77  { // return iterator for beginning of reversed nonmutable sequence
78  return (const_reverse_iterator(end()));
79  }
iterator end() _NOEXCEPT
Definition: array:61
_STD reverse_iterator< const_iterator > const_reverse_iterator
Definition: array:37
template<class _Ty, size_t _Size>
reverse_iterator array< _Ty, _Size >::rend ( )
inline
82  { // return iterator for end of reversed mutable sequence
83  return (reverse_iterator(begin()));
84  }
_STD reverse_iterator< iterator > reverse_iterator
Definition: array:36
iterator begin() _NOEXCEPT
Definition: array:51
template<class _Ty, size_t _Size>
const_reverse_iterator array< _Ty, _Size >::rend ( ) const
inline
87  { // return iterator for end of reversed nonmutable sequence
88  return (const_reverse_iterator(begin()));
89  }
iterator begin() _NOEXCEPT
Definition: array:51
_STD reverse_iterator< const_iterator > const_reverse_iterator
Definition: array:37
template<class _Ty, size_t _Size>
constexpr size_type array< _Ty, _Size >::size ( ) const
inline
112  { // return length of sequence
113  return (_Size);
114  }
_Size
Definition: vcruntime_string.h:36
template<class _Ty, size_t _Size>
void array< _Ty, _Size >::swap ( _Myt _Other)
inline
216  { // swap contents with _Other
218  _STD addressof(_Elems[0]) + _Size,
219  _STD addressof(_Other._Elems[0]));
220  }
constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:723
_FwdIt2 _Swap_ranges_unchecked(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _Dest)
Definition: algorithm:853
_Ty _Elems[_Size]
Definition: array:212
_Size
Definition: vcruntime_string.h:36

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: