File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 1616#define INCLUDE_STATIC_ANY
1717
1818#include < any>
19+ #include < bit>
1920#include < cstddef>
2021#include < initializer_list>
2122#include < memory>
@@ -491,6 +492,11 @@ any_cast(_any::base<U, V>&& a) {
491492 throw std::bad_any_cast ();
492493}
493494
495+ template <std::size_t S, std::size_t Alignment = std::bit_ceil(S)>
496+ struct alignas (Alignment) aligned_storage {
497+ std::byte data[S];
498+ };
499+
494500// `immobile_any`
495501// ==============
496502//
@@ -508,12 +514,11 @@ any_cast(_any::base<U, V>&& a) {
508514// invoked when they throw.
509515//
510516template <std::size_t S>
511- class immobile_any : public _any ::base<immobile_any<S>,
512- std::aligned_storage_t <S>> {
513- using base = _any::base<immobile_any<S>, std::aligned_storage_t <S>>;
517+ class immobile_any : public _any ::base<immobile_any<S>, aligned_storage<S>> {
518+ using base = _any::base<immobile_any<S>, aligned_storage<S>>;
514519 friend base;
515520
516- using _any::base<immobile_any<S>, std:: aligned_storage_t <S>>::storage;
521+ using _any::base<immobile_any<S>, aligned_storage <S>>::storage;
517522
518523 // Superclass requirements!
519524 // ------------------------
You can’t perform that action at this time.
0 commit comments