Replace implicit conversion to std::string with to_string

This commit is contained in:
vitaut 2015-06-17 07:59:41 -07:00
parent 147e5ebbbc
commit e39490500c
3 changed files with 3 additions and 3 deletions

View File

@ -257,7 +257,7 @@ class BasicStringRef {
Converts a string reference to an ``std::string`` object.
\endrst
*/
operator std::basic_string<Char>() const {
std::basic_string<Char> to_string() const {
return std::basic_string<Char>(data_, size());
}

View File

@ -1450,7 +1450,7 @@ TEST(StringRefTest, Ctor) {
}
TEST(StringRefTest, ConvertToString) {
std::string s = StringRef("abc");
std::string s = StringRef("abc").to_string();
EXPECT_EQ("abc", s);
}

View File

@ -40,7 +40,7 @@ const unsigned BIG_NUM = INT_MAX + 1u;
// Makes format string argument positional.
std::string make_positional(fmt::StringRef format) {
std::string s(format);
std::string s(format.to_string());
s.replace(s.find('%'), 1, "%1$");
return s;
}