diff options
author | Lawrence Wolf-Sonkin <lawrencews@google.com> | 2024-04-18 09:15:45 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-04-18 09:16:33 -0700 |
commit | 9a61b00dde4031f17ed4fa4bdc0e0e9ad8859846 (patch) | |
tree | 2c23377e04c2548d9b8c1637da1567ba8c156993 /absl/container/internal | |
parent | 6645f3141269fdb88ba772439f7af7bcd87dd39a (diff) |
[absl] Re-use the existing `std::type_identity` backfill instead of redefining it again
* Specifically, using `absl::internal::type_identity_t` instead of a reimplementation thereof (`NoTypeDeduction`) in the `absl::InlinedVector` code
PiperOrigin-RevId: 626055714
Change-Id: I3f5a9a1c25480bc4431edbcc4784e6bc8d257f8d
Diffstat (limited to 'absl/container/internal')
-rw-r--r-- | absl/container/internal/inlined_vector.h | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/absl/container/internal/inlined_vector.h b/absl/container/internal/inlined_vector.h index a1575328..2f24e461 100644 --- a/absl/container/internal/inlined_vector.h +++ b/absl/container/internal/inlined_vector.h @@ -27,6 +27,7 @@ #include "absl/base/attributes.h" #include "absl/base/config.h" +#include "absl/base/internal/identity.h" #include "absl/base/macros.h" #include "absl/container/internal/compressed_tuple.h" #include "absl/memory/memory.h" @@ -82,16 +83,6 @@ using IsMoveAssignOk = std::is_move_assignable<ValueType<A>>; template <typename A> using IsSwapOk = absl::type_traits_internal::IsSwappable<ValueType<A>>; -template <typename T> -struct TypeIdentity { - using type = T; -}; - -// Used for function arguments in template functions to prevent ADL by forcing -// callers to explicitly specify the template parameter. -template <typename T> -using NoTypeDeduction = typename TypeIdentity<T>::type; - template <typename A, bool IsTriviallyDestructible = absl::is_trivially_destructible<ValueType<A>>::value> struct DestroyAdapter; @@ -139,7 +130,7 @@ struct MallocAdapter { }; template <typename A, typename ValueAdapter> -void ConstructElements(NoTypeDeduction<A>& allocator, +void ConstructElements(absl::internal::type_identity_t<A>& allocator, Pointer<A> construct_first, ValueAdapter& values, SizeType<A> construct_size) { for (SizeType<A> i = 0; i < construct_size; ++i) { |