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

Specialize formatter for all std::basic_string types #3943

Merged
merged 2 commits into from
Apr 23, 2024

Conversation

dieram3
Copy link
Contributor

@dieram3 dieram3 commented Apr 22, 2024

This fixes #3938 by adding a formatter partial specialization that covers all std::basic_string types, such as std::pmr::string.

Additionally, this adds the old-school allocator member types to mock_allocator in order to make GCC 4.8 happy. If GCC 4.8 support is removed in the future, these member types can be removed as they are the defaults of allocator_traits.

@dieram3 dieram3 marked this pull request as ready for review April 22, 2024 07:07
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!

@vitaut vitaut merged commit cf1f55f into fmtlib:master Apr 23, 2024
41 checks passed
@dieram3 dieram3 deleted the fix_pmr_string_formatting branch April 24, 2024 05:52
Arghnews pushed a commit to Arghnews/fmt that referenced this pull request May 1, 2024
* Specialize `formatter` for all `std::basic_string` types

* mock-allocator: add member types to make GCC 4.8 happy
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.

Formatting for strings with custom allocators fails to compile
2 participants