Skip to content

Commit eb76981

Browse files
Abseil Teamcopybara-github
authored andcommitted
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
1 parent e7c4768 commit eb76981

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

absl/meta/type_traits.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,13 @@ struct is_detected : is_detected_impl<void, Op, Args...>::type {};
104104
// metafunction allows you to create a general case that maps to `void` while
105105
// allowing specializations that map to specific types.
106106
//
107-
// This metafunction is not 100% compatible with the C++17 `std::void_t`
108-
// metafunction. It has slightly different behavior, such as when ordering
109-
// partial specializations. It is recommended to use `std::void_t` instead.
107+
// This metafunction is a workaround for some implementations of `std::void_t`
108+
// that evaluate to `void` prematurely, causing partial specializations to
109+
// appear duplicated (and thus invalid) to the compiler prior to substitution
110+
// taking place. Whenever possible, use `std::void_t` instead.
110111
template <typename... Ts>
111-
using void_t = typename type_traits_internal::VoidTImpl<Ts...>::type;
112+
using void_t ABSL_REFACTOR_INLINE =
113+
typename type_traits_internal::VoidTImpl<Ts...>::type;
112114

113115
// Historical note: Abseil once provided implementations of these type traits
114116
// for platforms that lacked full support. New code should prefer to use the

0 commit comments

Comments
 (0)