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

Implement fmt::join for tuple-like objects #4230

Merged
merged 1 commit into from
Nov 9, 2024
Merged

Conversation

phprus
Copy link
Contributor

@phprus phprus commented Nov 7, 2024

Fix for #4226

@@ -696,18 +696,18 @@ auto join(It begin, Sentinel end, string_view sep) -> join_view<It, Sentinel> {
* fmt::print("{:02}", fmt::join(v, ", "));
* // Output: 01, 02, 03
*/
template <typename Range>
template <typename Range, FMT_ENABLE_IF(!fmt::is_tuple_like<Range>::value)>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why qualify this with fmt::? I don't think ADL applies here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right.
Removed fmt::.

Comment on lines 426 to 428
// Tuple-like.
auto t5 = tuple_like{42, "foo"};
EXPECT_EQ(fmt::format("{}", t5), "(42, \"foo\")");
Copy link
Contributor

Choose a reason for hiding this comment

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

This test case looks identical to one of the above:

  auto t = tuple_like{42, "foo"};
  EXPECT_EQ(fmt::format("{}", t), "(42, \"foo\")");

Did you mean to use join here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I lost fmt::join.

@vitaut vitaut merged commit 5a3576a into fmtlib:master Nov 9, 2024
45 checks passed
@vitaut
Copy link
Contributor

vitaut commented Nov 9, 2024

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.

2 participants