From eb769815864694e6a56907005f85625461c4b796 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Tue, 7 Apr 2026 11:54:45 -0700 Subject: [PATCH] Inline absl::void_t to std::void_t wherever possible This won't replace all call sites, but that's fine. We only want to replace the call sites that compile fine, since they don't need to use absl::void_t. PiperOrigin-RevId: 896017307 Change-Id: I7e78066dc973e135922b11fba5c7642563ef6a67 --- absl/meta/type_traits.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/absl/meta/type_traits.h b/absl/meta/type_traits.h index 9013aead..bcc3a987 100644 --- a/absl/meta/type_traits.h +++ b/absl/meta/type_traits.h @@ -104,11 +104,13 @@ struct is_detected : is_detected_impl::type {}; // metafunction allows you to create a general case that maps to `void` while // allowing specializations that map to specific types. // -// This metafunction is not 100% compatible with the C++17 `std::void_t` -// metafunction. It has slightly different behavior, such as when ordering -// partial specializations. It is recommended to use `std::void_t` instead. +// This metafunction is a workaround for some implementations of `std::void_t` +// that evaluate to `void` prematurely, causing partial specializations to +// appear duplicated (and thus invalid) to the compiler prior to substitution +// taking place. Whenever possible, use `std::void_t` instead. template -using void_t = typename type_traits_internal::VoidTImpl::type; +using void_t ABSL_REFACTOR_INLINE = + typename type_traits_internal::VoidTImpl::type; // Historical note: Abseil once provided implementations of these type traits // for platforms that lacked full support. New code should prefer to use the