summaryrefslogtreecommitdiff
path: root/absl/strings/substitute.h
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2022-12-02 08:58:00 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2022-12-02 08:58:36 -0800
commitafcb7de0cfe94ad2ec95dfd0380f74a4b972401c (patch)
tree463f2a6ccbfbe3fead74c7d1f48e815e00d4501f /absl/strings/substitute.h
parent7cbdff8c13503561a166438e45bc37c5c5d0066b (diff)
Add AbslStringify support for enum types in Substitute.
PiperOrigin-RevId: 492481345 Change-Id: Ie77656ed334b54930ee852d31e2794a1fc58ce2f
Diffstat (limited to 'absl/strings/substitute.h')
-rw-r--r--absl/strings/substitute.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/absl/strings/substitute.h b/absl/strings/substitute.h
index 5c3f6eff..d6a5a690 100644
--- a/absl/strings/substitute.h
+++ b/absl/strings/substitute.h
@@ -203,7 +203,8 @@ class Arg {
// This overload matches only scoped enums.
template <typename T,
typename = typename std::enable_if<
- std::is_enum<T>{} && !std::is_convertible<T, int>{}>::type>
+ std::is_enum<T>{} && !std::is_convertible<T, int>{} &&
+ !strings_internal::HasAbslStringify<T>::value>::type>
Arg(T value) // NOLINT(google-explicit-constructor)
: Arg(static_cast<typename std::underlying_type<T>::type>(value)) {}