Make format work with C++17 std::string_view (#571)
This commit is contained in:
@@ -137,11 +137,6 @@ TEST(StringViewTest, Ctor) {
|
||||
EXPECT_EQ(4u, string_view(std::string("defg")).size());
|
||||
}
|
||||
|
||||
TEST(StringViewTest, ConvertToString) {
|
||||
std::string s = string_view("abc").to_string();
|
||||
EXPECT_EQ("abc", s);
|
||||
}
|
||||
|
||||
TEST(WriterTest, NotCopyConstructible) {
|
||||
EXPECT_FALSE(std::is_copy_constructible<fmt::writer>::value);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ const unsigned BIG_NUM = INT_MAX + 1u;
|
||||
|
||||
// Makes format string argument positional.
|
||||
std::string make_positional(fmt::string_view format) {
|
||||
std::string s(format.to_string());
|
||||
std::string s(format.data(), format.size());
|
||||
s.replace(s.find('%'), 1, "%1$");
|
||||
return s;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user