Skip to content

Commit

Permalink
Remove aligned_storage and aligned_union since C++23
Browse files Browse the repository at this point in the history
  • Loading branch information
ecatmur committed Aug 1, 2023
1 parent d3634a3 commit 6989b09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/boost/hana/traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ namespace boost { namespace hana { namespace traits {
BOOST_HANA_INLINE_VARIABLE constexpr auto remove_all_extents = metafunction<std::remove_all_extents>;

// Miscellaneous transformations
#if __cplusplus < 202302L
BOOST_HANA_INLINE_VARIABLE constexpr struct aligned_storage_t {
template <typename Len, typename Align>
constexpr auto operator()(Len const&, Align const&) const {
Expand All @@ -190,6 +191,7 @@ namespace boost { namespace hana { namespace traits {
return hana::type_c<Result>;
}
} aligned_union{};
#endif

BOOST_HANA_INLINE_VARIABLE constexpr auto decay = metafunction<std::decay>;
// enable_if
Expand Down
2 changes: 2 additions & 0 deletions test/type/traits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,11 @@ int main() {
hana::traits::remove_all_extents(s);

// Miscellaneous transformations
#if __cplusplus < 202302L
hana::traits::aligned_storage(hana::size_c<1>);
hana::traits::aligned_storage(hana::size_c<1>, hana::size_c<1>);
hana::traits::aligned_union(hana::size_c<0>, s);
#endif
hana::traits::decay(s);

hana::traits::common_type(s, s);
Expand Down

0 comments on commit 6989b09

Please sign in to comment.