Skip to content

Commit

Permalink
<ranges>: Avoid infinite recursion in ranges::to (#4142)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpplearner authored Nov 10, 2023
1 parent 1e46514 commit 5045784
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stl/inc/ranges
Original file line number Diff line number Diff line change
Expand Up @@ -10387,7 +10387,7 @@ namespace ranges {
}
_RANGES copy(_Range, _Container_inserter<range_reference_t<_Rng>>(_Cont));
return _Cont;
} else if constexpr (input_range<range_reference_t<_Rng>>) {
} else if constexpr (!_Ref_converts<_Rng, _Container> && input_range<range_reference_t<_Rng>>) {
const auto _Xform = [](auto&& _Elem) {
return _RANGES to<range_value_t<_Container>>(_STD forward<decltype(_Elem)>(_Elem));
};
Expand Down

0 comments on commit 5045784

Please sign in to comment.