Skip to content

Conversation

@CaseyCarter
Copy link
Contributor

@CaseyCarter CaseyCarter commented Apr 20, 2021

... which makes <format> handle void* in the same manner as const void*. (Previously void* was treated as a "custom type" by the format argument machinery.)

Drive-by: swap order of parameters for concept _Has_formatter so we can use it as a type-constraint. Don't use return-type deduction for overloads of _Get_format_arg_storage_type that always return the same type.

Note that I haven't annotated this as implementing an unmerged LWG issue. The resolution hasn't been at all controversial in LWG, so I feel safe just making the change without annotation; reviewers may feel differently.

Drive-by: swap order of parameters for concept `_Has_formatter` so we can use it as a type-constraint. Don't use return-type deduction for overloads of `_Get_format_arg_storage_type` that always return the same type.
@CaseyCarter CaseyCarter added LWG Library Working Group issue format C++20/23 format labels Apr 20, 2021
@CaseyCarter CaseyCarter requested a review from a team as a code owner April 20, 2021 17:42
Copy link
Contributor

@miscco miscco left a comment

Choose a reason for hiding this comment

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

Looks great

@eldakesh-ms
Copy link
Contributor

Do we lose test coverage where void* was used to stimulate a custom formatter?

@CaseyCarter
Copy link
Contributor Author

Do we lose test coverage where void* was used to stimulate a custom formatter?

I certainly hope we have no such fragile test coverage. grep tells me that void\s*\* occurs only in formatting_args and formatting_formatting, and none of those occurrences looks to me like it intends to test custom formatting.

@StephanTLavavej StephanTLavavej self-assigned this Apr 21, 2021
@StephanTLavavej StephanTLavavej merged commit 1363e7d into microsoft:main Apr 22, 2021
@StephanTLavavej
Copy link
Member

Thanks for implementing this issue's resolution faster than the Standard could accept it! 😹 🚀 🚀 🚀

@cpplearner cpplearner mentioned this pull request Jun 8, 2021
36 tasks
@CaseyCarter CaseyCarter deleted the lwg3540 branch August 21, 2024 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

format C++20/23 format LWG Library Working Group issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants