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

enum  { _EEN_SIZE = _Size }
 
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 assign (const _Ty &_Value)
 
void fill (const _Ty &_Value)
 
void swap (_Myt &_Other) _NOEXCEPT_OP(_NOEXCEPT_OP(_Swap_adl(_Elems[0]
 
void _Elems[0] _Swap_ranges (_STD addressof(_Elems[0]), _STD addressof(_Elems[0])+_Size, _STD addressof(_Other._Elems[0]))
 
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
 
size_type size () const _NOEXCEPT
 
size_type max_size () const _NOEXCEPT
 
bool empty () const _NOEXCEPT
 
reference at (size_type _Pos)
 
const_reference at (size_type _Pos) const
 
reference operator[] (size_type _Pos)
 
const_reference operator[] (size_type _Pos) const
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
_Ty * data () _NOEXCEPT
 
const _Ty * data () const _NOEXCEPT
 
 __declspec (noreturn) void _Xran() const
 

Public Attributes

_Ty _Elems [_Size==0?1:_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 Enumeration Documentation

template<class _Ty, size_t _Size>
anonymous enum
Enumerator
_EEN_SIZE 
22 {_EEN_SIZE = _Size}; // helper for expression evaluator
Definition: array:22
_Check_return_ _In_ long _Size
Definition: io.h:325

Member Function Documentation

template<class _Ty, size_t _Size>
array< _Ty, _Size >::__declspec ( noreturn  ) const
inline
206  { // report an out_of_range error
207  _Xout_of_range("invalid array<T, N> subscript");
208  }
template<class _Ty, size_t _Size>
void _Elems [0] array< _Ty, _Size >::_Swap_ranges ( _STD   addressof_Elems[0],
_STD addressof(_Elems[0])+  _Size,
_STD   addressof_Other._Elems[0] 
)
template<class _Ty, size_t _Size>
void array< _Ty, _Size >::assign ( const _Ty &  _Value)
inline
39  { // assign value to all elements
41  }
_CRTIMP _In_ int _Value
Definition: setjmp.h:190
_Ty _Elems[_Size==0?1:_Size]
Definition: array:210
_OutIt _Fill_n(_OutIt _Dest, _Diff _Count, const _Ty &_Val)
Definition: xutility:2630
_Check_return_ _In_ long _Size
Definition: io.h:325
template<class _Ty, size_t _Size>
reference array< _Ty, _Size >::at ( size_type  _Pos)
inline
132  { // subscript mutable sequence with checking
133  if (_Size <= _Pos)
134  _Xran();
135  return (_Elems[_Pos]);
136  }
_Ty _Elems[_Size==0?1:_Size]
Definition: array:210
_Check_return_ _In_ long _Size
Definition: io.h:325
template<class _Ty, size_t _Size>
const_reference array< _Ty, _Size >::at ( size_type  _Pos) const
inline
139  { // subscript nonmutable sequence with checking
140  if (_Size <= _Pos)
141  _Xran();
142  return (_Elems[_Pos]);
143  }
_Ty _Elems[_Size==0?1:_Size]
Definition: array:210
_Check_return_ _In_ long _Size
Definition: io.h:325
template<class _Ty, size_t _Size>
reference array< _Ty, _Size >::back ( )
inline
186  { // return last element of mutable sequence
187  return (_Elems[_Size - 1]);
188  }
_Ty _Elems[_Size==0?1:_Size]
Definition: array:210
_Check_return_ _In_ long _Size
Definition: io.h:325
template<class _Ty, size_t _Size>
const_reference array< _Ty, _Size >::back ( ) const
inline
191  { // return last element of nonmutable sequence
192  return (_Elems[_Size - 1]);
193  }
_Ty _Elems[_Size==0?1:_Size]
Definition: array:210
_Check_return_ _In_ long _Size
Definition: io.h:325
template<class _Ty, size_t _Size>
iterator array< _Ty, _Size >::begin ( )
inline
57  { // return iterator for beginning of mutable sequence
58  return (iterator(_STD addressof(_Elems[0]), 0));
59  }
_Ty _Elems[_Size==0?1:_Size]
Definition: array:210
_Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:91
_Array_iterator< _Ty, _Size > iterator
Definition: array:32
template<class _Ty, size_t _Size>
const_iterator array< _Ty, _Size >::begin ( ) const
inline
62  { // return iterator for beginning of nonmutable sequence
63  return (const_iterator(_STD addressof(_Elems[0]), 0));
64  }
_Array_const_iterator< _Ty, _Size > const_iterator
Definition: array:33
_Ty _Elems[_Size==0?1:_Size]
Definition: array:210
_Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:91
template<class _Ty, size_t _Size>
const_iterator array< _Ty, _Size >::cbegin ( ) const
inline
97  { // return iterator for beginning of nonmutable sequence
98  return (((const _Myt *)this)->begin());
99  }
iterator begin() _NOEXCEPT
Definition: array:56
array< _Ty, _Size > _Myt
Definition: array:23
template<class _Ty, size_t _Size>
const_iterator array< _Ty, _Size >::cend ( ) const
inline
102  { // return iterator for end of nonmutable sequence
103  return (((const _Myt *)this)->end());
104  }
iterator end() _NOEXCEPT
Definition: array:66
array< _Ty, _Size > _Myt
Definition: array:23
template<class _Ty, size_t _Size>
const_reverse_iterator array< _Ty, _Size >::crbegin ( ) const
inline
107  { // return iterator for beginning of reversed nonmutable sequence
108  return (((const _Myt *)this)->rbegin());
109  }
reverse_iterator rbegin() _NOEXCEPT
Definition: array:76
array< _Ty, _Size > _Myt
Definition: array:23
template<class _Ty, size_t _Size>
const_reverse_iterator array< _Ty, _Size >::crend ( ) const
inline
112  { // return iterator for end of reversed nonmutable sequence
113  return (((const _Myt *)this)->rend());
114  }
array< _Ty, _Size > _Myt
Definition: array:23
reverse_iterator rend() _NOEXCEPT
Definition: array:86
template<class _Ty, size_t _Size>
_Ty* array< _Ty, _Size >::data ( )
inline
196  { // return pointer to mutable data array
197  return (_Elems);
198  }
_Ty _Elems[_Size==0?1:_Size]
Definition: array:210
template<class _Ty, size_t _Size>
const _Ty* array< _Ty, _Size >::data ( ) const
inline
201  { // return pointer to nonmutable data array
202  return (_Elems);
203  }
_Ty _Elems[_Size==0?1:_Size]
Definition: array:210
template<class _Ty, size_t _Size>
bool array< _Ty, _Size >::empty ( ) const
inline
127  { // test if sequence is empty
128  return (_Size == 0);
129  }
_Check_return_ _In_ long _Size
Definition: io.h:325
template<class _Ty, size_t _Size>
iterator array< _Ty, _Size >::end ( )
inline
67  { // return iterator for end of mutable sequence
68  return (iterator(_STD addressof(_Elems[0]), _Size));
69  }
_Ty _Elems[_Size==0?1:_Size]
Definition: array:210
_Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:91
_Array_iterator< _Ty, _Size > iterator
Definition: array:32
_Check_return_ _In_ long _Size
Definition: io.h:325
template<class _Ty, size_t _Size>
const_iterator array< _Ty, _Size >::end ( ) const
inline
72  { // return iterator for beginning of nonmutable sequence
73  return (const_iterator(_STD addressof(_Elems[0]), _Size));
74  }
_Array_const_iterator< _Ty, _Size > const_iterator
Definition: array:33
_Ty _Elems[_Size==0?1:_Size]
Definition: array:210
_Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:91
_Check_return_ _In_ long _Size
Definition: io.h:325
template<class _Ty, size_t _Size>
void array< _Ty, _Size >::fill ( const _Ty &  _Value)
inline
44  { // assign value to all elements
46  }
_CRTIMP _In_ int _Value
Definition: setjmp.h:190
_Ty _Elems[_Size==0?1:_Size]
Definition: array:210
_OutIt _Fill_n(_OutIt _Dest, _Diff _Count, const _Ty &_Val)
Definition: xutility:2630
_Check_return_ _In_ long _Size
Definition: io.h:325
template<class _Ty, size_t _Size>
reference array< _Ty, _Size >::front ( )
inline
176  { // return first element of mutable sequence
177  return (_Elems[0]);
178  }
_Ty _Elems[_Size==0?1:_Size]
Definition: array:210
template<class _Ty, size_t _Size>
const_reference array< _Ty, _Size >::front ( ) const
inline
181  { // return first element of nonmutable sequence
182  return (_Elems[0]);
183  }
_Ty _Elems[_Size==0?1:_Size]
Definition: array:210
template<class _Ty, size_t _Size>
size_type array< _Ty, _Size >::max_size ( ) const
inline
122  { // return maximum possible length of sequence
123  return (_Size);
124  }
_Check_return_ _In_ long _Size
Definition: io.h:325
template<class _Ty, size_t _Size>
reference array< _Ty, _Size >::operator[] ( size_type  _Pos)
inline
146  { // subscript mutable sequence
147  #if _ITERATOR_DEBUG_LEVEL == 2
148  if (_Size <= _Pos)
149  _DEBUG_ERROR("array subscript out of range");
150 
151  #elif _ITERATOR_DEBUG_LEVEL == 1
153  #endif /* _ITERATOR_DEBUG_LEVEL */
154 
155  _Analysis_assume_(_Pos < _Size);
156 
157  return (_Elems[_Pos]);
158  }
_Ty _Elems[_Size==0?1:_Size]
Definition: array:210
#define _Analysis_assume_(expr)
Definition: sal.h:2916
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:347
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_Check_return_ _In_ long _Size
Definition: io.h:325
template<class _Ty, size_t _Size>
const_reference array< _Ty, _Size >::operator[] ( size_type  _Pos) const
inline
161  { // subscript nonmutable sequence
162  #if _ITERATOR_DEBUG_LEVEL == 2
163  if (_Size <= _Pos)
164  _DEBUG_ERROR("array subscript out of range");
165 
166  #elif _ITERATOR_DEBUG_LEVEL == 1
168  #endif /* _ITERATOR_DEBUG_LEVEL */
169 
170  _Analysis_assume_(_Pos < _Size);
171 
172  return (_Elems[_Pos]);
173  }
_Ty _Elems[_Size==0?1:_Size]
Definition: array:210
#define _Analysis_assume_(expr)
Definition: sal.h:2916
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:347
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_Check_return_ _In_ long _Size
Definition: io.h:325
template<class _Ty, size_t _Size>
reverse_iterator array< _Ty, _Size >::rbegin ( )
inline
77  { // return iterator for beginning of reversed mutable sequence
78  return (reverse_iterator(end()));
79  }
_STD reverse_iterator< iterator > reverse_iterator
Definition: array:35
iterator end() _NOEXCEPT
Definition: array:66
template<class _Ty, size_t _Size>
const_reverse_iterator array< _Ty, _Size >::rbegin ( ) const
inline
82  { // return iterator for beginning of reversed nonmutable sequence
83  return (const_reverse_iterator(end()));
84  }
iterator end() _NOEXCEPT
Definition: array:66
_STD reverse_iterator< const_iterator > const_reverse_iterator
Definition: array:36
template<class _Ty, size_t _Size>
reverse_iterator array< _Ty, _Size >::rend ( )
inline
87  { // return iterator for end of reversed mutable sequence
88  return (reverse_iterator(begin()));
89  }
_STD reverse_iterator< iterator > reverse_iterator
Definition: array:35
iterator begin() _NOEXCEPT
Definition: array:56
template<class _Ty, size_t _Size>
const_reverse_iterator array< _Ty, _Size >::rend ( ) const
inline
92  { // return iterator for end of reversed nonmutable sequence
93  return (const_reverse_iterator(begin()));
94  }
iterator begin() _NOEXCEPT
Definition: array:56
_STD reverse_iterator< const_iterator > const_reverse_iterator
Definition: array:36
template<class _Ty, size_t _Size>
size_type array< _Ty, _Size >::size ( ) const
inline
117  { // return length of sequence
118  return (_Size);
119  }
_Check_return_ _In_ long _Size
Definition: io.h:325
template<class _Ty, size_t _Size>
void array< _Ty, _Size >::swap ( _Myt _Other)

Member Data Documentation

template<class _Ty, size_t _Size>
_Ty array< _Ty, _Size >::_Elems[_Size==0?1:_Size]

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