-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Conversation
include/fmt/ranges.h
Outdated
@@ -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)> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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::
.
test/ranges-test.cc
Outdated
// Tuple-like. | ||
auto t5 = tuple_like{42, "foo"}; | ||
EXPECT_EQ(fmt::format("{}", t5), "(42, \"foo\")"); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
.
Signed-off-by: Vladislav Shchapov <[email protected]>
Thanks! |
Fix for #4226