@@ -166,8 +166,8 @@ struct task_base_deleter {
166166template <typename Result>
167167struct task_result_holder : public task_base {
168168 union {
169- typename std::aligned_storage< sizeof (Result), std::alignment_of<Result>::value>::type result;
170- std::aligned_storage< sizeof (std::exception_ptr), std::alignment_of< std::exception_ptr>::value>::type except ;
169+ alignas (Result) std::uint8_t result[ sizeof (Result)] ;
170+ alignas (std::exception_ptr) std::uint8_t except[ sizeof ( std::exception_ptr)] ;
171171
172172 // Scheduler that should be used to schedule this task. The scheduler
173173 // type has been erased and is held by vtable->schedule.
@@ -208,7 +208,7 @@ struct task_result_holder<Result&>: public task_base {
208208 union {
209209 // Store as pointer internally
210210 Result* result;
211- std::aligned_storage< sizeof (std::exception_ptr), std::alignment_of< std::exception_ptr>::value>::type except ;
211+ alignas (std::exception_ptr) std::uint8_t except[ sizeof ( std::exception_ptr)] ;
212212 void * sched;
213213 };
214214
@@ -233,7 +233,7 @@ struct task_result_holder<Result&>: public task_base {
233233template <>
234234struct task_result_holder <fake_void>: public task_base {
235235 union {
236- std::aligned_storage< sizeof (std::exception_ptr), std::alignment_of< std::exception_ptr>::value>::type except ;
236+ alignas (std::exception_ptr) std::uint8_t except[ sizeof ( std::exception_ptr)] ;
237237 void * sched;
238238 };
239239
@@ -344,7 +344,7 @@ struct func_base<Func, typename std::enable_if<std::is_empty<Func>::value>::type
344344// Class to hold a function object and initialize/destroy it at any time
345345template <typename Func, typename = void >
346346struct func_holder {
347- typename std::aligned_storage< sizeof (Func), std::alignment_of<Func>::value>::type func;
347+ alignas (Func) std::uint8_t func[ sizeof (Func)] ;
348348
349349 Func& get_func ()
350350 {
0 commit comments