about summary refs log tree commit diff
path: root/absl/strings/internal/str_format/extension.h
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2020-03-16T16·06-0700
committervslashg <gfalcon@google.com>2020-03-16T19·11-0400
commit7853a7586c492ce8905c9e49f8679dada6354f2c (patch)
tree987d340989dde52a3ca9e7a5965e119e0241c4c2 /absl/strings/internal/str_format/extension.h
parentc6954897f7ece5011f0126db9117361dc1a6ff36 (diff)
Export of internal Abseil changes
--
91ca367a7548270155721bdda74611aeea2a2153 by Abseil Team <absl-team@google.com>:

Replace the only usage of btree_node::swap with simpler logic using transfers and delete btree_node::swap.

Add a benchmark for constructing small containers.

PiperOrigin-RevId: 301169874

--
ff9d73a7125b7f8ab5733cda877204dfbfac138e by Derek Mauro <dmauro@google.com>:

Ensure ABSL_CXX_STANDARD is set.
Fixes #640

PiperOrigin-RevId: 301160106

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

Rollback the change to make Cord iterators a fixed size.  That change increased the iterator size, which can cause a deep recursion call to hit the stack memory limit, in turn causing a signal 11 failure.

PiperOrigin-RevId: 301084915

--
619e3cd9e56408bdb8b3b5a1e08dda1e95242264 by Matthew Brown <matthewbr@google.com>:

Internal Change

PiperOrigin-RevId: 300832828

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

Fix for empty braces support.

We will call proper aggregate construction in case when {} is used as default value. In other words instead of "new T", we'll call "new T{}".

PiperOrigin-RevId: 300715686

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

Emscripten supports thread-local storage nowadays.

PiperOrigin-RevId: 300675185
GitOrigin-RevId: 91ca367a7548270155721bdda74611aeea2a2153
Change-Id: I3344f745f9c3fc78775532b1808442fabd98e34a
Diffstat (limited to 'absl/strings/internal/str_format/extension.h')
-rw-r--r--absl/strings/internal/str_format/extension.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/absl/strings/internal/str_format/extension.h b/absl/strings/internal/str_format/extension.h
index d1665753d182..968850ebfc84 100644
--- a/absl/strings/internal/str_format/extension.h
+++ b/absl/strings/internal/str_format/extension.h
@@ -24,6 +24,7 @@
 
 #include "absl/base/config.h"
 #include "absl/base/port.h"
+#include "absl/meta/type_traits.h"
 #include "absl/strings/internal/str_format/output.h"
 #include "absl/strings/string_view.h"
 
@@ -365,11 +366,22 @@ constexpr FormatConversionCharSet operator|(FormatConversionCharSet a,
                                  static_cast<uint64_t>(b));
 }
 
+// Overloaded conversion functions to support absl::ParsedFormat.
 // Get a conversion with a single character in it.
-constexpr FormatConversionCharSet ConversionCharToConv(char c) {
-  return FormatConversionCharSet(FormatConversionCharToConvValue(c));
+constexpr FormatConversionCharSet ToFormatConversionCharSet(char c) {
+  return static_cast<FormatConversionCharSet>(
+      FormatConversionCharToConvValue(c));
 }
 
+// Get a conversion with a single character in it.
+constexpr FormatConversionCharSet ToFormatConversionCharSet(
+    FormatConversionCharSet c) {
+  return c;
+}
+
+template <typename T>
+void ToFormatConversionCharSet(T) = delete;
+
 // Checks whether `c` exists in `set`.
 constexpr bool Contains(FormatConversionCharSet set, char c) {
   return (static_cast<uint64_t>(set) & FormatConversionCharToConvValue(c)) != 0;