KEMBAR78
Properly constrain `detail::copy` optimization by localspook · Pull Request #4474 · fmtlib/fmt · GitHub
Skip to content

Conversation

@localspook
Copy link
Contributor

Resolves #4470.

See linked issue for a description of the problem. This PR constrains detail::copy to only use insert when the underlying container provides it.

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. I suggest merging has_back_insert_iterator_container_append and has_back_insert_iterator_container_insert_at_end into a single trait, something like has_compatible_container that checks the required container properties.

@localspook
Copy link
Contributor Author

Could you elaborate? We have one copy overload that does .append(), one that does .insert(), and one that uses the iterator normally, and I don't see how I could express all of those with just one trait.

@vitaut
Copy link
Contributor

vitaut commented Jun 20, 2025

Ah, you are right. We do need separate traits.

@vitaut vitaut merged commit 1ef8348 into fmtlib:master Jun 21, 2025
45 checks passed
@vitaut
Copy link
Contributor

vitaut commented Jun 21, 2025

Merged, thanks.

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.

Bustache does not compile anymore with v11

2 participants