mirror of
https://github.com/fmtlib/fmt.git
synced 2025-10-18 08:45:29 +02:00
Ability to join elements of std::initializer_list was added
This commit is contained in:
committed by
Victor Zverovich
parent
ff486a72a7
commit
85050aa2e6
@@ -70,6 +70,12 @@ TEST(RangesTest, JoinTuple) {
|
||||
EXPECT_EQ("4.0", fmt::format("{}", fmt::join(t4, "/")));
|
||||
}
|
||||
|
||||
TEST(RangesTest, JoinInitializerList) {
|
||||
EXPECT_EQ("1, 2, 3", fmt::format("{}", fmt::join({1, 2, 3}, ", ")));
|
||||
EXPECT_EQ("fmt rocks !",
|
||||
fmt::format("{}", fmt::join({"fmt", "rocks", "!"}, " ")));
|
||||
}
|
||||
|
||||
struct my_struct {
|
||||
int32_t i;
|
||||
std::string str; // can throw
|
||||
|
Reference in New Issue
Block a user