std::shared_ptr<const std::vector<std::string>> args_;
public:
- MainFunction(F code, std::vector<std::string> args)
+ MainFunction(F code, std::vector<std::string>&& args)
: code_(std::move(code)), args_(std::make_shared<const std::vector<std::string>>(std::move(args)))
{
}
}
};
-template <class F> inline std::function<void()> wrap_main(F code, std::vector<std::string> args)
+template <class F> inline std::function<void()> wrap_main(F code, std::vector<std::string>&& args)
{
return MainFunction<F>(std::move(code), std::move(args));
}
vtable_ = that.vtable_;
that.vtable_ = nullptr;
}
- Task& operator=(Task that)
+ Task& operator=(Task const& that) = delete;
+ Task& operator=(Task&& that)
{
this->clear();
if (that.vtable_ && that.vtable_->move)