Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove aligned_storage and aligned_union since C++23 #520

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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