@@ -5408,7 +5408,7 @@ namespace ranges {
5408
5408
5409
5409
class _As_const_fn : public _Pipe::_Base<_As_const_fn> {
5410
5410
private:
5411
- enum class _St { _None, _All, _Reconstruct_span, _Reconstruct_ref, _Ref, _As_const };
5411
+ enum class _St { _None, _All, _Empty, _Reconstruct_span, _Reconstruct_ref, _Ref, _As_const };
5412
5412
5413
5413
template <class>
5414
5414
static constexpr bool _Can_reconstruct_ref_view_v = false;
@@ -5423,6 +5423,8 @@ namespace ranges {
5423
5423
5424
5424
if constexpr (constant_range<views::all_t<_Rng>>) {
5425
5425
return {_St::_All, noexcept(views::all(_STD declval<_Rng>()))};
5426
+ } else if constexpr (_Is_specialization_v<_Ty, empty_view>) {
5427
+ return {_St::_Empty, true};
5426
5428
} else if constexpr (_Is_span_v<_Ty>) {
5427
5429
return {_St::_Reconstruct_span, true};
5428
5430
} else if constexpr (_Can_reconstruct_ref_view_v<_Ty>) {
@@ -5448,6 +5450,8 @@ namespace ranges {
5448
5450
5449
5451
if constexpr (_Strat == _St::_All) {
5450
5452
return views::all(_STD forward<_Rng>(_Range));
5453
+ } else if constexpr (_Strat == _St::_Empty) {
5454
+ return empty_view<const remove_reference_t<range_reference_t<_Rng>>>{};
5451
5455
} else if constexpr (_Strat == _St::_Reconstruct_span) {
5452
5456
return span<const typename _Ty::element_type, _Ty::extent>{_STD forward<_Rng>(_Range)};
5453
5457
} else if constexpr (_Strat == _St::_Reconstruct_ref) {
0 commit comments