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

Fixing formatting of certain kinds of ranges of ranges. #2787

Merged
merged 2 commits into from
Mar 5, 2022

Conversation

brevzin
Copy link
Contributor

@brevzin brevzin commented Feb 22, 2022

If you had a range of R, where R is a const-iterable range, then the formatter would expect its argument to be passed as a const R& but the implementation would end up passing an R& instead (the fmt_ref_view case fails to compile on master).

But we don't need to deduce the range and check that it has the right const-ness, we can just declare it to have the expected type instead. If that type is const R&, then that just works.

Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

include/fmt/ranges.h Outdated Show resolved Hide resolved
@vitaut
Copy link
Contributor

vitaut commented Mar 3, 2022

Please rebase, I've fixed the apt install issue.

@brevzin
Copy link
Contributor Author

brevzin commented Mar 4, 2022

Please rebase, I've fixed the apt install issue.

Done 👍

@vitaut vitaut merged commit 0cef1f8 into fmtlib:master Mar 5, 2022
@vitaut
Copy link
Contributor

vitaut commented Mar 5, 2022

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants