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

Fix formatting of ranges with lvalue-qualified, non-const begin() and end() #3800

Merged
merged 1 commit into from
Jan 10, 2024

Commits on Jan 10, 2024

  1. Fix formatting of ranges with begin()&/end()&

    C++20 allows ranges to have lvalue-qualified begin() and end() member functions. fmt correctly handles this if begin() and end() are additionally const-qualifed (i.e. begin() const&), but not in the non-const case. For example:
    
    https://godbolt.org/z/YfxaYz5r7
    
    This patch fixes fmt's range detection to handle this case by testing calls to detail::ranges_begin()/end() with an lvalue T&, matching the behaviour in the const case.
    tcbrindle committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    fb7eaf7 View commit details
    Browse the repository at this point in the history