@@ -166,8 +166,8 @@ struct task_base_deleter {
166
166
template <typename Result>
167
167
struct task_result_holder : public task_base {
168
168
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)] ;
171
171
172
172
// Scheduler that should be used to schedule this task. The scheduler
173
173
// type has been erased and is held by vtable->schedule.
@@ -208,7 +208,7 @@ struct task_result_holder<Result&>: public task_base {
208
208
union {
209
209
// Store as pointer internally
210
210
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)] ;
212
212
void * sched;
213
213
};
214
214
@@ -233,7 +233,7 @@ struct task_result_holder<Result&>: public task_base {
233
233
template <>
234
234
struct task_result_holder <fake_void>: public task_base {
235
235
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)] ;
237
237
void * sched;
238
238
};
239
239
@@ -344,7 +344,7 @@ struct func_base<Func, typename std::enable_if<std::is_empty<Func>::value>::type
344
344
// Class to hold a function object and initialize/destroy it at any time
345
345
template <typename Func, typename = void >
346
346
struct 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)] ;
348
348
349
349
Func& get_func ()
350
350
{
0 commit comments