Applied clang-format (possibly correctly)

This commit is contained in:
Barry Revzin 2021-10-16 11:52:31 -05:00
parent c0984ebc45
commit 562719df5f
2 changed files with 19 additions and 13 deletions

View File

@ -270,7 +270,10 @@ struct cpp20_only_range {
iterator() = default; iterator() = default;
iterator(int i) : val(i) {} iterator(int i) : val(i) {}
int operator*() const { return val; } int operator*() const { return val; }
iterator& operator++() { ++val; return *this; } iterator& operator++() {
++val;
return *this;
}
void operator++(int) { ++*this; } void operator++(int) { ++*this; }
bool operator==(const iterator& rhs) const { return val == rhs.val; } bool operator==(const iterator& rhs) const { return val == rhs.val; }
}; };
@ -311,8 +314,11 @@ TEST(ranges_test, join_range) {
EXPECT_EQ(fmt::format("{}", fmt::join(z, ",")), "0,0,0"); EXPECT_EQ(fmt::format("{}", fmt::join(z, ",")), "0,0,0");
# ifdef __cpp_lib_ranges # ifdef __cpp_lib_ranges
EXPECT_EQ(fmt::format("{}", cpp20_only_range{.lo=0, .hi=5}), "[0, 1, 2, 3, 4]"); EXPECT_EQ(fmt::format("{}", cpp20_only_range{.lo = 0, .hi = 5}),
EXPECT_EQ(fmt::format("{}", fmt::join(cpp20_only_range{.lo=0, .hi=5}, ",")), "0,1,2,3,4"); "[0, 1, 2, 3, 4]");
EXPECT_EQ(
fmt::format("{}", fmt::join(cpp20_only_range{.lo = 0, .hi = 5}, ",")),
"0,1,2,3,4");
# endif # endif
} }
#endif // FMT_RANGES_TEST_ENABLE_JOIN #endif // FMT_RANGES_TEST_ENABLE_JOIN