F* src = reinterpret_cast<F*>(&buffer);
F code = std::move(*src);
src->~F();
F* src = reinterpret_cast<F*>(&buffer);
F code = std::move(*src);
src->~F();
- return code(std::forward<Args>(args)...);
+ return code(std::move(args)...);
},
// Destroy:
std::is_trivially_destructible<F>::value ?
},
// Destroy:
std::is_trivially_destructible<F>::value ?
[](TaskUnion& buffer, Args&&... args) {
// Delete F when we go out of scope:
std::unique_ptr<F> code(*reinterpret_cast<F**>(&buffer));
[](TaskUnion& buffer, Args&&... args) {
// Delete F when we go out of scope:
std::unique_ptr<F> code(*reinterpret_cast<F**>(&buffer));
- return (*code)(std::forward<Args>(args)...);
+ return (*code)(std::move(args)...);
},
// Destroy:
[](TaskUnion& buffer) {
},
// Destroy:
[](TaskUnion& buffer) {
throw std::bad_function_call();
const TaskVtable* vtable = vtable_;
vtable_ = nullptr;
throw std::bad_function_call();
const TaskVtable* vtable = vtable_;
vtable_ = nullptr;
- return vtable->call(buffer_, std::forward<Args>(args)...);
+ return vtable->call(buffer_, std::move(args)...);