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

Added formattable concept #3974

Merged
merged 1 commit into from
May 26, 2024
Merged

Added formattable concept #3974

merged 1 commit into from
May 26, 2024

Conversation

matt77hias
Copy link
Contributor

No description provided.

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. It looks good but please address the inline comment.

include/fmt/base.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.

Could you also add a test case to base-test?

@matt77hias
Copy link
Contributor Author

matt77hias commented May 25, 2024

I used static_asserts without a message (C++17) for the concept (C++20) tests.
Is there a reason why is_formattable does not have some checks for the usual suspects that are formattable?

I am not familiar with the CI test setup, but do we already have C++20 coverage?

@phprus
Copy link
Contributor

phprus commented May 26, 2024

@vitaut, Maybe makes sense to reintroduced tests for g++-11 and C++20 into CI?
CI currently does not have tests for g++ and C++20.

It was removed in this commit:

0b5287f#diff-21364b2e6fae1f2875cee1ab3daefb0685403687eaf8bc32b5c6eacda351c9d3

@vitaut vitaut merged commit 1752d7f into fmtlib:master May 26, 2024
40 checks passed
@vitaut
Copy link
Contributor

vitaut commented May 26, 2024

Is there a reason why is_formattable does not have some checks for the usual suspects that are formattable?

I don't think the tests need to be exhaustive. It's enough to cover important categories of formattable types. We don't need to test every type that has a user-defined formatter.

I am not familiar with the CI test setup, but do we already have C++20 coverage?

We do.

Maybe makes sense to reintroduced tests for g++-11 and C++20 into CI?

I removed g++-11 because its installation was broken but a PR to reintroduce it (or another version that supports C++20) would be welcome.

@matt77hias
Copy link
Contributor Author

matt77hias commented May 26, 2024

I don't think the tests need to be exhaustive. It's enough to cover important categories of formattable types. We don't need to test every type that has a user-defined formatter.

I agree, but I would have expected some static_assert(is_formattable<...) alongside all these static_assert(!is_formattable<...).

@matt77hias matt77hias deleted the concepts branch May 26, 2024 15:08
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.

4 participants