diff options
author | Derek Mauro <dmauro@google.com> | 2022-11-28 09:36:14 -0800 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-11-28 09:37:03 -0800 |
commit | 04596b253fb511069538cab453166c05a1567705 (patch) | |
tree | 368297e5737dcb170150c7e7f3f66720fb83d061 | |
parent | 091842beeac564776c231e7d1787b527d1c2d0d9 (diff) |
Add a TODO for the deprecation of absl::aligned_storage_t
PiperOrigin-RevId: 491367420
Change-Id: I6a0ab74bb0675fd910ed9fc95ee20c5023eb0cb6
-rw-r--r-- | absl/meta/type_traits.h | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/absl/meta/type_traits.h b/absl/meta/type_traits.h index 6e6001fe..dd9de42f 100644 --- a/absl/meta/type_traits.h +++ b/absl/meta/type_traits.h @@ -114,18 +114,6 @@ struct VoidTImpl { using type = void; }; -// This trick to retrieve a default alignment is necessary for our -// implementation of aligned_storage_t to be consistent with any implementation -// of std::aligned_storage. -template <size_t Len, typename T = std::aligned_storage<Len>> -struct default_alignment_of_aligned_storage; - -template <size_t Len, size_t Align> -struct default_alignment_of_aligned_storage<Len, - std::aligned_storage<Len, Align>> { - static constexpr size_t value = Align; -}; - //////////////////////////////// // Library Fundamentals V2 TS // //////////////////////////////// @@ -642,6 +630,21 @@ using remove_extent_t = typename std::remove_extent<T>::type; template <typename T> using remove_all_extents_t = typename std::remove_all_extents<T>::type; +namespace type_traits_internal { +// This trick to retrieve a default alignment is necessary for our +// implementation of aligned_storage_t to be consistent with any +// implementation of std::aligned_storage. +template <size_t Len, typename T = std::aligned_storage<Len>> +struct default_alignment_of_aligned_storage; + +template <size_t Len, size_t Align> +struct default_alignment_of_aligned_storage< + Len, std::aligned_storage<Len, Align>> { + static constexpr size_t value = Align; +}; +} // namespace type_traits_internal + +// TODO(b/260219225): std::aligned_storage(_t) is deprecated in C++23. template <size_t Len, size_t Align = type_traits_internal:: default_alignment_of_aligned_storage<Len>::value> using aligned_storage_t = typename std::aligned_storage<Len, Align>::type; |