@@ -111,62 +111,56 @@ struct __already_constant_case {};
111111template <class _Range >
112112 requires constant_range<all_t <_Range>>
113113struct __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))) {
117116 return views::all (std::forward<_Range>(__range));
118117 }
119118};
120119
121120template <class _Range , class _UType = std::remove_cvref_t <_Range>>
122121struct __empty_view_case {};
123122template <class _Range , class _XType >
124- requires (!__case<__already_constant_case<_Range>>)
123+ requires (!__case<__already_constant_case<_Range>>)
125124struct __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>)) {
129127 return auto (views::empty<const _XType>);
130128 }
131129};
132130
133131template <class _Range , class _UType = std::remove_cvref_t <_Range>>
134132struct __span_case {};
135133template <class _Range , class _XType , size_t _Extent>
136- requires (!__case<__already_constant_case<_Range>>)
134+ requires (!__case<__already_constant_case<_Range>>)
137135struct __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))) {
141138 return span<const _XType, _Extent>(std::forward<_Range>(__range));
142139 }
143140};
144141
145142template <class _Range , class _UType = std::remove_cvref_t <_Range>>
146143struct __ref_view_case {};
147144template <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>
149146struct __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 ()));
154151 }
155152};
156153
157154template <class _Range , class _UType = std::remove_cvref_t <_Range>>
158155struct __constant_range_case {};
159156template <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>)
167161struct __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)))))
170164 -> decltype (ref_view (static_cast <const _UType&>(std::forward<_Range>(__range)))) {
171165 return ref_view (static_cast <const _UType&>(std::forward<_Range>(__range)));
172166 }
@@ -175,65 +169,56 @@ struct __constant_range_case<_Range, _UType> {
175169template <class _Range >
176170struct __otherwise_case {};
177171template <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>>)
183175struct __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))) {
187178 return as_const_view (std::forward<_Range>(__range));
188179 }
189180};
190181
191182struct __fn : __range_adaptor_closure<__fn> {
192183 // [range.as.const.overview]: the basic `constant_range` case
193184 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)) {
197187 return __already_constant_case<_Range>::__impl (__range);
198188 }
199189
200190 // [range.as.const.overview]: the `empty_view` case
201191 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)) {
205194 return __empty_view_case<_Range>::__impl (__range);
206195 }
207196
208197 // [range.as.const.overview]: the `span` case
209198 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)) {
213201 return __span_case<_Range>::__impl (__range);
214202 }
215203
216204 // [range.as.const.overview]: the `ref_view` case
217205 template <class _Range >
218206 [[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)) {
221208 return __ref_view_case<_Range>::__impl (__range);
222209 }
223210
224211 // [range.as.const.overview]: the second `constant_range` case
225212 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)) {
229215 return __constant_range_case<_Range>::__impl (__range);
230216 }
231217
232218 // [range.as.const.overview]: otherwise
233219 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)) {
237222 return __otherwise_case<_Range>::__impl (__range);
238223 }
239224};
0 commit comments