Skip to content

Implement proposed resolution of LWG-3540 - #1867

Merged
Stephan T. Lavavej (StephanTLavavej) merged 1 commit into
microsoft:mainfrom
CaseyCarter:lwg3540
Apr 22, 2021
Merged

Stephan T. Lavavej (StephanTLavavej) merged 1 commit into
microsoft:mainfrom
CaseyCarter:lwg3540

Conversation

@CaseyCarter

@CaseyCarter Casey Carter (CaseyCarter) commented Apr 20, 2021 •

Copy link
Copy Markdown
Contributor

... which makes 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 Casey Carter (CaseyCarter) added LWG Library Working Group issue format C++20/23 format labels Apr 20, 2021
@CaseyCarter
Casey Carter (CaseyCarter) requested a review from a team as a code owner April 20, 2021 17:42

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

@CaseyCarter

Copy link
Copy Markdown
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

Copy link
Copy Markdown
Member

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

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