Commit 04596b25 by Derek Mauro Committed by Copybara-Service

Add a TODO for the deprecation of absl::aligned_storage_t

PiperOrigin-RevId: 491367420
Change-Id: I6a0ab74bb0675fd910ed9fc95ee20c5023eb0cb6
parent 091842be
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment