about summary refs log tree commit diff
path: root/absl/strings/substitute.h
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2019-03-06T19·36-0800
committerDerek Mauro <dmauro@google.com>2019-03-06T19·49-0500
commitfebc5ee6a92d0eb7dac1fceaa6c648cf6521b4dc (patch)
treefcca391395791680a80a559f7efd9c47da6ff305 /absl/strings/substitute.h
parent9fdf5e5b805412cb2a2e624d3e9a11588120465f (diff)
Export of internal Abseil changes.
--
f9f068aa8a260dc576398e47b8e4540902e41358 by Derek Mauro <dmauro@google.com>:

Fix test string with embedded NUL. Currently parses as octal.

PiperOrigin-RevId: 237088193

--
d271ffdd3f450f817f6d30e98ff39d439aaf3a98 by Abseil Team <absl-team@google.com>:

Make symbolizer examine any mapping with read+exec permission regardless of 'w' bit.

PiperOrigin-RevId: 237056461

--
af315f8306d36a7367a452fd0b58cafdbf20719d by Abseil Team <absl-team@google.com>:

Switch comments referencing base:: CondVar and Mutex to absl::.

PiperOrigin-RevId: 236917884

--
c624d5d1c0bdb917bff5e651ba40599472f84e0e by Gennadiy Rozental <rogeeff@google.com>:

Internal change

PiperOrigin-RevId: 236898300

--
3cdc82429af964846d1152f49148abc61d196a4b by Samuel Benzaquen <sbenza@google.com>:

Make the `long double` overload if AbslHashValue a template to avoid invalid
conversions with implicit operators.

This overload was never meant to capture anything other than `long double` and any current caller to it that wasn't a `long double` is potentially a bug.
In particular, any type with an implicit `bool` conversion is calling this
overload instead of trying to find a hash<> specialization, thus causing
pretty bad hash behavior.

PiperOrigin-RevId: 236877073
GitOrigin-RevId: f9f068aa8a260dc576398e47b8e4540902e41358
Change-Id: If9cc008dd814f0ca06ed881f612c06575f1f7137
Diffstat (limited to 'absl/strings/substitute.h')
-rw-r--r--absl/strings/substitute.h66
1 files changed, 33 insertions, 33 deletions
diff --git a/absl/strings/substitute.h b/absl/strings/substitute.h
index 4de7b4e75ff2..2b74b3829c39 100644
--- a/absl/strings/substitute.h
+++ b/absl/strings/substitute.h
@@ -36,18 +36,18 @@
 // use at that location within the format string.
 //
 // Example 1:
-//   string s = Substitute("$1 purchased $0 $2. Thanks $1!",
-//                         5, "Bob", "Apples");
+//   std::string s = Substitute("$1 purchased $0 $2. Thanks $1!",
+//                              5, "Bob", "Apples");
 //   EXPECT_EQ("Bob purchased 5 Apples. Thanks Bob!", s);
 //
 // Example 2:
-//   string s = "Hi. ";
+//   std::string s = "Hi. ";
 //   SubstituteAndAppend(&s, "My name is $0 and I am $1 years old.", "Bob", 5);
 //   EXPECT_EQ("Hi. My name is Bob and I am 5 years old.", s);
 //
 //
 // Supported types:
-//   * absl::string_view, string, const char* (null is equivalent to "")
+//   * absl::string_view, std::string, const char* (null is equivalent to "")
 //   * int32_t, int64_t, uint32_t, uint64
 //   * float, double
 //   * bool (Printed as "true" or "false")
@@ -456,7 +456,7 @@ void SubstituteAndAppend(
 // Example:
 //  template <typename... Args>
 //  void VarMsg(absl::string_view format, const Args&... args) {
-//    string s = absl::Substitute(format, args...);
+//    std::string s = absl::Substitute(format, args...);
 
 ABSL_MUST_USE_RESULT inline std::string Substitute(absl::string_view format) {
   std::string result;
@@ -574,70 +574,70 @@ std::string Substitute(const char* format, const substitute_internal::Arg& a0)
                      "contains one of $1-$9");
 
 std::string Substitute(const char* format, const substitute_internal::Arg& a0,
-                  const substitute_internal::Arg& a1)
+                       const substitute_internal::Arg& a1)
     ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 3,
                      "There were 2 substitution arguments given, but "
                      "this format std::string is either missing its $0/$1, or "
                      "contains one of $2-$9");
 
 std::string Substitute(const char* format, const substitute_internal::Arg& a0,
-                  const substitute_internal::Arg& a1,
-                  const substitute_internal::Arg& a2)
+                       const substitute_internal::Arg& a1,
+                       const substitute_internal::Arg& a2)
     ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 7,
                      "There were 3 substitution arguments given, but "
                      "this format std::string is either missing its $0/$1/$2, or "
                      "contains one of $3-$9");
 
 std::string Substitute(const char* format, const substitute_internal::Arg& a0,
-                  const substitute_internal::Arg& a1,
-                  const substitute_internal::Arg& a2,
-                  const substitute_internal::Arg& a3)
+                       const substitute_internal::Arg& a1,
+                       const substitute_internal::Arg& a2,
+                       const substitute_internal::Arg& a3)
     ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 15,
                      "There were 4 substitution arguments given, but "
                      "this format std::string is either missing its $0-$3, or "
                      "contains one of $4-$9");
 
 std::string Substitute(const char* format, const substitute_internal::Arg& a0,
-                  const substitute_internal::Arg& a1,
-                  const substitute_internal::Arg& a2,
-                  const substitute_internal::Arg& a3,
-                  const substitute_internal::Arg& a4)
+                       const substitute_internal::Arg& a1,
+                       const substitute_internal::Arg& a2,
+                       const substitute_internal::Arg& a3,
+                       const substitute_internal::Arg& a4)
     ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 31,
                      "There were 5 substitution arguments given, but "
                      "this format std::string is either missing its $0-$4, or "
                      "contains one of $5-$9");
 
 std::string Substitute(const char* format, const substitute_internal::Arg& a0,
-                  const substitute_internal::Arg& a1,
-                  const substitute_internal::Arg& a2,
-                  const substitute_internal::Arg& a3,
-                  const substitute_internal::Arg& a4,
-                  const substitute_internal::Arg& a5)
+                       const substitute_internal::Arg& a1,
+                       const substitute_internal::Arg& a2,
+                       const substitute_internal::Arg& a3,
+                       const substitute_internal::Arg& a4,
+                       const substitute_internal::Arg& a5)
     ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 63,
                      "There were 6 substitution arguments given, but "
                      "this format std::string is either missing its $0-$5, or "
                      "contains one of $6-$9");
 
 std::string Substitute(const char* format, const substitute_internal::Arg& a0,
-                  const substitute_internal::Arg& a1,
-                  const substitute_internal::Arg& a2,
-                  const substitute_internal::Arg& a3,
-                  const substitute_internal::Arg& a4,
-                  const substitute_internal::Arg& a5,
-                  const substitute_internal::Arg& a6)
+                       const substitute_internal::Arg& a1,
+                       const substitute_internal::Arg& a2,
+                       const substitute_internal::Arg& a3,
+                       const substitute_internal::Arg& a4,
+                       const substitute_internal::Arg& a5,
+                       const substitute_internal::Arg& a6)
     ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 127,
                      "There were 7 substitution arguments given, but "
                      "this format std::string is either missing its $0-$6, or "
                      "contains one of $7-$9");
 
 std::string Substitute(const char* format, const substitute_internal::Arg& a0,
-                  const substitute_internal::Arg& a1,
-                  const substitute_internal::Arg& a2,
-                  const substitute_internal::Arg& a3,
-                  const substitute_internal::Arg& a4,
-                  const substitute_internal::Arg& a5,
-                  const substitute_internal::Arg& a6,
-                  const substitute_internal::Arg& a7)
+                       const substitute_internal::Arg& a1,
+                       const substitute_internal::Arg& a2,
+                       const substitute_internal::Arg& a3,
+                       const substitute_internal::Arg& a4,
+                       const substitute_internal::Arg& a5,
+                       const substitute_internal::Arg& a6,
+                       const substitute_internal::Arg& a7)
     ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 255,
                      "There were 8 substitution arguments given, but "
                      "this format std::string is either missing its $0-$7, or "