From e39490500c414646d3987c23cad80e877c0acc16 Mon Sep 17 00:00:00 2001 From: vitaut Date: Wed, 17 Jun 2015 07:59:41 -0700 Subject: [PATCH] Replace implicit conversion to std::string with to_string --- format.h | 2 +- test/format-test.cc | 2 +- test/printf-test.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/format.h b/format.h index 51d77767..21e163e1 100644 --- a/format.h +++ b/format.h @@ -257,7 +257,7 @@ class BasicStringRef { Converts a string reference to an ``std::string`` object. \endrst */ - operator std::basic_string() const { + std::basic_string to_string() const { return std::basic_string(data_, size()); } diff --git a/test/format-test.cc b/test/format-test.cc index 9bee0200..f86cd290 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -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); } diff --git a/test/printf-test.cc b/test/printf-test.cc index f174577c..ec29bbe1 100644 --- a/test/printf-test.cc +++ b/test/printf-test.cc @@ -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; }