29 #ifndef _GLIBCXX_ARRAY
30 #define _GLIBCXX_ARRAY 1
32 #pragma GCC system_header
34 #ifndef __GXX_EXPERIMENTAL_CXX0X__
41 namespace std _GLIBCXX_VISIBILITY(default)
43 _GLIBCXX_BEGIN_NAMESPACE_VERSION
59 template<
typename _Tp, std::
size_t _Nm>
62 typedef _Tp value_type;
64 typedef const _Tp* const_pointer;
65 typedef value_type& reference;
66 typedef const value_type& const_reference;
67 typedef value_type* iterator;
68 typedef const value_type* const_iterator;
69 typedef std::size_t size_type;
70 typedef std::ptrdiff_t difference_type;
75 value_type _M_instance[_Nm ? _Nm : 1];
81 fill(
const value_type& __u)
91 {
return iterator(std::__addressof(_M_instance[0])); }
95 {
return const_iterator(std::__addressof(_M_instance[0])); }
99 {
return iterator(std::__addressof(_M_instance[_Nm])); }
103 {
return const_iterator(std::__addressof(_M_instance[_Nm])); }
123 {
return const_iterator(std::__addressof(_M_instance[0])); }
127 {
return const_iterator(std::__addressof(_M_instance[_Nm])); }
139 size()
const {
return _Nm; }
142 max_size()
const {
return _Nm; }
145 empty()
const {
return size() == 0; }
149 operator[](size_type __n)
150 {
return _M_instance[__n]; }
153 operator[](size_type __n)
const
154 {
return _M_instance[__n]; }
160 std::__throw_out_of_range(__N(
"array::at"));
161 return _M_instance[__n];
165 at(size_type __n)
const
168 std::__throw_out_of_range(__N(
"array::at"));
169 return _M_instance[__n];
182 {
return _Nm ? *(end() - 1) : *end(); }
186 {
return _Nm ? *(end() - 1) : *end(); }
190 {
return std::__addressof(_M_instance[0]); }
194 {
return std::__addressof(_M_instance[0]); }
198 template<
typename _Tp, std::
size_t _Nm>
201 {
return std::equal(__one.begin(), __one.end(), __two.begin()); }
203 template<
typename _Tp, std::
size_t _Nm>
205 operator!=(
const array<_Tp, _Nm>& __one,
const array<_Tp, _Nm>& __two)
206 {
return !(__one == __two); }
208 template<
typename _Tp, std::
size_t _Nm>
210 operator<(const array<_Tp, _Nm>& __a,
const array<_Tp, _Nm>& __b)
213 __b.begin(), __b.end());
216 template<
typename _Tp, std::
size_t _Nm>
218 operator>(
const array<_Tp, _Nm>& __one,
const array<_Tp, _Nm>& __two)
219 {
return __two < __one; }
221 template<
typename _Tp, std::
size_t _Nm>
223 operator<=(const array<_Tp, _Nm>& __one,
const array<_Tp, _Nm>& __two)
224 {
return !(__one > __two); }
226 template<
typename _Tp, std::
size_t _Nm>
228 operator>=(
const array<_Tp, _Nm>& __one,
const array<_Tp, _Nm>& __two)
229 {
return !(__one < __two); }
232 template<
typename _Tp, std::
size_t _Nm>
234 swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
235 { __one.swap(__two); }
240 template<
typename _Tp>
244 template<std::
size_t _Int,
typename _Tp>
247 template<
typename _Tp, std::
size_t _Nm>
249 {
static const std::size_t value = _Nm; };
251 template<
typename _Tp, std::
size_t _Nm>
255 template<std::
size_t _Int,
typename _Tp, std::
size_t _Nm>
257 {
typedef _Tp type; };
259 template<std::
size_t _Int,
typename _Tp, std::
size_t _Nm>
261 get(array<_Tp, _Nm>& __arr)
262 {
return __arr[_Int]; }
264 template<std::
size_t _Int,
typename _Tp, std::
size_t _Nm>
266 get(
const array<_Tp, _Nm>& __arr)
267 {
return __arr[_Int]; }
269 _GLIBCXX_END_NAMESPACE_VERSION
272 #endif // __GXX_EXPERIMENTAL_CXX0X__
274 #endif // _GLIBCXX_ARRAY
_ForwardIterator2 swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2)
Swap the elements of two sequences.
bool equal(_II1 __first1, _II1 __last1, _II2 __first2)
Tests a range for element-wise equality.
bool lexicographical_compare(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2, _Compare __comp)
Performs dictionary comparison on ranges.
_OI fill_n(_OI __first, _Size __n, const _Tp &__value)
Fills the range [first,first+n) with copies of value.
A standard container for storing a fixed size sequence of elements.