Skip to content

Commit

Permalink
Replace deprecated std::aligned_union with array
Browse files Browse the repository at this point in the history
  • Loading branch information
vasama authored and ispeters committed May 22, 2023
1 parent fd17ef6 commit a6e625a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/unifex/manual_lifetime_union.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <unifex/manual_lifetime.hpp>
#include <unifex/scope_guard.hpp>

#include <algorithm>
#include <utility>
#include <type_traits>

Expand Down Expand Up @@ -69,7 +70,7 @@ class manual_lifetime_union {
}

private:
std::aligned_union_t<0, manual_lifetime<Ts>...> storage_;
alignas(Ts...) unsigned char storage_[std::max({ sizeof(manual_lifetime<Ts>)... })];
};

template <>
Expand Down

0 comments on commit a6e625a

Please sign in to comment.