From 6a19ff47352a2112e953f4ab813d820e0ecfe1e3 Mon Sep 17 00:00:00 2001 From: Lawrence Wolf-Sonkin Date: Thu, 28 Dec 2023 14:26:18 -0800 Subject: [absl] Rename `absl::internal::identity` to `absl::internal::type_identity` * Also does this for `absl::internal::identity_t` which is now `absl::internal::type_identity_t` * This is clearer naming as this is a backfill of `std::type_identity` (the identity type), and not `std::identity` (the identity function) PiperOrigin-RevId: 594316002 Change-Id: I5fb8cf7e3d07c1bc736cbecd202e7d556b6ea33e --- absl/base/internal/inline_variable.h | 37 ++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'absl/base/internal/inline_variable.h') diff --git a/absl/base/internal/inline_variable.h b/absl/base/internal/inline_variable.h index df933faf..09daf0f5 100644 --- a/absl/base/internal/inline_variable.h +++ b/absl/base/internal/inline_variable.h @@ -63,12 +63,12 @@ // Bug: https://bugs.llvm.org/show_bug.cgi?id=35862 // // Note: -// identity_t is used here so that the const and name are in the +// type_identity_t is used here so that the const and name are in the // appropriate place for pointer types, reference types, function pointer // types, etc.. #if defined(__clang__) #define ABSL_INTERNAL_EXTERN_DECL(type, name) \ - extern const ::absl::internal::identity_t name; + extern const ::absl::internal::type_identity_t name; #else // Otherwise, just define the macro to do nothing. #define ABSL_INTERNAL_EXTERN_DECL(type, name) #endif // defined(__clang__) @@ -76,30 +76,31 @@ // See above comment at top of file for details. #define ABSL_INTERNAL_INLINE_CONSTEXPR(type, name, init) \ ABSL_INTERNAL_EXTERN_DECL(type, name) \ - inline constexpr ::absl::internal::identity_t name = init + inline constexpr ::absl::internal::type_identity_t name = init #else // See above comment at top of file for details. // // Note: -// identity_t is used here so that the const and name are in the +// type_identity_t is used here so that the const and name are in the // appropriate place for pointer types, reference types, function pointer // types, etc.. -#define ABSL_INTERNAL_INLINE_CONSTEXPR(var_type, name, init) \ - template \ - struct AbslInternalInlineVariableHolder##name { \ - static constexpr ::absl::internal::identity_t kInstance = init; \ - }; \ - \ - template \ - constexpr ::absl::internal::identity_t \ - AbslInternalInlineVariableHolder##name::kInstance; \ - \ - static constexpr const ::absl::internal::identity_t& \ - name = /* NOLINT */ \ - AbslInternalInlineVariableHolder##name<>::kInstance; \ - static_assert(sizeof(void (*)(decltype(name))) != 0, \ +#define ABSL_INTERNAL_INLINE_CONSTEXPR(var_type, name, init) \ + template \ + struct AbslInternalInlineVariableHolder##name { \ + static constexpr ::absl::internal::type_identity_t kInstance = \ + init; \ + }; \ + \ + template \ + constexpr ::absl::internal::type_identity_t \ + AbslInternalInlineVariableHolder##name::kInstance; \ + \ + static constexpr const ::absl::internal::type_identity_t& \ + name = /* NOLINT */ \ + AbslInternalInlineVariableHolder##name<>::kInstance; \ + static_assert(sizeof(void (*)(decltype(name))) != 0, \ "Silence unused variable warnings.") #endif // __cpp_inline_variables -- cgit v1.2.3