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

Improve std::complex formatter to be compatible with P2197R0 #3900

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

phprus
Copy link
Contributor

@phprus phprus commented Mar 19, 2024

P2197R0: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2197r0.html

Effects: Equivalent to:

 format_to(ctx.out(), "{:<fill-align-width>}",
           format(c.real() != 0 ? "({0}+{1}i)" : "{1}i", real, imag))

include/fmt/std.h Outdated Show resolved Hide resolved
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.

Just one nit, otherwise LGTM.

@phprus phprus requested a review from vitaut March 20, 2024 12:29
@vitaut vitaut merged commit 45b772f into fmtlib:master Mar 20, 2024
41 checks passed
@vitaut
Copy link
Contributor

vitaut commented Mar 20, 2024

Merged, thanks!

happymonkey1 pushed a commit to happymonkey1/fmt that referenced this pull request Apr 7, 2024
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