From 04596b253fb511069538cab453166c05a1567705 Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Mon, 28 Nov 2022 09:36:14 -0800 Subject: Add a TODO for the deprecation of absl::aligned_storage_t PiperOrigin-RevId: 491367420 Change-Id: I6a0ab74bb0675fd910ed9fc95ee20c5023eb0cb6 --- absl/meta/type_traits.h | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'absl/meta/type_traits.h') 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 > -struct default_alignment_of_aligned_storage; - -template -struct default_alignment_of_aligned_storage> { - static constexpr size_t value = Align; -}; - //////////////////////////////// // Library Fundamentals V2 TS // //////////////////////////////// @@ -642,6 +630,21 @@ using remove_extent_t = typename std::remove_extent::type; template using remove_all_extents_t = typename std::remove_all_extents::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 > +struct default_alignment_of_aligned_storage; + +template +struct default_alignment_of_aligned_storage< + Len, std::aligned_storage> { + static constexpr size_t value = Align; +}; +} // namespace type_traits_internal + +// TODO(b/260219225): std::aligned_storage(_t) is deprecated in C++23. template ::value> using aligned_storage_t = typename std::aligned_storage::type; -- cgit v1.2.3