Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<ranges>: Fix formatting ranges for ADL-only ranges #5178

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions stl/inc/format
Original file line number Diff line number Diff line change
Expand Up @@ -3267,8 +3267,11 @@ void _Range_formatter_format_as_sequence(const formatter<_Ty, _CharT>& _Underlyi
const basic_string_view<_CharT> _Separator, const basic_string_view<_CharT> _Opening_bracket,
const basic_string_view<_CharT> _Closing_bracket, _Range&& _Rng, _FormatContext& _Ctx) {
_Ctx.advance_to(_STD _Fmt_write(_Ctx.out(), _Opening_bracket));
bool _Separate = false;
for (auto&& _Elem : _Rng) {
bool _Separate = false;
auto _Iter = _RANGES begin(_Rng);
const auto _Sent = _RANGES end(_Rng);
for (; _Iter != _Sent; ++_Iter) {
auto&& _Elem = *_Iter;
hewillk marked this conversation as resolved.
Show resolved Hide resolved
if (_Separate) {
_Ctx.advance_to(_STD _Fmt_write(_Ctx.out(), _Separator));
}
Expand Down
Loading