diff options
-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; |