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

make format_int constexpr? #4031

Closed
dixlorenz opened this issue Jun 21, 2024 · 2 comments
Closed

make format_int constexpr? #4031

dixlorenz opened this issue Jun 21, 2024 · 2 comments

Comments

@dixlorenz
Copy link
Contributor

I was looking at format_int and it seems to me that all the functions that it calls are constexpr in c++20. I tried simply prefixing everything in format_int with constexpr, now this compiles:

static_assert(fmt::format_int(DLCL::to_integral(42)).str() == "42");

Is there a reason format_int is not constexpr?

@vitaut
Copy link
Contributor

vitaut commented Jun 21, 2024

The only reason is that nobody was interested in making it constexpr yet. A PR would be welcome.

@dixlorenz
Copy link
Contributor Author

PR is up, I tried to match the code style as closely as I could see.

@vitaut vitaut closed this as completed Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants