Skip to content

Commit

Permalink
when_all: stop using deprecated std::aligned_union_t
Browse files Browse the repository at this point in the history
since [P1413R3](https://wg21.link/p1413r3) was accepted by C++23,
std::aligned_union_t was deprecated in this standard. so let's be
prepared for this. as suggested by the proposal, we are replacing
`std::aligned_union_t` with an array of `std::byte`.

Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov authored and avikivity committed Jul 10, 2024
1 parent 7fcc990 commit 52f1ec2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/seastar/core/when_all.hh
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class when_all_state : public when_all_state_base {
// We only schedule one continuation at a time, and store it in _cont.
// This way, if while the future we wait for completes, some other futures
// also complete, we won't need to schedule continuations for them.
std::aligned_union_t<1, when_all_state_component<Futures>...> _cont;
alignas(when_all_state_component<Futures>...) std::byte _cont[std::max({sizeof(when_all_state_component<Futures>)...})];
when_all_process_element _processors[nr];
public:
typename ResolvedTupleTransform::promise_type p;
Expand Down

0 comments on commit 52f1ec2

Please sign in to comment.