@@ -111,62 +111,56 @@ struct __already_constant_case {};
111
111
template <class _Range >
112
112
requires constant_range<all_t <_Range>>
113
113
struct __already_constant_case <_Range> {
114
- _LIBCPP_HIDE_FROM_ABI static constexpr auto __impl (_Range& __range)
115
- noexcept (noexcept (views::all(std::forward<_Range>(__range))))
116
- -> decltype(views::all(std::forward<_Range>(__range))) {
114
+ _LIBCPP_HIDE_FROM_ABI static constexpr auto __impl (_Range& __range) noexcept (
115
+ noexcept (views::all(std::forward<_Range>(__range)))) -> decltype(views::all(std::forward<_Range>(__range))) {
117
116
return views::all (std::forward<_Range>(__range));
118
117
}
119
118
};
120
119
121
120
template <class _Range , class _UType = std::remove_cvref_t <_Range>>
122
121
struct __empty_view_case {};
123
122
template <class _Range , class _XType >
124
- requires (!__case<__already_constant_case<_Range>>)
123
+ requires (!__case<__already_constant_case<_Range>>)
125
124
struct __empty_view_case<_Range, empty_view<_XType>> {
126
- _LIBCPP_HIDE_FROM_ABI static constexpr auto __impl (_Range&)
127
- noexcept (noexcept (auto (views::empty<const _XType>)))
128
- -> decltype(auto (views::empty<const _XType>)) {
125
+ _LIBCPP_HIDE_FROM_ABI static constexpr auto
126
+ __impl (_Range&) noexcept (noexcept (auto (views::empty<const _XType>))) -> decltype (auto (views::empty<const _XType>)) {
129
127
return auto (views::empty<const _XType>);
130
128
}
131
129
};
132
130
133
131
template <class _Range , class _UType = std::remove_cvref_t <_Range>>
134
132
struct __span_case {};
135
133
template <class _Range , class _XType , size_t _Extent>
136
- requires (!__case<__already_constant_case<_Range>>)
134
+ requires (!__case<__already_constant_case<_Range>>)
137
135
struct __span_case<_Range, span<_XType, _Extent>> {
138
- _LIBCPP_HIDE_FROM_ABI static constexpr auto __impl (_Range& __range)
139
- noexcept (noexcept (span<const _XType, _Extent>(std::forward<_Range>(__range))))
140
- -> decltype(span<const _XType, _Extent>(std::forward<_Range>(__range))) {
136
+ _LIBCPP_HIDE_FROM_ABI static constexpr auto __impl (_Range& __range) noexcept (noexcept (span<const _XType, _Extent>(
137
+ std::forward<_Range>(__range)))) -> decltype (span<const _XType, _Extent>(std::forward<_Range>(__range))) {
141
138
return span<const _XType, _Extent>(std::forward<_Range>(__range));
142
139
}
143
140
};
144
141
145
142
template <class _Range , class _UType = std::remove_cvref_t <_Range>>
146
143
struct __ref_view_case {};
147
144
template <class _Range , class _XType >
148
- requires (!__case<__already_constant_case<_Range>>) && constant_range<const _XType>
145
+ requires (!__case<__already_constant_case<_Range>>) && constant_range<const _XType>
149
146
struct __ref_view_case<_Range, ref_view<_XType>> {
150
- _LIBCPP_HIDE_FROM_ABI static constexpr auto __impl (_Range& __range)
151
- noexcept (noexcept (ref_view(static_cast <const _XType&>(std::forward<_Range>(__range).base()))))
152
- -> decltype(ref_view(static_cast <const _XType&>(std::forward<_Range>(__range).base()))) {
153
- return ref_view (static_cast <const _XType&>(std::forward<_Range>(__range).base ()));
147
+ _LIBCPP_HIDE_FROM_ABI static constexpr auto
148
+ __impl (_Range& __range) noexcept (noexcept (ref_view (static_cast <const _XType&>(std::forward<_Range>(__range).base ()))))
149
+ -> decltype (ref_view (static_cast <const _XType&>(std::forward<_Range>(__range).base ()))) {
150
+ return ref_view (static_cast <const _XType&>(std::forward<_Range>(__range).base ()));
154
151
}
155
152
};
156
153
157
154
template <class _Range , class _UType = std::remove_cvref_t <_Range>>
158
155
struct __constant_range_case {};
159
156
template <class _Range , class _UType >
160
- requires (!__case<__already_constant_case<_Range>>)
161
- && (!__case<__empty_view_case<_Range>>)
162
- && (!__case<__span_case<_Range>>)
163
- && (!__case<__ref_view_case<_Range>>)
164
- && is_lvalue_reference_v<_Range>
165
- && constant_range<const _UType>
166
- && (!view<_UType>)
157
+ requires (!__case<__already_constant_case<_Range>>) && (!__case<__empty_view_case<_Range>>) &&
158
+ (!__case<__span_case<_Range>>) &&
159
+ (!__case<__ref_view_case<_Range>>) && is_lvalue_reference_v<_Range> && constant_range<const _UType> &&
160
+ (!view<_UType>)
167
161
struct __constant_range_case<_Range, _UType> {
168
- _LIBCPP_HIDE_FROM_ABI static constexpr auto __impl (_Range& __range)
169
- noexcept (noexcept (ref_view(static_cast <const _UType&>(std::forward<_Range>(__range)))))
162
+ _LIBCPP_HIDE_FROM_ABI static constexpr auto
163
+ __impl (_Range& __range) noexcept (noexcept (ref_view (static_cast <const _UType&>(std::forward<_Range>(__range)))))
170
164
-> decltype (ref_view (static_cast <const _UType&>(std::forward<_Range>(__range)))) {
171
165
return ref_view (static_cast <const _UType&>(std::forward<_Range>(__range)));
172
166
}
@@ -175,65 +169,56 @@ struct __constant_range_case<_Range, _UType> {
175
169
template <class _Range >
176
170
struct __otherwise_case {};
177
171
template <class _Range >
178
- requires (!__case<__already_constant_case<_Range>>)
179
- && (!__case<__empty_view_case<_Range>>)
180
- && (!__case<__span_case<_Range>>)
181
- && (!__case<__ref_view_case<_Range>>)
182
- && (!__case<__constant_range_case<_Range>>)
172
+ requires (!__case<__already_constant_case<_Range>>) && (!__case<__empty_view_case<_Range>>) &&
173
+ (!__case<__span_case<_Range>>) && (!__case<__ref_view_case<_Range>>) &&
174
+ (!__case<__constant_range_case<_Range>>)
183
175
struct __otherwise_case<_Range> {
184
- _LIBCPP_HIDE_FROM_ABI static constexpr auto __impl (_Range& __range)
185
- noexcept (noexcept (as_const_view(std::forward<_Range>(__range))))
186
- -> decltype(as_const_view(std::forward<_Range>(__range))) {
176
+ _LIBCPP_HIDE_FROM_ABI static constexpr auto __impl (_Range& __range) noexcept (noexcept (
177
+ as_const_view (std::forward<_Range>(__range)))) -> decltype (as_const_view (std::forward<_Range>(__range))) {
187
178
return as_const_view (std::forward<_Range>(__range));
188
179
}
189
180
};
190
181
191
182
struct __fn : __range_adaptor_closure<__fn> {
192
183
// [range.as.const.overview]: the basic `constant_range` case
193
184
template <class _Range >
194
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto
195
- operator ()(_Range&& __range) noexcept (noexcept (__already_constant_case<_Range>::__impl(__range)))
196
- -> decltype (__already_constant_case<_Range>::__impl(__range)) {
185
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator ()(_Range&& __range) noexcept (noexcept (
186
+ __already_constant_case<_Range>::__impl(__range))) -> decltype(__already_constant_case<_Range>::__impl(__range)) {
197
187
return __already_constant_case<_Range>::__impl (__range);
198
188
}
199
189
200
190
// [range.as.const.overview]: the `empty_view` case
201
191
template <class _Range >
202
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto
203
- operator ()(_Range&& __range) noexcept (noexcept (__empty_view_case<_Range>::__impl(__range)))
204
- -> decltype(__empty_view_case<_Range>::__impl(__range)) {
192
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator ()(_Range&& __range) noexcept (
193
+ noexcept (__empty_view_case<_Range>::__impl(__range))) -> decltype(__empty_view_case<_Range>::__impl(__range)) {
205
194
return __empty_view_case<_Range>::__impl (__range);
206
195
}
207
196
208
197
// [range.as.const.overview]: the `span` case
209
198
template <class _Range >
210
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto
211
- operator ()(_Range&& __range) noexcept (noexcept (__span_case<_Range>::__impl(__range)))
212
- -> decltype(__span_case<_Range>::__impl(__range)) {
199
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator ()(_Range&& __range) noexcept (
200
+ noexcept (__span_case<_Range>::__impl(__range))) -> decltype(__span_case<_Range>::__impl(__range)) {
213
201
return __span_case<_Range>::__impl (__range);
214
202
}
215
203
216
204
// [range.as.const.overview]: the `ref_view` case
217
205
template <class _Range >
218
206
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator ()(_Range&& __range) noexcept (
219
- noexcept (__ref_view_case<_Range>::__impl(__range)))
220
- -> decltype(__ref_view_case<_Range>::__impl(__range)) {
207
+ noexcept (__ref_view_case<_Range>::__impl(__range))) -> decltype(__ref_view_case<_Range>::__impl(__range)) {
221
208
return __ref_view_case<_Range>::__impl (__range);
222
209
}
223
210
224
211
// [range.as.const.overview]: the second `constant_range` case
225
212
template <class _Range >
226
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator ()(_Range&& __range) noexcept (
227
- noexcept (__constant_range_case<_Range>::__impl(__range)))
228
- -> decltype(__constant_range_case<_Range>::__impl(__range)) {
213
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator ()(_Range&& __range) noexcept (noexcept (
214
+ __constant_range_case<_Range>::__impl(__range))) -> decltype(__constant_range_case<_Range>::__impl(__range)) {
229
215
return __constant_range_case<_Range>::__impl (__range);
230
216
}
231
217
232
218
// [range.as.const.overview]: otherwise
233
219
template <class _Range >
234
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator ()(_Range&& __range)
235
- noexcept (noexcept (__otherwise_case<_Range>::__impl(__range)))
236
- -> decltype(__otherwise_case<_Range>::__impl(__range)) {
220
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator ()(_Range&& __range) noexcept (
221
+ noexcept (__otherwise_case<_Range>::__impl(__range))) -> decltype(__otherwise_case<_Range>::__impl(__range)) {
237
222
return __otherwise_case<_Range>::__impl (__range);
238
223
}
239
224
};
0 commit comments