tmp/tmpq6_ac10p/{from.md → to.md}
RENAMED
|
@@ -40,12 +40,12 @@ namespace std {
|
|
| 40 |
typedef size_t size_type;
|
| 41 |
typedef ptrdiff_t difference_type;
|
| 42 |
typedef T value_type;
|
| 43 |
typedef T* pointer;
|
| 44 |
typedef const T* const_pointer;
|
| 45 |
-
typedef reverse_iterator<iterator>
|
| 46 |
-
typedef reverse_iterator<const_iterator>
|
| 47 |
|
| 48 |
T elems[N]; // exposition only
|
| 49 |
|
| 50 |
// no explicit construct/copy/destroy for aggregate type
|
| 51 |
|
|
@@ -67,23 +67,23 @@ namespace std {
|
|
| 67 |
const_iterator cend() const noexcept;
|
| 68 |
const_reverse_iterator crbegin() const noexcept;
|
| 69 |
const_reverse_iterator crend() const noexcept;
|
| 70 |
|
| 71 |
// capacity:
|
| 72 |
-
constexpr size_type size() noexcept;
|
| 73 |
-
constexpr size_type max_size() noexcept;
|
| 74 |
-
constexpr bool empty() noexcept;
|
| 75 |
|
| 76 |
// element access:
|
| 77 |
reference operator[](size_type n);
|
| 78 |
-
const_reference operator[](size_type n) const;
|
| 79 |
-
const_reference at(size_type n) const;
|
| 80 |
reference at(size_type n);
|
|
|
|
| 81 |
reference front();
|
| 82 |
-
const_reference front() const;
|
| 83 |
reference back();
|
| 84 |
-
const_reference back() const;
|
| 85 |
|
| 86 |
T * data() noexcept;
|
| 87 |
const T * data() const noexcept;
|
| 88 |
};
|
| 89 |
}
|
|
@@ -114,16 +114,16 @@ template <class T, size_t N> void swap(array<T,N>& x, array<T,N>& y) noexcept(no
|
|
| 114 |
|
| 115 |
``` cpp
|
| 116 |
x.swap(y);
|
| 117 |
```
|
| 118 |
|
| 119 |
-
*Complexity:*
|
| 120 |
|
| 121 |
#### `array::size` <a id="array.size">[[array.size]]</a>
|
| 122 |
|
| 123 |
``` cpp
|
| 124 |
-
template <class T, size_t N> constexpr size_type array<T,N>::size() noexcept;
|
| 125 |
```
|
| 126 |
|
| 127 |
*Returns:* `N`
|
| 128 |
|
| 129 |
#### `array::data` <a id="array.data">[[array.data]]</a>
|
|
@@ -152,11 +152,11 @@ void swap(array& y) noexcept(noexcept(swap(declval<T&>(), declval<T&>())));
|
|
| 152 |
*Effects:* `swap_ranges(begin(), end(), y.begin())`
|
| 153 |
|
| 154 |
*Throws:* Nothing unless one of the element-wise swap calls throws an
|
| 155 |
exception.
|
| 156 |
|
| 157 |
-
*Note:* Unlike the `swap` function for other containers, array::swap
|
| 158 |
takes linear time, may exit via an exception, and does not cause
|
| 159 |
iterators to become associated with the other container.
|
| 160 |
|
| 161 |
#### Zero sized arrays <a id="array.zero">[[array.zero]]</a>
|
| 162 |
|
|
@@ -172,42 +172,43 @@ Member function `swap()` shall have a *noexcept-specification* which is
|
|
| 172 |
equivalent to `noexcept(true)`.
|
| 173 |
|
| 174 |
#### Tuple interface to class template `array` <a id="array.tuple">[[array.tuple]]</a>
|
| 175 |
|
| 176 |
``` cpp
|
| 177 |
-
|
|
|
|
|
|
|
| 178 |
```
|
| 179 |
|
| 180 |
-
*Return type:* integral constant expression.
|
| 181 |
-
|
| 182 |
-
*Value:* `N`
|
| 183 |
-
|
| 184 |
``` cpp
|
| 185 |
tuple_element<I, array<T, N> >::type
|
| 186 |
```
|
| 187 |
|
| 188 |
*Requires:* `I < N`. The program is ill-formed if `I` is out of bounds.
|
| 189 |
|
| 190 |
*Value:* The type T.
|
| 191 |
|
| 192 |
``` cpp
|
| 193 |
-
template <size_t I, class T, size_t N>
|
|
|
|
| 194 |
```
|
| 195 |
|
| 196 |
*Requires:* `I < N`. The program is ill-formed if `I` is out of bounds.
|
| 197 |
|
| 198 |
*Returns:* A reference to the `I`th element of `a`, where indexing is
|
| 199 |
zero-based.
|
| 200 |
|
| 201 |
``` cpp
|
| 202 |
-
template <size_t I, class T, size_t N>
|
|
|
|
| 203 |
```
|
| 204 |
|
| 205 |
*Effects:* Equivalent to `return std::move(get<I>(a));`
|
| 206 |
|
| 207 |
``` cpp
|
| 208 |
-
template <size_t I, class T, size_t N>
|
|
|
|
| 209 |
```
|
| 210 |
|
| 211 |
*Requires:* `I < N`. The program is ill-formed if `I` is out of bounds.
|
| 212 |
|
| 213 |
*Returns:* A const reference to the `I`th element of `a`, where indexing
|
|
|
|
| 40 |
typedef size_t size_type;
|
| 41 |
typedef ptrdiff_t difference_type;
|
| 42 |
typedef T value_type;
|
| 43 |
typedef T* pointer;
|
| 44 |
typedef const T* const_pointer;
|
| 45 |
+
typedef std::reverse_iterator<iterator> reverse_iterator;
|
| 46 |
+
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
| 47 |
|
| 48 |
T elems[N]; // exposition only
|
| 49 |
|
| 50 |
// no explicit construct/copy/destroy for aggregate type
|
| 51 |
|
|
|
|
| 67 |
const_iterator cend() const noexcept;
|
| 68 |
const_reverse_iterator crbegin() const noexcept;
|
| 69 |
const_reverse_iterator crend() const noexcept;
|
| 70 |
|
| 71 |
// capacity:
|
| 72 |
+
constexpr size_type size() const noexcept;
|
| 73 |
+
constexpr size_type max_size() const noexcept;
|
| 74 |
+
constexpr bool empty() const noexcept;
|
| 75 |
|
| 76 |
// element access:
|
| 77 |
reference operator[](size_type n);
|
| 78 |
+
constexpr const_reference operator[](size_type n) const;
|
|
|
|
| 79 |
reference at(size_type n);
|
| 80 |
+
constexpr const_reference at(size_type n) const;
|
| 81 |
reference front();
|
| 82 |
+
constexpr const_reference front() const;
|
| 83 |
reference back();
|
| 84 |
+
constexpr const_reference back() const;
|
| 85 |
|
| 86 |
T * data() noexcept;
|
| 87 |
const T * data() const noexcept;
|
| 88 |
};
|
| 89 |
}
|
|
|
|
| 114 |
|
| 115 |
``` cpp
|
| 116 |
x.swap(y);
|
| 117 |
```
|
| 118 |
|
| 119 |
+
*Complexity:* Linear in `N`.
|
| 120 |
|
| 121 |
#### `array::size` <a id="array.size">[[array.size]]</a>
|
| 122 |
|
| 123 |
``` cpp
|
| 124 |
+
template <class T, size_t N> constexpr size_type array<T,N>::size() const noexcept;
|
| 125 |
```
|
| 126 |
|
| 127 |
*Returns:* `N`
|
| 128 |
|
| 129 |
#### `array::data` <a id="array.data">[[array.data]]</a>
|
|
|
|
| 152 |
*Effects:* `swap_ranges(begin(), end(), y.begin())`
|
| 153 |
|
| 154 |
*Throws:* Nothing unless one of the element-wise swap calls throws an
|
| 155 |
exception.
|
| 156 |
|
| 157 |
+
*Note:* Unlike the `swap` function for other containers, `array::swap`
|
| 158 |
takes linear time, may exit via an exception, and does not cause
|
| 159 |
iterators to become associated with the other container.
|
| 160 |
|
| 161 |
#### Zero sized arrays <a id="array.zero">[[array.zero]]</a>
|
| 162 |
|
|
|
|
| 172 |
equivalent to `noexcept(true)`.
|
| 173 |
|
| 174 |
#### Tuple interface to class template `array` <a id="array.tuple">[[array.tuple]]</a>
|
| 175 |
|
| 176 |
``` cpp
|
| 177 |
+
template <class T, size_t N>
|
| 178 |
+
struct tuple_size<array<T, N>>
|
| 179 |
+
: integral_constant<size_t, N> { };
|
| 180 |
```
|
| 181 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
``` cpp
|
| 183 |
tuple_element<I, array<T, N> >::type
|
| 184 |
```
|
| 185 |
|
| 186 |
*Requires:* `I < N`. The program is ill-formed if `I` is out of bounds.
|
| 187 |
|
| 188 |
*Value:* The type T.
|
| 189 |
|
| 190 |
``` cpp
|
| 191 |
+
template <size_t I, class T, size_t N>
|
| 192 |
+
constexpr T& get(array<T, N>& a) noexcept;
|
| 193 |
```
|
| 194 |
|
| 195 |
*Requires:* `I < N`. The program is ill-formed if `I` is out of bounds.
|
| 196 |
|
| 197 |
*Returns:* A reference to the `I`th element of `a`, where indexing is
|
| 198 |
zero-based.
|
| 199 |
|
| 200 |
``` cpp
|
| 201 |
+
template <size_t I, class T, size_t N>
|
| 202 |
+
constexpr T&& get(array<T, N>&& a) noexcept;
|
| 203 |
```
|
| 204 |
|
| 205 |
*Effects:* Equivalent to `return std::move(get<I>(a));`
|
| 206 |
|
| 207 |
``` cpp
|
| 208 |
+
template <size_t I, class T, size_t N>
|
| 209 |
+
constexpr const T& get(const array<T, N>& a) noexcept;
|
| 210 |
```
|
| 211 |
|
| 212 |
*Requires:* `I < N`. The program is ill-formed if `I` is out of bounds.
|
| 213 |
|
| 214 |
*Returns:* A const reference to the `I`th element of `a`, where indexing
|