if (that.vtable_ && that.vtable_->move)
that.vtable_->move(buffer_, that.buffer_);
else
if (that.vtable_ && that.vtable_->move)
that.vtable_->move(buffer_, that.buffer_);
else
if (that.vtable_ && that.vtable_->move)
that.vtable_->move(buffer_, that.buffer_);
else
if (that.vtable_ && that.vtable_->move)
that.vtable_->move(buffer_, that.buffer_);
else
// Delete F when we go out of scope:
std::unique_ptr<F> code(*reinterpret_cast<F**>(&buffer));
return (*code)(std::forward<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)...);
operator bool() const { return vtable_ != nullptr; }
bool operator!() const { return vtable_ == nullptr; }
operator bool() const { return vtable_ != nullptr; }
bool operator!() const { return vtable_ == nullptr; }
-> Task< decltype(code(std::move(args)...))() >
{
TaskImpl<F, Args...> task(std::move(code), std::make_tuple(std::move(args)...));
-> Task< decltype(code(std::move(args)...))() >
{
TaskImpl<F, Args...> task(std::move(code), std::make_tuple(std::move(args)...));