From Jason Turner

[array]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp3zmry6al/{from.md → to.md} +13 -14
tmp/tmp3zmry6al/{from.md → to.md} RENAMED
@@ -18,12 +18,12 @@ object is not empty if `N` > 0. An `array` meets some of the
18
  requirements of a sequence container [[sequence.reqmts]]. Descriptions
19
  are provided here only for operations on `array` that are not described
20
  in one of these tables and for operations where there is additional
21
  semantic information.
22
 
23
- `array<T, N>` is a structural type [[temp.param]] if `T` is a structural
24
- type. Two values `a1` and `a2` of type `array<T, N>` are
25
  template-argument-equivalent [[temp.type]] if and only if each pair of
26
  corresponding elements in `a1` and `a2` are
27
  template-argument-equivalent.
28
 
29
  The types `iterator` and `const_iterator` meet the constexpr iterator
@@ -66,19 +66,19 @@ namespace std {
66
  constexpr const_iterator cend() const noexcept;
67
  constexpr const_reverse_iterator crbegin() const noexcept;
68
  constexpr const_reverse_iterator crend() const noexcept;
69
 
70
  // capacity
71
- [[nodiscard]] constexpr bool empty() const noexcept;
72
  constexpr size_type size() const noexcept;
73
  constexpr size_type max_size() const noexcept;
74
 
75
  // element access
76
  constexpr reference operator[](size_type n);
77
  constexpr const_reference operator[](size_type n) const;
78
- constexpr reference at(size_type n);
79
- constexpr const_reference at(size_type n) const;
80
  constexpr reference front();
81
  constexpr const_reference front() const;
82
  constexpr reference back();
83
  constexpr const_reference back() const;
84
 
@@ -91,17 +91,16 @@ namespace std {
91
  }
92
  ```
93
 
94
  #### Constructors, copy, and assignment <a id="array.cons">[[array.cons]]</a>
95
 
96
- The conditions for an aggregate [[dcl.init.aggr]] shall be met. Class
97
- `array` relies on the implicitly-declared special member functions
98
  [[class.default.ctor]], [[class.dtor]], [[class.copy.ctor]] to conform
99
  to the container requirements table in  [[container.requirements]]. In
100
  addition to the requirements specified in the container requirements
101
- table, the implicit move constructor and move assignment operator for
102
- `array` require that `T` be *Cpp17MoveConstructible* or
103
  *Cpp17MoveAssignable*, respectively.
104
 
105
  ``` cpp
106
  template<class T, class... U>
107
  array(T, U...) -> array<T, 1 + sizeof...(U)>;
@@ -121,11 +120,11 @@ constexpr size_type size() const noexcept;
121
  constexpr T* data() noexcept;
122
  constexpr const T* data() const noexcept;
123
  ```
124
 
125
  *Returns:* A pointer such that \[`data()`, `data() + size()`) is a valid
126
- range. For a non-empty array, `data()` `==` `addressof(front())`.
127
 
128
  ``` cpp
129
  constexpr void fill(const T& u);
130
  ```
131
 
@@ -173,24 +172,24 @@ specification.
173
  ``` cpp
174
  template<class T, size_t N>
175
  constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);
176
  ```
177
 
178
- *Mandates:* `is_array_v<T>` is `false` and `is_constructible_v<T, T&>`
179
- is `true`.
180
 
181
  *Preconditions:* `T` meets the *Cpp17CopyConstructible* requirements.
182
 
183
  *Returns:* `{{ a[0], `…`, a[N - 1] }}`.
184
 
185
  ``` cpp
186
  template<class T, size_t N>
187
  constexpr array<remove_cv_t<T>, N> to_array(T (&&a)[N]);
188
  ```
189
 
190
- *Mandates:* `is_array_v<T>` is `false` and `is_move_constructible_v<T>`
191
- is `true`.
192
 
193
  *Preconditions:* `T` meets the *Cpp17MoveConstructible* requirements.
194
 
195
  *Returns:* `{{ std::move(a[0]), `…`, std::move(a[N - 1]) }}`.
196
 
 
18
  requirements of a sequence container [[sequence.reqmts]]. Descriptions
19
  are provided here only for operations on `array` that are not described
20
  in one of these tables and for operations where there is additional
21
  semantic information.
22
 
23
+ `array<T, N>` is a structural type [[term.structural.type]] if `T` is a
24
+ structural type. Two values `a1` and `a2` of type `array<T, N>` are
25
  template-argument-equivalent [[temp.type]] if and only if each pair of
26
  corresponding elements in `a1` and `a2` are
27
  template-argument-equivalent.
28
 
29
  The types `iterator` and `const_iterator` meet the constexpr iterator
 
66
  constexpr const_iterator cend() const noexcept;
67
  constexpr const_reverse_iterator crbegin() const noexcept;
68
  constexpr const_reverse_iterator crend() const noexcept;
69
 
70
  // capacity
71
+ constexpr bool empty() const noexcept;
72
  constexpr size_type size() const noexcept;
73
  constexpr size_type max_size() const noexcept;
74
 
75
  // element access
76
  constexpr reference operator[](size_type n);
77
  constexpr const_reference operator[](size_type n) const;
78
+ constexpr reference at(size_type n); // freestanding-deleted
79
+ constexpr const_reference at(size_type n) const; // freestanding-deleted
80
  constexpr reference front();
81
  constexpr const_reference front() const;
82
  constexpr reference back();
83
  constexpr const_reference back() const;
84
 
 
91
  }
92
  ```
93
 
94
  #### Constructors, copy, and assignment <a id="array.cons">[[array.cons]]</a>
95
 
96
+ An `array` relies on the implicitly-declared special member functions
 
97
  [[class.default.ctor]], [[class.dtor]], [[class.copy.ctor]] to conform
98
  to the container requirements table in  [[container.requirements]]. In
99
  addition to the requirements specified in the container requirements
100
+ table, the implicitly-declared move constructor and move assignment
101
+ operator for `array` require that `T` be *Cpp17MoveConstructible* or
102
  *Cpp17MoveAssignable*, respectively.
103
 
104
  ``` cpp
105
  template<class T, class... U>
106
  array(T, U...) -> array<T, 1 + sizeof...(U)>;
 
120
  constexpr T* data() noexcept;
121
  constexpr const T* data() const noexcept;
122
  ```
123
 
124
  *Returns:* A pointer such that \[`data()`, `data() + size()`) is a valid
125
+ range. For a non-empty array, `data() == addressof(front())` is `true`.
126
 
127
  ``` cpp
128
  constexpr void fill(const T& u);
129
  ```
130
 
 
172
  ``` cpp
173
  template<class T, size_t N>
174
  constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);
175
  ```
176
 
177
+ *Mandates:* `is_array_v<T>` is `false` and
178
+ `is_constructible_v<remove_cv_t<T>, T&>` is `true`.
179
 
180
  *Preconditions:* `T` meets the *Cpp17CopyConstructible* requirements.
181
 
182
  *Returns:* `{{ a[0], `…`, a[N - 1] }}`.
183
 
184
  ``` cpp
185
  template<class T, size_t N>
186
  constexpr array<remove_cv_t<T>, N> to_array(T (&&a)[N]);
187
  ```
188
 
189
+ *Mandates:* `is_array_v<T>` is `false` and
190
+ `is_constructible_v<remove_cv_t<T>, T>` is `true`.
191
 
192
  *Preconditions:* `T` meets the *Cpp17MoveConstructible* requirements.
193
 
194
  *Returns:* `{{ std::move(a[0]), `…`, std::move(a[N - 1]) }}`.
195