summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Matt Kulukundis <kfm@google.com>2022-09-29 13:42:28 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2022-09-29 13:43:13 -0700
commit40ede06edcc02fa1762bb0e445cef833f5856fba (patch)
tree6e6dc794e82f98f90d5f6d5756ec55ab8944336d
parentf8b5a041bd596a72197b6f23082e9a90844d5ae1 (diff)
Improve the comments on the implementation of format hooks adl tricks.
PiperOrigin-RevId: 477811281 Change-Id: Iba838e0eaceb5e6bfe1dac496fc86a22f5cf31d5
-rw-r--r--absl/strings/internal/str_format/arg.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/absl/strings/internal/str_format/arg.h b/absl/strings/internal/str_format/arg.h
index 3d616dba..b3e4ff15 100644
--- a/absl/strings/internal/str_format/arg.h
+++ b/absl/strings/internal/str_format/arg.h
@@ -60,7 +60,12 @@ struct HasUserDefinedConvert<T, void_t<decltype(AbslFormatConvert(
std::declval<FormatSink*>()))>>
: std::true_type {};
-void AbslFormatConvert(); // Stops the lexical name lookup
+// These declarations prevent ADL lookup from continuing in absl namespaces,
+// we are deliberately using these as ADL hooks and want them to consider
+// non-absl namespaces only.
+void AbslFormatConvert();
+void AbslStringify();
+
template <typename T>
auto FormatConvertImpl(const T& v, FormatConversionSpecImpl conv,
FormatSinkImpl* sink)
@@ -76,7 +81,6 @@ auto FormatConvertImpl(const T& v, FormatConversionSpecImpl conv,
return AbslFormatConvert(v, fcs, &fs);
}
-void AbslStringify(); // Stops the lexical name lookup
template <typename T>
auto FormatConvertImpl(const T& v, FormatConversionSpecImpl,
FormatSinkImpl* sink)